Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

etcd cluster id mistmatch #11642

Closed
peachestao opened this issue Feb 20, 2020 · 2 comments
Closed

etcd cluster id mistmatch #11642

peachestao opened this issue Feb 20, 2020 · 2 comments
Labels

Comments

@peachestao
Copy link

peachestao commented Feb 20, 2020

I am building an etcd cluster of three nodes. If the three nodes are on the same machine(use different port), it is normal. If the three nodes are on different machines(the three machines can access each other), an error is reported: 'cluster ID mismatch',The detailed log is as follows:

Feb 20 20:33:13 VM-0-15-ubuntu etcd[26272]: request cluster ID mismatch (got 3652f05a66289861 want f633942361b97b7f)
Feb 20 20:33:13 VM-0-15-ubuntu etcd[26272]: request cluster ID mismatch (got 3652f05a66289861 want f633942361b97b7f)
Feb 20 20:33:13 VM-0-15-ubuntu etcd[26272]: request sent was ignored (cluster ID mismatch: peer[7a710abd2cc3d001]=3652f05a66289861, local=f633942361b97b7f)
Feb 20 20:33:13 VM-0-15-ubuntu etcd[26272]: request sent was ignored (cluster ID mismatch: peer[7a710abd2cc3d001]=3652f05a66289861, local=f633942361b97b7f)
Feb 20 20:33:13 VM-0-15-ubuntu etcd[26272]: request cluster ID mismatch (got 3652f05a66289861 want f633942361b97b7f)
Feb 20 20:33:13 VM-0-15-ubuntu etcd[26272]: request cluster ID mismatch (got 3652f05a66289861 want f633942361b97b7f)
Feb 20 20:33:13 VM-0-15-ubuntu etcd[26272]: request sent was ignored (cluster ID mismatch: peer[7a710abd2cc3d001]=3652f05a66289861, local=f633942361b97b7f)
Feb 20 20:33:13 VM-0-15-ubuntu etcd[26272]: request sent was ignored (cluster ID mismatch: peer[7a710abd2cc3d001]=3652f05a66289861, local=f633942361b97b7f)
Feb 20 20:33:13 VM-0-15-ubuntu etcd[26272]: request cluster ID mismatch (got 3652f05a66289861 want f633942361b97b7f)
Feb 20 20:33:13 VM-0-15-ubuntu etcd[26272]: request cluster ID mismatch (got 3652f05a66289861 want f633942361b97b7f)

node1:

/etc/systemd/system/etcd.service, The other two are the same

Description=Etcd Server

After=network.target

After=network-online.target

Wants=network-online.target

[Service]

Type=notify

WorkingDirectory=/var/lib/etcd/

EnvironmentFile=-/etc/etcd/etcd.conf

User=root

# set GOMAXPROCS to number of processors

ExecStart=/usr/bin/etcd  \
    --name=${ETCD_NAME} \
    --data-dir=${ETCD_DATA_DIR} \
    --listen-client-urls=${ETCD_LISTEN_CLIENT_URLS} \
    --listen-peer-urls=${ETCD_LISTEN_PEER_URLS} \
    --advertise-client-urls=${ETCD_ADVERTISE_CLIENT_URLS} \
    --initial-cluster-token=${ETCD_INITIAL_CLUSTER_TOKEN} \
    --initial-advertise-peer-urls=${ETCD_INITIAL_ADVERTISE_PEER_URLS} \
    --initial-cluster-state=${ETCD_INITIAL_CLUSTER_STATE} \
    --initial-cluster=${ETCD_INITIAL_CLUSTER}

Restart=on-failure
LimitNOFILE=65536

[Install]
WantedBy=multi-user.target

/etc/etcd/etcd.conf

ETCD_NAME="etcd-1"
ETCD_DATA_DIR="/var/lib/etcd/data"
ETCD_LISTEN_CLIENT_URLS="http://ip1:2379,http://localhost:2379"
ETCD_LISTEN_PEER_URLS="http://ip1:2380"
ETCD_INITIAL_ADVERTISE_PEER_URLS="http://ip1:2380"
ETCD_ADVERTISE_CLIENT_URLS="http://ip1:2379,http://localhost:2379"
ETCD_INITIAL_CLUSTER="etcd-1=http://ip1:2380,etcd-2=http://ip2:2380,etcd-3=http://ip3:2380"
ETCD_INITIAL_CLUSTER_TOKEN="etcd-cluster-token"
ETCD_INITIAL_CLUSTER_STATE="new"

node2:

/etc/etcd/etcd.conf

ETCD_NAME="etcd-2"
ETCD_DATA_DIR="/var/lib/etcd/data"
ETCD_LISTEN_CLIENT_URLS="http://ip2:2379,http://localhost:2379"
ETCD_LISTEN_PEER_URLS="http://ip2:2380"
ETCD_INITIAL_ADVERTISE_PEER_URLS="http://ip2:2380"
ETCD_ADVERTISE_CLIENT_URLS="http://ip2:2379,http://localhost:2379"
ETCD_INITIAL_CLUSTER="etcd-1=http://ip1:2380,etcd-2=http://ip2:2380,etcd-3=http://ip3:2380"
ETCD_INITIAL_CLUSTER_TOKEN="etcd-cluster-token"
ETCD_INITIAL_CLUSTER_STATE="new"

node3:

/etc/etcd/etcd.conf

ETCD_NAME="etcd-3"
ETCD_DATA_DIR="/var/lib/etcd/data"
ETCD_LISTEN_CLIENT_URLS="http://ip3:2379,http://localhost:2379"
ETCD_LISTEN_PEER_URLS="http://ip3:2380"
ETCD_INITIAL_ADVERTISE_PEER_URLS="http://ip3:2380"
ETCD_ADVERTISE_CLIENT_URLS="http://ip3:2379,http://localhost:2379"
ETCD_INITIAL_CLUSTER="etcd-1=http://ip1:2380,etcd-2=http://ip2:2380,etcd-3=http://ip3:2380"
ETCD_INITIAL_CLUSTER_TOKEN="etcd-cluster-token"
ETCD_INITIAL_CLUSTER_STATE="new"

start command:

systemctl daemon-reload
systemctl enable etcd
systemctl start etcd

I tried to delete the data-dir and rebuild it ,then restart the etcd service, but it still didn't work

Please help me, what's wrong with me

etcd version is 3.3.18

system is ubuntu 16.04

@stale
Copy link

stale bot commented May 20, 2020

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.

@stale stale bot added the stale label May 20, 2020
@stale stale bot closed this as completed Jun 10, 2020
@ahrtr
Copy link
Member

ahrtr commented Mar 11, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants