stepping-stone / node-integration

The FOSS-Cloud's node configuration scripts
Other
0 stars 0 forks source link

Secondary storage does not create gluster volume #1

Open patklaey opened 11 years ago

patklaey commented 11 years ago

The fc-node-configuration script fails on the secondary storage node. The gluster volume cannot be created. Error from gluster: volume create: virtualization: failed: /var/data/gluster-volume-01 or a prefix of it is already part of a volume

gluster-node-02 ~ # fc-node-configuration --node-type secondary-storage-node +--------------------------------------------------------------------------------------------------------+ | Second Storage-Node Installation | +--------------------------------------------------------------------------------------------------------+ Do you really want to proceed with configuration of the secondary-storage-node? yes or no (default: no): yes

+--------------------------------------------------------------------------------------------------------+ | Retrieving local network configuration ... | +--------------------------------------------------------------------------------------------------------+ Local network configuration retrieval ok!

+--------------------------------------------------------------------------------------------------------+ | Retrieving remote network configuration ... | +--------------------------------------------------------------------------------------------------------+ Please enter the following information for the primary Storage-Node with the OpenSSH daemon listening on the VLAN with the name 'admin' and with the VLAN ID '110':

IP address (default: 10.1.110.11): Username (default: root): Password for root:

Remote network configuration retrieval ok!

+--------------------------------------------------------------------------------------------------------+ | Configuring GlusterFS on the secondary Storage-Node ... | +--------------------------------------------------------------------------------------------------------+ Remote Data IP (used for the primary glusterd daemon): 10.1.120.11 Local Data IP (used for the secondary glusterd daemon): 10.1.120.12

Starting the daemon glusterd ... The daemon glusterd is already running, restarting... Use of uninitialized value in string eq at /usr/sbin/fc-node-configuration line 1738, line 4.

Restarting the daemon glusterd ...

Stopping the daemon glusterd ... Executing: /etc/init.d/glusterd stop...

Starting the daemon glusterd ... Executing: /etc/init.d/glusterd start...

Adding the daemon glusterd to the runlevel default ... The daemon glusterd is already in the runlevel default, doing nothing.

Working on the initial peer and volume configuration ...

Adding the remote storage-node with the IP address 10.1.120.11 to the trusted storage pool ... Executing: gluster peer probe 10.1.120.11 ... Added the gluster peer with the IP address 10.1.120.11 successfully!

Verifying the peer status ... Number of Peers: 1

Hostname: 10.1.120.11 Uuid: f1d534ac-98b3-4e3a-a234-a2c2d9aa64a2 State: Peer in Cluster (Connected)

Creating the distributed replicated volume ... Executing: gluster volume create virtualization replica 2 transport tcp 10.1.120.12:/var/data/gluster-volume-01 10.1.120.11:/var/data/gluster-volume-01 ... volume create: virtualization: failed: /var/data/gluster-volume-01 or a prefix of it is already part of a volume { "Return String" : "The script ended in an undefined state.", "Return Code" : 1 } gluster-node-02 ~ # df -ha Filesystem Size Used Avail Use% Mounted on rootfs 4.0G 982M 3.1G 25% / proc 0 0 0 - /proc udev 10M 4.0K 10M 1% /dev devpts 0 0 0 - /dev/pts sysfs 0 0 0 - /sys /dev/sda3 4.0G 982M 3.1G 25% / tmpfs 3.9G 312K 3.9G 1% /run shm 3.9G 0 3.9G 0% /dev/shm securityfs 0 0 0 - /sys/kernel/security debugfs 0 0 0 - /sys/kernel/debug cgroup_root 10M 0 10M 0% /sys/fs/cgroup openrc 0 0 0 - /sys/fs/cgroup/openrc cpuset 0 0 0 - /sys/fs/cgroup/cpuset cpu 0 0 0 - /sys/fs/cgroup/cpu cpuacct 0 0 0 - /sys/fs/cgroup/cpuacct memory 0 0 0 - /sys/fs/cgroup/memory devices 0 0 0 - /sys/fs/cgroup/devices freezer 0 0 0 - /sys/fs/cgroup/freezer blkio 0 0 0 - /sys/fs/cgroup/blkio perf_event 0 0 0 - /sys/fs/cgroup/perf_event bfqio 0 0 0 - /sys/fs/cgroup/bfqio /dev/mapper/local0-var 3.0G 88M 3.0G 3% /var /dev/mapper/local0-tmp 1014M 33M 982M 4% /tmp /dev/mapper/local0-home 496M 26M 471M 6% /home /dev/mapper/local0-portage 1014M 33M 982M 4% /usr/portage /dev/mapper/local0-gluster--volume--01 1.9T 33M 1.9T 1% /var/data/gluster-volume-01 gluster-node-02 ~ # gluster volume info No volumes present gluster-node-02 ~ #

dev-zero commented 11 years ago

This may be a left-over from the first run where it failed because it didn't see the other peer:

gluster-node-02 ~ # getfattr -m- -d /var/data/gluster-volume-01/
getfattr: Removing leading '/' from absolute path names
# file: var/data/gluster-volume-01/
trusted.glusterfs.volume-id=0sutbhuC3xQfioA4P/qAHT1Q==

running the following commands (according to http://comments.gmane.org/gmane.comp.file-systems.gluster.user/9096) helped to get past the first error:

setfattr -x trusted.glusterfs.volume-id /var/data/gluster-volume-01/
setfattr -x trusted.gfid /var/data/gluster-volume-01/

After that I got the following when re-running the fc-node-configuration:

[...]
Verifying the peer status ...
Number of Peers: 1
Hostname: 10.1.120.11
Uuid: f1d534ac-98b3-4e3a-a234-a2c2d9aa64a2
State: Peer in Cluster (Connected)
Creating the distributed replicated volume ...
Executing: gluster volume create virtualization replica 2 transport tcp 10.1.120.12:/var/data/gluster-volume-01 10.1.120.11:/var/data/gluster-volume-01 ...
volume create: virtualization: failed
{
   "Return String" : "The script ended in an undefined state.",
   "Return Code" : 1
}

Adding a sleep(3); before gluster peer status helped, altough this is not really a solution. As it seems at the moment does gluster peer status report back too early.

dev-zero commented 11 years ago

Btw, there seems to be a bug in the script:

Use of uninitialized value in string eq at /usr/sbin/fc-node-configuration line 1738, line 4.
dev-zero commented 11 years ago

checking the return value of gluster peer status is most probably not enough since that command returns the status successfully. We have to check the status itself by parsing the output.