root@files1.domain.com:~# gluster peer probe files2.domain.com Probe successful
root@files1.domain.com:~# gluster peer status Number of Peers: 1 Hostname: files2.domain.com Uuid: c8f2fg43-ch7e-47f3-9ec5-b4b66f81101d State: Peer in Cluster (Connected)
root@files1.domain.com:~# gluster volume create volume_data replica 2 transport tcp files1.domain.com:/data files2.domain.com:/data Creation of volume volume_data has been successful. Please start the volume to access data.
root@files1.domain.com:~# gluster volume start volume_data Starting volume volume_data has been unsuccessful
/etc/init.d/glusterfs-server restart
root@files1.domain.com:~# gluster volume info Volume Name: volume_data Type: Replicate Status: Started Number of Bricks: 2 Transport-type: tcp Bricks: Brick1: files1.domain.com:/data Brick2: files2.domain.com:/data
root@files1.domain.com:~# gluster volume set volume_data auth.allow 10.*
Volume Name: volume_data Type: Replicate Status: Started Number of Bricks: 2 Transport-type: tcp Bricks: Brick1: files1.domain.com:/data Brick2: files2.domain.com:/data Options Reconfigured: auth.allow: 10.*
root@client.domain.com:~# mkdir /data root@client.domain.com:~# mount -t glusterfs files1.domain.com:/volume_data /data
root@client.domain.com:~# df -h Filesystem Size Used Avail Use% Mounted on /dev/sda1 7.9G 6.6G 987M 88% / none 3.4G 112K 3.4G 1% /dev none 3.6G 0 3.6G 0% /dev/shm none 3.6G 64K 3.6G 1% /var/run none 3.6G 0 3.6G 0% /var/lock none 3.6G 0 3.6G 0% /lib/init/rw /dev/sdb 414G 6.1G 387G 2% /mnt tmpfs 10M 8.0K 10M 1% /tmp/tmpfs files1.domain.com:/ volume_data 200G 109G 92G 55% /data
files1.domain.com:/volume_data /data glusterfs defaults,_netdev 0 0
root@client.domain.com:~# umount /data root@client.domain.com:~# mount -a
root@client.domain.com:~# df -h Filesystem Size Used Avail Use% Mounted on /dev/sda1 7.9G 6.6G 987M 88% / none 3.4G 112K 3.4G 1% /dev none 3.6G 0 3.6G 0% /dev/shm none 3.6G 64K 3.6G 1% /var/run none 3.6G 0 3.6G 0% /var/lock none 3.6G 0 3.6G 0% /lib/init/rw /dev/sdb 414G 6.1G 387G 2% /mnt tmpfs 10M 8.0K 10M 1% /tmp/tmpfs files1.domain.com:/ volume_data 200G 109G 92G 55% /data
/etc/fstab: files1.domain.com:/volume_data /data glusterfs defaults,_netdev 0 0
Source: https://habr.com/ru/post/157029/
All Articles