etcd-io / etcd

Distributed reliable key-value store for the most critical data of a distributed system
https://etcd.io
Apache License 2.0
47.85k stars 9.77k forks source link

What is the difference between the configuration file and the configuration flag format? #13186

Closed mymeatball closed 3 years ago

mymeatball commented 3 years ago

etcd version:3.4.14

I tried to start etcd using the configuration file. The cluster started successfully, but my apisix connection reported an error.But if I start etcd with the configuration file flag, apisix can run normally. I have three nodes to form an etcd cluster. The configuration file only differs in name and node ip. The configuration file is as follows:

name: etcd3 data-dir: /home/service/app/etcd-v3.4.14-linux-amd64/default.etcd snapshot-count: 10000 heartbeat-interval: 100 election-timeout: 1000 quota-backend-bytes: 8589934592 listen-peer-urls: http://172.24.31.22:2380 listen-client-urls: http://172.24.31.22:2379,http://127.0.0.1:2379 initial-advertise-peer-urls: http://172.24.31.22:2380 advertise-client-urls: http://172.24.31.22:2379 initial-cluster: etcd1=http://172.24.31.25:2380,etcd2=http://172.24.31.24:2380,etcd3=http://172.24.31.22:2380 initial-cluster-token: 'etcd-cluster' initial-cluster-state: 'new' logger: zap auto-compaction-retention: '1' max-request-bytes: 33554432 log-level: debug

My startup script is as follows: nohup /home/service/app/etcd-v3.4.14-linux-amd64/etcd \ --config-file=/home/service/app/etcd-v3.4.14-linux-amd64/etcd.conf.yml \ &

Apisix will throw an exception as shown in the figure: image

But if I start etcd with the configuration flag, apisix can run normally. The startup script of my configuration flag is as follows: NAME_1=etcd1 NAME_2=etcd2 NAME_3=etcd3 HOST_1=172.24.31.25 HOST_2=172.24.31.24 HOST_3=172.24.31.22 THIS_NAME=${NAME_3} #Each node is different and will be modified THIS_IP=${HOST_3} #Each node is different and will be modified CLUSTER=${NAME_1}=http://${HOST_1}:2380,${NAME_2}=http://${HOST_2}:2380,${NAME_3}=http://${HOST_3}:2380 CLUSTER_STATE=$1 if [ ! $CLUSTER_STATE ]; then echo "please add cluster state, at the end of the command, such as : | new | existing |" else nohup /home/service/app/etcd-v3.4.14-linux-amd64/etcd \ --name=${THIS_NAME} \ --data-dir="/home/service/app/etcd-v3.4.14-linux-amd64/default.etcd" \ --listen-peer-urls="http://${THIS_IP}:2380" \ --listen-client-urls="http://${THIS_IP}:2379,http://127.0.0.1:2379" \ --advertise-client-urls="http://${THIS_IP}:2379" \ --initial-advertise-peer-urls="http://${THIS_IP}:2380" \ --initial-cluster=${CLUSTER} \ --initial-cluster-token="etcd-cluster" \ --initial-cluster-state=${CLUSTER_STATE} \ --auto-compaction-retention="1" \ --max-request-bytes="33554432" \ --quota-backend-bytes="8589934592" \ --snapshot-count="10000" \ --heartbeat-interval="100" \ --election-timeout="1000" \ --log-level=debug \ --logger=zap \ & fi

My question is: Is there a problem with my configuration file format? The parameters have been checked to be consistent, but the effect after startup is different.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 21 days if no further activity occurs. Thank you for your contributions.