How to change whitelist

What I want to do

I want to use Ratel to change schema

What I did

I use docker run a alpha and a zero node,then I entry the alpha with

docker exec -it 3d54781ed66b bash

Next,I use

dgraph alpha --security whitelist=172.0.0.1

or

dgraph alpha --security whitelist=0.0.0.0/0

but I get the same error

2023/06/08 08:40:28 Cannot acquire directory lock on "p".  Another process is using this Badger database. error: resource temporarily unavailable
Error while creating badger KV posting store
github.com/dgraph-io/dgraph/x.Checkf
	/home/runner/work/dgraph/dgraph/x/error.go:51
github.com/dgraph-io/dgraph/worker.(*ServerState).initStorage
	/home/runner/work/dgraph/dgraph/worker/server_state.go:144
github.com/dgraph-io/dgraph/worker.InitServerState
	/home/runner/work/dgraph/dgraph/worker/server_state.go:79
github.com/dgraph-io/dgraph/dgraph/cmd/alpha.run
	/home/runner/work/dgraph/dgraph/dgraph/cmd/alpha/run.go:746
github.com/dgraph-io/dgraph/dgraph/cmd/alpha.init.1.func1
	/home/runner/work/dgraph/dgraph/dgraph/cmd/alpha/run.go:92
github.com/spf13/cobra.(*Command).execute
	/home/runner/go/pkg/mod/github.com/spf13/cobra@v0.0.5/command.go:830
github.com/spf13/cobra.(*Command).ExecuteC
	/home/runner/go/pkg/mod/github.com/spf13/cobra@v0.0.5/command.go:914
github.com/spf13/cobra.(*Command).Execute
	/home/runner/go/pkg/mod/github.com/spf13/cobra@v0.0.5/command.go:864
github.com/dgraph-io/dgraph/dgraph/cmd.Execute
	/home/runner/work/dgraph/dgraph/dgraph/cmd/root.go:77
main.main
	/home/runner/work/dgraph/dgraph/dgraph/main.go:98
runtime.main
	/opt/hostedtoolcache/go/1.19.8/x64/src/runtime/proc.go:250
runtime.goexit
	/opt/hostedtoolcache/go/1.19.8/x64/src/runtime/asm_amd64.s:1594
root@3d54781ed66b:/dgraph# exit

dgraph version

How are you spinning up your cluster? I’m guessing you are entering a container that is already running the alpha server, so it is complaining that is cannot acquire a lock on the p directory (because the server is already using this directory).

Here is a sample docker compose file to set up the cluster. If you want to add a whitelist you can add the --security flag to the alpha initialization command.

yes ,you’re right .I 'm runing a alpha instance .but if I don’t run it ,I could not use the cLI,such as set the whitelist.

The whitelist is a flag param. Not a CLI command. All flags must be set and “boot” time.