mysql 数据库集群搭建:(四)pacemaker管理三台maxscale集群,搭建mariadb读写分离中间层集群...

《mysql 数据库集群搭建:(一)VirtualBox中多台CentOS虚拟机间和windows主机间互通以及访问互联网设置》
《mysql 数据库集群搭建:(二)3台CentOS-7安装Percona-XtraDB-Cluster-57集群》
《mysql 数据库集群搭建:(三)CentOS 7.2 MariaDB 10.2 galera 集群安装》
《mysql 数据库集群搭建:(四)pacemaker管理三台maxscale集群,搭建mariadb读写分离中间层集群》

一.前置条件配置
1.虚拟机两个网卡,最好第一个网卡是host-only 第二个是nat,两个网卡在开始时就启动,多台虚拟机的互通和互联网访问可参考另一篇文章《VirtualBox中多台CentOS虚拟机间和windows主机间互通以及访问互联网设置》
2.三台配置为CentOS 72、MariaDB 10.2、Galera Cluster的数据库集群均已安装并且配置完成,可参考我的另一篇博文《CentOS 7.2 MariaDB 10.2 galera 集群安装》
3.三台数据库服务器的ip地址为 
    192.168.56.21   mariadb-1
    192.168.56.22   mariadb-2
    192.168.56.23   mariadb-3
4.三台maxscale的集群服务器ip地址为
    192.168.56.31   maxscale-1
    192.168.56.32   maxscale-2
    192.168.56.33   maxscale-3
5.pacemaker为maxscale集群建立的虚拟ip资源为 192.168.56.30
6.每个节点的机器名进行修改

hostnamectl set-hostname maxscale-1

验证是否修改成功

uname -n

7.修改hosts文件,让pacemaker可以通过机器名访问

vi /etc/hosts

127.0.0.1   localhost
::1         localhost
192.168.56.31 maxscale-1
192.168.56.32 maxscale-2
192.168.56.33 maxscale-3

8.设置防火墙,放开pacemaker需要的端口(TCP端口包括:2224、3121、21064, UDP端口包括:5405)和maxscale需要的端口(在本例中设置的监听端口在[Splitter Listener]节点,端口设置成了4006(maxscale默认的就是4006),使用tcp协议)

firewall-cmd --permanent --add-service=high-availability (pacemaker的端口)
firewall-cmd --permanent --zone=public --add-port=4006/tcp (maxscale端口)
firewall-cmd --reload (重启防火墙生效)

9.降低SELinux安全级别

vi /etc/selinux/config

    改写SELINUX=permissive后保存退出

reboot (重启节点生效)

    也可以在测试环境使用以下办法完全关闭防火墙和安全策略

setenforce 0
sed -i.bak "s/SELINUX=enforcing/SELINUX=permissive/g" /etc/selinux/config
systemctl mask firewalld.service
systemctl stop firewalld.service
iptables --flush

10.在三台数据库集群某一台中创建maxscale访问的用户和密码
    因为MaxScale是通过数据库标准的用户认证和后端数据库连接的,以下例子中假设maxscale服务器和数据库服务器都在192.168.56.*网段中(在选用的初始化节点上创建该用户即可,其它节点加入集群后会自动同步)
10.1 创建MaxScale可访问后端数据库的用户,MaxScale服务Server和监控服务Moniter都会用到授权用户进行数据库连接,可以为Server和Monitor分别创建两个用户授予不同权限或者创建一个用户授予所有权限,本例中使用一个用户授予所有权限。

MariaDB [(none)]> create user 'maxscale_user'@'192.168.56.%' IDENTIFIED BY 'maxscale_user';

10.2 对用户授予Server服务需要的访问数据库核心表的权限

MariaDB [(none)]> grant SELECT on mysql.user to 'maxscale_user'@'192.168.56.%';
MariaDB [(none)]> grant SELECT ON mysql.db TO 'maxscale_user'@'192.168.56.%';
MariaDB [(none)]> grant SELECT ON mysql.tables_priv TO 'maxscale_user'@'192.168.56.%';
MariaDB [(none)]> grant SHOW DATABASES ON *.* TO 'maxscale_user'@'192.168.56.%';

10.3 对用户授予Moniter服务需要的监控集群状况的权限

MariaDB [(none)]> grant REPLICATION CLIENT on *.* to 'maxscale_user'@'192.168.56.%';
MariaDB [(none)]> FLUSH PRIVILEGES;

10.4 特别注意,如果之前客户端直接连接MariaDB数据库使用了确定IP地址的某个用户、密码,那么该客户端一旦改为通过MaxScale连接数据库,那么原有用户的ip地址将变为MaxScale的ip地址,因此需要在数据库中重新以新的ip地址授予该用户应有的权限。
    例如原有客户端直连用户jdoe的创建和授予权限为

MariaDB [(none)]> CREATE USER 'jdoe'@'192.168.0.200' IDENTIFIED BY 'secret_password';
MariaDB [(none)]> GRANT SELECT, INSERT, UPDATE, DELETE ON *.* TO 'jdoe'@'192.168.0.200';

    那么客户端改变连接MaxScale后必须创建同名用户并授予相同权限,这里假设MaxScale的ip地址变为192.168.0.112,则需执行以下语句那么在数据库中必须重新授权GRANT

MariaDB [(none)]> CREATE USER 'jdoe'@'192.168.0.112' IDENTIFIED BY 'secret_password';
MariaDB [(none)]> GRANT SELECT, INSERT, UPDATE, DELETE ON *.* TO 'jdoe'@'192.168.0.112';

二. 安装maxscale
1. 通过yum为两台maxscale服务器安装maxscale
1.1 先从官网下载 maxscale yum源安装rpm安装脚本(官网下载慢,不过还没有找到其他镜像地址,所以只能忍,不过因为不大,所以时间不会太长)
    yum方式安装说明官方网页 https://mariadb.com/kb/en/mariadb/mariadb-package-repository-setup-and-usage/
    下载安装命令 curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash
    如果采用默认安装,会安装MariaDB Server/Cluster 、 MariaDB MaxScale 、 Percona XtraBackup 三个yum源,如果我们除MaxScale外不想让安装其它内容,可以使用排除参数防止安装(--skip-maxscale是排除maxscale的)

curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash -s -- --skip-server --skip-tools

1.2 yum安装 MaxScale

yum install -y maxscale

2.调整每台maxscale的配置文件
    MaxScale的默认配置文件在/etc/maxscale.cnf,可参考的模板文件在/usr/share/maxscale/maxscale.cnf.template,具体配置如下:

[maxscale] #全局设置
threads=1 #接收客户端连接的处理线程数,根据cpu个数确定,没把握可以设置为auto
[Splitter Service] #定义提供读写分离需要启动的服务配置
type=service
router=readwritesplit
servers=mariadb-1, mariadb-2, mariadb-3 #这里需要写在配置文件中定义的几台服务器的节点名称,可以参考之后的配置项
user=maxscale_user #可以访问具体数据库的用户名,在步骤2中创建的
passwd=maxscale_user #可以访问具体数据库的用户密码
enable_root_user=1 #允许客户端使用操作系统的root用户通过maxscale访问数据库服务器
[Splitter Listener] #配置对读写分离服务的状态监听
type=listener
service=Splitter Service
protocol=MySQLClient #使用标准的MySQLClient协议访问,也可以配置其它的,具体参考官方文档
port=4006
socket=/tmp/ClusterMaster
[mariadb-1] #定具体的数据库服务器集群中单台节点的信息,也就是在 [Splitter Service] 中 servers 节点配置的内容
type=server
address=192.168.56.21
port=3306
protocol=MySQLBackend #目前协议只有这一种类型
[mariadb-2] #定具体的数据库服务器集群中单台节点的信息,也就是在 [Splitter Service] 中 servers 节点配置的内容
type=server
address=192.168.56.22
port=3306
protocol=MySQLBackend
[mariadb-3] #定具体的数据库服务器集群中单台节点的信息,也就是在 [Splitter Service] 中 servers 节点配置的内容
type=server
address=192.168.56.23
port=3306
protocol=MySQLBackend
[Galera Monitor] #定义galera集群的监控服务
type=monitor
module=galeramon #galera特有的处理模块,应该是在2.1版本中新增的处理模块
servers=mariadb-1, mariadb-2, mariadb-3 #galera需要处理的服务器具体信息,和[Splitter Service]中的配置功能相同
user=maxscale_user
passwd=maxscale_user #可以访问具体数据库的用户密码
monitor_interval=10000 #监控的数据采集间隔时长
root_node_as_master=true
[CLI] #定义通过命令行maxadmin查看maxscale状态的服务
type=service
router=cli
[CLI Listener] #配置对maxadmin服务器的信息监听
type=listener
service=CLI
protocol=maxscaled
socket=default
#port=6603 #默认的管理监听端口

3.在每个节点上启动MaxScale

systemctl start maxscale

    如果有错误将会在 /var/log/maxscale/maxscale.log 中写入,可以打开查看
4.在每个节点上验证一切是否正常

maxadmin list services
maxadmin list servers
maxadmin list listeners

5.停用服务并不让服务自启动

systemctl stop maxscale
systemctl disable maxscale

三.搭建pacemaker集群(以单台服务器192.168.56.31为例)
1.设置节点时间同步,各节点之间的时间差要控制在1s内
1.1 安装 ntp 设置服务器时间同步

yum install -y ntp 

1.2 启用同步配置

timedatectl set-ntp yes

1.3 设置同步服务自启动并启动服务

systemctl enable ntpd
systemctl start ntpd

1.4 验证

ntpq -c peers

2.安装pacemaker必要的软件

yum install -y pacemaker pcs psmisc policycoreutils-python

3.启动pcs管理服务,因为pacemaker和corosync基本上都是通过pcs或者crmsh配置的,本例使用pcs配置

systemctl start pcsd
systemctl enable pcsd

4.修改通过yum方式安装的pacemaker自动生成的hacluster用户的密码,后边的集群配置需要使用(每个节点都需要单独执行)

passwd hacluster

Changing password for user hacluster.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.

5.为几个节点进行授权认证,用户是自动生成的hacluster,maxscale-1 maxscale-2 maxscale-3是几个节点的名称 (本步骤在一个节点执行就会同步到所有节点中)

pcs cluster auth -u hacluster -p hacluster maxscale-1 maxscale-2 maxscale-3

Username: hacluster
Password:
maxscale-1: Authorized
maxscale-2: Authorized
maxscale-3: Authorized

6.开始创建集群,命令中maxscale-cluster是集群的名称,maxscale-1 maxscale-2 maxscale-3是几个节点的名称(本步骤在一个节点执行就会同步到所有节点中)

pcs cluster setup --name maxscale-cluster maxscale-1 maxscale-2 maxscale-3

Shutting down pacemaker/corosync services...
Redirecting to /bin/systemctl stop pacemaker.service
Redirecting to /bin/systemctl stop corosync.service
Killing any remaining services...
Removing all cluster configuration files...
maxscale-1: Succeeded
maxscale-2: Succeeded
maxscale-3: Succeeded

7.启动集群中的所有节点(本步骤在一个节点执行就会同步到所有节点中)

pcs cluster start --all

maxscale-1: Starting Cluster...
maxscale-2: Starting Cluster...
maxscale-3: Starting Cluster...

8.设置所有节点的pacemaker集群为开机自动启动(本步骤在一个节点执行就会同步到所有节点中)

pcs cluster enable --all

9.因为本例中不需要使用STONITH管理存储,pcsd服务会默认开启,而且未设置会报错,因此这里关闭

pcs property set stonith-enabled=false

    如果没有设置,使用验证命令会报如下错误:

crm_verify -L -V  (验证集群是否出现错误信息,如果为空说明没错误)
error: unpack_resources:    Resource start-up disabled since no STONITH resources have been defined
error: unpack_resources:    Either configure some or disable STONITH with the stonith-enabled option
error: unpack_resources:    NOTE: Clusters with shared data need STONITH to ensure data integrity
Errors found during check: config not valid

10.验证以上的安装是否成功
10.1 验证corosync状态(需要在每台节点执行验证)

corosync-cfgtool -s (查看某台corosync的配置信息)

Printing ring status.
Local node ID 1
RING ID 0
id = 192.168.122.101
status = ring 0 active with no faults

    (如果不是以上的信息,那么可以通过检查网络配置、防火墙firewall和selinux安全策略检查问题)
10.2 验证corosync的成员信息

corosync-cmapctl | grep members (查看corosync的成员状态)

runtime.totem.pg.mrp.srp.members.1.config_version (u64) = 0
runtime.totem.pg.mrp.srp.members.1.ip (str) = r(0) ip(192.168.122.101)
runtime.totem.pg.mrp.srp.members.1.join_count (u32) = 1
runtime.totem.pg.mrp.srp.members.1.status (str) = joined
runtime.totem.pg.mrp.srp.members.2.config_version (u64) = 0
runtime.totem.pg.mrp.srp.members.2.ip (str) = r(0) ip(192.168.122.102)
runtime.totem.pg.mrp.srp.members.2.join_count (u32) = 2
runtime.totem.pg.mrp.srp.members.2.status (str) = joined
runtime.totem.pg.mrp.srp.members.3.config_version (u64) = 0
runtime.totem.pg.mrp.srp.members.3.ip (str) = r(0) ip(192.168.122.102)
runtime.totem.pg.mrp.srp.members.3.join_count (u32) = 2
runtime.totem.pg.mrp.srp.members.3.status (str) = joined

10.3 验证corosync的节点状态

pcs status corosync (查看corosync的状态)

Membership information
--------------------------
Nodeid Votes Name
1 1 maxscale-1 (local)
2 1 maxscale-2
3 1 maxscale-3

10.4 查看pacemaker的安装是否完整

ps axf (查看pacemaker所安装的文件目录状态)

PID TTY STAT TIME COMMAND
2 ? S 0:00 [kthreadd]
...lots of processes...
1362 ? Ssl 0:35 corosync
1379 ? Ss 0:00 /usr/sbin/pacemakerd -f
1380 ? Ss 0:00 \_ /usr/libexec/pacemaker/cib
1381 ? Ss 0:00 \_ /usr/libexec/pacemaker/stonithd
1382 ? Ss 0:00 \_ /usr/libexec/pacemaker/lrmd
1383 ? Ss 0:00 \_ /usr/libexec/pacemaker/attrd
1384 ? Ss 0:00 \_ /usr/libexec/pacemaker/pengine
1385 ? Ss 0:00 \_ /usr/libexec/pacemaker/crmd

pcs status (查看集群状态)

Cluster name: maxscale-cluster
WARNING: no stonith devices and stonith-enabled is not false
Last updated: Tue Dec 16 16:15:29 2014
Last change: Tue Dec 16 15:49:47 2014
Stack: corosync
Current DC: maxscale-3 (2) - partition with quorum
Version: 1.1.12-a14efad
... ...

11.创建虚拟ip资源,让客户端访问的时候通过虚拟ip访问,这样就能实现故障转移,命令中的maxscale-vip是虚拟ip的名称(本步骤在一个节点执行就会同步到所有节点中)

pcs resource create maxscale-vip ocf:heartbeat:IPaddr2 ip=192.168.56.30 cidr_netmask=24 op monitor interval=30s

11.1 验证集群状态,查看资源ip

pcs status

Cluster name: maxscale-cluster (集群名称)
Last updated: Tue Dec 16 17:44:40 2014 (最后更新时间)
Last change: Tue Dec 16 17:44:26 2014 (最后切换时间)
Perform a Failover
29
Stack: corosync
Current DC: maxscale-1 (1) - partition with quorum
Version: 1.1.12-a14efad
2 Nodes configured
1 Resources configured
Online: [ maxscale-1 maxscale-2 maxscale-3 ] (集群中的所有节点)
Full list of resources:
maxscale-vip (ocf::heartbeat:IPaddr2): Started maxscale-1 (虚拟ip以及目前映射在那个节点中)

11.2 使用命令验证关闭节点是否会转移

pcs cluster stop maxscale-1
pcs status (在节点2上验证)

Cluster name: maxscale-cluster (集群名称)
Last updated: Wed Dec 17 10:30:56 2014
Last change: Tue Dec 16 17:44:26 2014
Stack: corosync
Current DC: maxscale-2 (2) - partition with quorum
Version: 1.1.12-a14efad
2 Nodes configured
1 Resources configured
Online: [ maxscale-2 maxscale-3 ]
OFFLINE: [ maxscale-1 ]
Full list of resources:
maxscale-vip (ocf::heartbeat:IPaddr2): Started maxscale-2 (虚拟ip切换到了第二个节点上)
PCSD Status:
maxscale-1: Online
maxscale-2: Online
Daemon Status:
corosync: active/disabled
pacemaker: active/disabled
pcsd: active/enabled

12.将maxscale配置为pacemaker的资源 (本步骤在一个节点执行就会同步到所有节点中)

pcs resource create maxscale-server systemd:maxscale op monitor interval="10s" timeout="15s" op start interval="0" timeout="15s" op stop interval="0" timeout="30s"

15.将虚拟ip和maxscale两个资源设定为关联资源,一起切换、一起启动

pcs constraint colocation add maxscale-vip with maxscale-server INFINITY

16.设置资源启动顺序,先启动maxscale-server再启动maxscale-vip

pcs constraint order maxscale-vip then maxscale-server

17.防止故障恢复后资源迁移 

pcs resource defaults resource-stickiness=100

18. 每隔30s对失败资源进行restart配置某节点出现故障后资源切向另一台并固定在另一台上,不会因为故障节点启动后又切回来

pcs resource meta maxscale-vip migration-threshold=1 failure-timeout=60s resource-stickiness=100
pcs resource meta maxscale-server migration-threshold=1 failure-timeout=60s resource-stickiness=100 

19.在所有节点上设置pcsd、corosync、pacemaker自动启动

systemctl enable pcsd
systemctl enable corosync
systemctl enable pacemaker

20.重新启动集群

pcs cluster stop --all && pcs cluster start --all

21.停用单节点验证查看ip和maxscale服务的切换

pcs cluster stop maxscale-1
pcs resource

四.其它可参考及注意事项
1.如果想在只有1台节点活着的时候集群仍正常工作,例如虚拟IP正常提供,以资源形式存在的服务能正常启动,就需要关闭pacemaker默认的仲裁策略,否则在只有1台节点的时候集群的所有资源都会关闭。关闭仲裁策略的配置如下:

pcs property set no-quorum-policy=ignore

2.在安装CentOS时或安装后配置同步时间节点可参考如下
-----------------------------------------------------
在安装CentOS或者安装后可配置的国内外ntp节点如下:
ntp.sjtu.edu.cn 202.120.2.101 (上海交通大学网络中心NTP服务器地址)
s1a.time.edu.cn    北京邮电大学
s1b.time.edu.cn    清华大学
s1c.time.edu.cn    北京大学
s1d.time.edu.cn    东南大学
s1e.time.edu.cn    清华大学
s2a.time.edu.cn    清华大学
s2b.time.edu.cn    清华大学
s2c.time.edu.cn    北京邮电大学
s2d.time.edu.cn    西南地区网络中心
s2e.time.edu.cn    西北地区网络中心
s2f.time.edu.cn    东北地区网络中心
s2g.time.edu.cn    华东南地区网络中心
s2h.time.edu.cn    四川大学网络管理中心
s2j.time.edu.cn    大连理工大学网络中心
s2k.time.edu.cn CERNET桂林主节点
s2m.time.edu.cn 北京大学
1.cn.pool.ntp.org
2.cn.pool.ntp.org
3.cn.pool.ntp.org
0.cn.pool.ntp.org
cn.pool.ntp.org
tw.pool.ntp.org
0.tw.pool.ntp.org
1.tw.pool.ntp.org
2.tw.pool.ntp.org
3.tw.pool.ntp.org
cn.ntp.org.cn 中国ntp
edu.ntp.org.cn 中国教育网
us.ntp.org.cn 美国
sgp.ntp.org.cn 新加坡    
kr.ntp.org.cn 韩国    
de.ntp.org.cn 德国    
jp.ntp.org.cn 日本    
sim.ntp.org.cn Simcentric
-----------------------------------------------------
3.可以将maxscale访问数据库的密码进行加密,包装安全,但在集群中有问题,因为集群使用hacluster用户,该用户无法正确访问使用maxkeys生成的秘钥文件/var/lib/maxscale/.secrets文件,所以加密的maxscale无法在集群中正常启动,该问题个人还在研究中,希望有志之士能给出解决办法,不胜感激。

maxkeys  (使用maxkeys 产生后边的密码文件,命令会自动在/var/lib/maxscale/.secrets产生文件)
maxpasswd password (会产生类似 8BD27430A7FA7BBB684B24818333C769 的密码,该密码在后边maxscale的配置文件中需要)

    生成的密码使用在maxscale.cnf配置文件中访问mariadb数据库的用户的密码,maxscale如果没有使用maxkeys产生.secrets秘钥,就必须使用明文密码访问数据库否则无法访问
4.为三台maxscale节点配置相互之间通过ssh免密码的访问和执行命令的权限,三台都要执行以下命令(管理测试方便,该步骤也可以不执行),以方便文件复制或者单台上向三台发出执行命令
4.1 生成密钥

ssh-keygen
    Generating public/private rsa key pair.
    Enter file in which to save the key (/home/bel/.ssh/id_rsa):    (这里尽量使用默认地址/home/bel/.ssh/id_rsa,如果这里执行命令的是root用户或者使用sudo ssh-keygen命令形式,将会为root用户提供密钥,而且默认文件地址会生成在/root/.ssh/id_rsa,需要注意的是使用后边的ssh-copy-id命令向其它服务器复制公钥时要使用root用户,例如ssh-copy-id root@192.168.56.32,本例中使用的是bel登录执行命令和同步,所以私钥地址以及ssh-copy-id命令使用时的同步用户也是bel)
    Created directory '/home/bel/.ssh'.
    Enter passphrase (empty for no passphrase):  (本例中未进行设置,留空)
    Enter same passphrase again: (本例中未进行设置,留空)
    Your identification has been saved in /home/bel/.ssh/id_rsa.
    Your public key has been saved in /home/bel/.ssh/id_rsa.pub.
    The key fingerprint is:
    6d:87:bc:17:69:02:91:4e:99:f2:15:f2:24:60:ed:31 bel@localhost.localdomain
    The key's randomart image is:
    +--[ RSA 2048]----+
    |      oo++o.     |
    |     .. E*.      |
    |       *.+.      |
    |        ++ . .   |
    |        S * =    |
    |         . = .   |
    |          . .    |
    |           .     |
    |                 |
    +-----------------+

    (用ssh-keygen创建SSH Keys会创建两个密钥,一个是私密、一个是公密,私密在本机,公密之后会使用ssh-copy-id命令复制到另一台maxscale上,这样两台机器可以通过密钥的加解密实现自动认证并在对方服务器上执行必要的命令)
4.2 使用ssh-copy-id命令将公钥复制到另两台maxscale上

ssh-copy-id root@192.168.56.32 (这里演示向192.168.56.32同步,之后还需要向192.168.56.33同步)
    The authenticity of host '192.168.56.32 (192.168.56.32)' can't be established.
    ECDSA key fingerprint is 8f:71:8e:5c:24:0b:86:81:a3:46:c3:de:36:fd:54:69.
    Are you sure you want to continue connecting (yes/no)? yes (输入同意yes)
    /usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
    /usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
    bel@192.168.56.32's password: (第一次要输入对方服务器上bel用户的密码)
    Number of key(s) added: 1
    Now try logging into the machine, with:   "ssh 'bel@192.168.56.32'"
    and check to make sure that only the key(s) you wanted were added.

4.3 使用 ssh 命令登录另一台maxscale查看是否免密码登录

ssh root@192.168.56.32

    如果输出以下内容并且未提示需要输入密码证明设置成功

Last login: Tue Aug  1 22:34:56 2017 from 192.168.56.1

4.4 在另外几个节点中重复 4.1 到 4.3 步骤
5.其它可参考的内容
5.1 创建某个数据库的用户并授予增删查改的权限

create user 'db_operator'@'192.168.56.%' identified by 'db_operator';
grant select, update, delete, insert on dmc_db.* to 'db_operator'@'192.168.56.%';

5.2 列出集群可用的资源

pcs resource list

5.3 使用xshell管理centos时如果要拷贝文件,建议在centos中安装lrzsz,然后使用rz命令就可以打开同步文件框进行传输

yum install -y lrzsz
rz

5.4 如果需要实现多节点文件或者文件夹内容的实时同步,可以使用lsyncd实现
6. centos 中安装rpm包可以使用yum命令进行安装,以便在rpm有很多依赖包时自动下载安装

yum lcoalinstall ***.rpm

7.设置centos环境变量时在 /etc/profile 文件中添加
8.www.pkgs.org网站有大量的rpm包可以下载
9.一些用户权限的命令

usermod -g 组 用户 (向组中添加用户)
chmod -R 777 文件夹 (给文件夹赋予 777 权限)
/etc/passwd 文件中可以查看所有用户及登录权限
/etc/group 文件中可以查看所有组信息
groups 用户 (查看用户在哪个组中)
chown -R 用户.组 文件夹 (给文件夹授予 用户.组 权限)
ls -a 查看隐藏文件

10.测试中发现的问题

pcs 配置好的 maxscale 集群如果在 3台 mariadb 数据库服务器没有全部启动的情况下 maxscale 无法启动,只有所有3台 mariadb 服务器启动后才能自行启动。只要3台 mariadb 数据库服务器全部正常启动,无论 maxscale 集群中有几台启动都能够正常实现有一台的 maxscale 是正常启动的。

转载于:https://my.oschina.net/ioooi/blog/1505934

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值