The Ops Community ⚙️

Joseph D. Marhee
Joseph D. Marhee

Posted on

Fixing GlusterFS not in 'Peer in Cluster' State Error

When creating a Glusterfs deployment, after peering your other nodes:

gluster peer probe node1
Enter fullscreen mode Exit fullscreen mode

you can see the status of the cluster using gluster peer status, where you might see something like this:

Hostname: 192.168.0.122
Uuid: 35c563b6-b54a-4fb6-98a9-243d34e0a82e
State: Accepted peer request (Connected)
Enter fullscreen mode Exit fullscreen mode

but in this State, you cannot create a volume yet, and you might get an error like:

ubuntu@61d8372c31e8:~$ sudo gluster volume create replicated-data replica 3 192.168.0.121:/gluster/02 192.168.0.122:/gluster/02 192.168.0.123:/gluster/02
volume create: replicated-data: failed: Host 192.168.0.122 is not in 'Peer in Cluster' state
Enter fullscreen mode Exit fullscreen mode

If it is stuck in this state, using the UUID from the peer status above, you can modify the /var/lib/glusterd/peers/{UUID} file, where you'll see a state=4 line.

Update this line to read state=3 on, both, this node, and the UUID for the first node as well on the peer node if needed, then restart glusterd:

systemctl restart glusterd
Enter fullscreen mode Exit fullscreen mode

and recheck the peer status:

Hostname: 192.168.0.122
Uuid: 35c563b6-b54a-4fb6-98a9-243d34e0a82e
State: Peer in Cluster (Connected)
Enter fullscreen mode Exit fullscreen mode

at which point you can proceed to create a volume.

Top comments (0)