[[ heartbeat v2 + crm ]]
环境 node1 192.168.1.35 node2 192.168.1.36 fip 192.168.1.81 daemon httpd ha web service ip httpd node1&2 # vim ha.cf crm on # cd # rpm -ivh heartbeat-gui-2.1.4-12.el6.x86_64.rpm # service heartbeat start node1&2 # crm_mon 显示当前crm集群状态 # ss -tnlp mgmtd :5560 # rpm -ql heartbeat-gui /usr/bin/hb_gui note:hb_gui运行要以特定用户登陆才能做配置 # tail /etc/passwd hacluster:x:496:493:heartbeat # echo "queen" | passwd --stdin hacluster node1 # hb_gui -Linux HA Management Client -Connection(登陆) -Resources(定义资源) -native webip IPaadr 192.168.1.81 -native webserver httpd -group webservice (要使用组要先定义组,再定义资源) -Constraints(约束) -colocation webser_with_webip INFINITY false -orders webserver_after_webip INFINITY note:删除:先删约束,后删资源 [[高可用mariadb集群]] 环境(centos6) node1 192.168.1.35 node2 192.168.1.36 nfs 192.168.1.15 ha mysql service: ip:192.168.1.61 mysqld shared storage:nfs nfs # fdisk /dev/sda n p 3 +30G t 3 8e w # partx -a /dev/sda # pvcreat /dev/sda3 # vgcreat myvg /dev/sda3 # lvcreat -L 10G -n mydata myvg # mke2fs -t ext4 /dev/myvg/mydata 格式化 # mkdir /mydata # vim /etc/fstab /dev/myvg/mydata /mydate ext4 default 0 0 # mount -a # vim /etc/exports /mydata 192.168.1.0/24(rw,no_root_squash) # groupadd -r -g 306 mysql # useradd -r -g 306 -u 306 mysql # id mysql # mkdir /mydata/data # chown -R mysql.mysql /mydata/data # vim /etc/exports /mydata 192.168.1.0/24(rw,no_root_squash) # exportfs -arv 重新导出 node1&2 # cd # mkdir /mydata # mount -t nfs 192.168.1.15:/mydata /mydata # groupadd -r -g 306 mysql # useradd -r -g 306 -u 306 mysql # su - mysql cd /mydata/data pwd touch a.txt(检查权限是否有问题) ls rm a.txt exit # tar xf mariadb-5.5.40-linux-x86_64.tar.gz -C /usr/local # cd /usr/local # ls # ln -sv mariadb-5.5.40-linux-x86_64 mysql # cd mysql/ # chown -R root.mysql ./* # ./scripts/mysql_install_db --datadir=/mydata/data --user=mysql 初始化 # mkdir /etc/mysql # cp support-file/my-large.cnf /etc/mysql/my.cnf # vim /etc/mysql/my.cnf datadir = /mydata/data innodb_file_per_table = on skip_name_resolve = on 不解析主机名 # cp support-file/mysql.server /etc/rc.d/init.d/mysqld # chkconfig --add mysqld # service mysqld start # /usr/local/mysql/bin/mysql >CREATE DATABASE mydb; (nfs # ls /mydata/data mydb) >exit # service mysqld stop # chkconfig mysqld off (!!!) # cd # umount /mydata nfs # yum install mysql node1 # hb_gui -Connection -Resources -group mysqlservices myip IPaddr2 192.168.1.61 eth0 -mystore Filesystem 191.168.1.15:/mydata /mydata nfs -myserver mysqld node1 # ss -tnl :3306 # mount # ip addr show # /usr/local/mysql/bin/mysql > GRANT ALL ON *.* TO 'root'@'192.168.%.%' IDENTFIED BY 'queen'; > FLUSH PRIVILEGES > exit ( nfs # mysql -uroot -p -h192.168.1.21)
原创文章,作者:nene,如若转载,请注明出处:http://www.178linux.com/88208