Quota Installation
It is the installation and configuration of GlusterFS + heartbeat + SMB for Ubuntu debian
In all node :
sudo apt-get upgrade
sudo apt-get update
sudo apt-get install attr
sudo apt-get install glusterfs-server
gluster --version
sudo mkdir /gfs
sudo mkdir /gfs-vol
sudo chmod 777 /gfs-vol
sudo vi /etc/hosts
10.1.1.1 n1
10.1.1.2 n2
## Go to node1 :
## probe any peer (storage brick peer) in gluster :
sudo gluster peer probe n1
sudo gluster peer probe n2
## check it
sudo gluster peer status
## Create "Replicated Volume"
sudo gluster volume create gfs-vol replica 2 transport tcp n1:/gfs n2:/gfs force
## check it
sudo gluster vol start gfs-vol
sudo gluster vol status
sudo gluster vol info
## try mount once to test in Node1
mount -t glusterfs localhost:gfs-vol /gfs-vol
umount /gfs-vol
-------------------------------------------------------------------
In all node :
## Make Samba file sharing in Each node :
sudo apt-get install samba
sudo adduser gfs --shell /bin/false
sudo smbpasswd -a gfs
vi /etc/samba/smb.conf
[gfs-vol]
path = /gfs-vol
writable = yes
#public = yes
#guest ok = yes
#guest only = yes
-------------------------------------------------------------------
## Make the config of Heartbeat in each node for VIP , auto-mount glusterfs volume and SMB access :
In all node :
sudo apt-get install heartbeat
# In node1 (servername : n1)
sudo vi /etc/ha.d/ha.cf
debugfile /var/log/ha-debug
logfile /var/log/ha-log
logfacility local0
bcast ens32
ucast ens32 10.1.1.2
keepalive 2
auto_failback on
node n1
node n2
# In node2 (servername : n2)
sudo vi /etc/ha.d/ha.cf
debugfile /var/log/ha-debug
logfile /var/log/ha-log
logfacility local0
bcast ens32
ucast ens32 10.1.1.1
keepalive 2
auto_failback on
node n1
node n2
In all node :
# create the HA resource config
sudo vi /etc/ha.d/haresources
n1 IPaddr::10.1.1.3/24/ens32 Filesystem::localhost:gfs-vol::/gfs-vol::glusterfs smbd
# create the HA secret auth key
sudo vi /etc/ha.d/authkeys
auth 3
3 md5 password
chmod 600 /etc/ha.d/authkeys
## Start all node HA service , and Node1 shoule be primary node to launch VIP, Mount GlusterFS, SMB
sudo /etc/init.d/heartbeat start
## Check in node1 for HA resource , if all ok , it is success!!!
less /var/log/ha-log
ifconfig
df -h |grep gfs-vol
## In all node , disable autostart of SMB , let heartbeat handle it
sudo systemctl disable smbd
sudo systemctl disable iptables
sudo systemctl enable heartbeat
sudo systemctl enable glusterfs-server
-------------------------------------------------------------------
## In Client, Use WindowPC , create "mount.bat" to smb Mount GlusterFS cluster's VIP
net use V: \\10.1.1.3\gfs-vol /user:gfs smbpassword
## After copy new file create in client PC's V share drive, check for clusters replication :
In 2 node :
ls -lah /gfs
## Try power off Node1, to check the failover processing.
# In node 1
sudo poweroff
# In node 2
less /var/log/ha-log
ifconfig
df -h |grep gfs-vol
## After failover success , try copy file again in WindowPC , and check again in node2
## Anything is going OK , then , poweron node1 ,
## check again the auto-rollback processing in log and test copy file again.
Server is hosted by Alanstudio
Linux Operating System
Recommend screen resolution 1024 x 768 / IE / FireFox
Alan Studio © 2007 by Alan Cheung Hin Lun. All rights reserved.
|