当前位置:网站首页>Heartbeat uses NFS to make MySQL highly available based on CRM
Heartbeat uses NFS to make MySQL highly available based on CRM
2022-06-30 20:13:00 【Brother Xing plays with the clouds】
The experimental environment here is the same as that in the previous section http://www.linuxidc.com/Linux/2014-03/98673.htm First stop the node resource , Then delete
NFS Shared storage node configuration : # mkdir /mydata # vim /etc/exports /mydata 192.168.100.0/24(no_root_squash,rw) # service nfs restart # groupadd -g 3306 MySQL # useradd -g 3306 -u 3306 -s /sbin/nologin -M mysql # chown -R /mydata notes : Here you must nfs Shared resources are set to no_root_squash, otherwise mysql Service failed to start
Node Node configuration : ad locum node1 And node2 The configuration of is exactly the same
# groupadd -g 3306 mysql # useradd -g 3306 -u 3306 -s /sbin/nologin -M mysql # mkdir /mydata # tar xvf mysql-5.5.22-linux2.6-i686.tar.gz -C /usr/local/ # cd /usr/local/ # ln -s mysql-5.5.22-linux2.6-i686/ mysql # cd mysql # chown -R root:mysql . # mount -t nfs 192.168.100.9:/mydata /mydata # cd /usr/local/mysql/ # scripts/mysql_install_db --user=mysql --datadir=/mydata/data # ln -s /usr/local/mysql/bin/* /usr/bin/ # cp support-files/my-large.cnf /etc/my.cnf # vim /etc/my.cnf datadir = /mydata/data innodb_file_per_table = 1 # cp support-files/mysql.server /etc/init.d/mysqld # chkconfig --add mysqld # chkconfig mysqld off # service mysqld start # scp /ect/my.cnf node2:/etc # scp /etc/init.d/mysqld node2:/etc/init.d # service mysqld start # mysql
test mysql Whether it is in normal use mysql> create database mydb; mysql> grant all privileges on *.* to [email protected]'%' identified by 'asdasd'; mysql> flush privileges; # service mysqld stop # service heartbeat start # ssh node2 'service heartbeat start' # hb_gui Be careful 1. To use the above command, you must DC Connect and configure , Otherwise, it will fail to start , Check which node is DC, We can use the command crm_mon 2. After the test is completed, the... Of each node must be mysql Set to power on / off , And uninstall nfs Shared memory Add groups and resources , Use the steps in the previous section :
thus , We can get it from any one mysql The client logs in to us mysql High availability colony 了
Test in nfs The server Log on mysql colony , See if it's all right : [[email protected] ~]# mysql -uroot -h 192.168.100.10 -p mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mydb | | mysql | | performance_schema | | test | +--------------------+ 5 rows in set (0.01 sec)
mysql> use mydb; Database changed mysql> create table test1 ( -> id int not null auto_increment primary key, -> name varchar(20) not null -> ); Query OK, 0 rows affected (0.11 sec)
边栏推荐
- Why must a digital transformation strategy include continuous testing?
- 项目经理是领导吗?可以批评指责成员吗?
- 分析超700万个研发需求发现,这八大编程语言才是行业最需要的
- QT QStringList用法
- CV+Deep Learning——网络架构Pytorch复现系列——basenets(BackBones)(一)
- Tensorflow2.4 implementation of repvgg
- 一文读懂目标检测:R-CNN、Fast R-CNN、Faster R-CNN、YOLO、SSD「建议收藏」
- 数据智能——DTCC2022!中国数据库技术大会即将开幕
- 将秒数转换为**小时**分钟
- Detailed explanation of specific methods and steps for TCP communication between s7-1500 PLCs (picture and text)
猜你喜欢
随机推荐
4.3-inch touch screen 12 channel control port programmable network central control supports mutual backup of 5 central control hosts
Detailed steps for Django to upload excel tables and write data to the database
Unity 如何拖拉多个组件中的一个
originpro 2021 附安装教程
CADD课程学习(2)-- 靶点晶体结构信息
C language: hashtable
Filebeat自定义index和fields
Heartbeat 与DRBD 配置过程
Qt:qaxobject operation Excel
VB的基本语法
漏洞扫描工具大全,妈妈再也不用担心我挖不到漏洞了
To eliminate bugs, developers must know several bug exploration and testing artifacts.
pytorch实现FLOPs和Params的计算
杰理之关于长按开机检测抬起问题【篇】
Torchdrug -- drug attribute prediction
最新海康摄像机、NVR、流媒体服务器、回放取流RTSP地址规则说明[通俗易懂]
数据智能——DTCC2022!中国数据库技术大会即将开幕
Tensorflow2.4 implementation of repvgg
yolo 目标检测
Warmup预热学习率「建议收藏」