linux-ha heartbeat高可用的安装配置(http服务高可用)

本文涉及的产品
RDS MySQL Serverless 基础系列,0.5-2RCU 50GB
云数据库 RDS MySQL,集群系列 2核4GB
推荐场景:
搭建个人博客
RDS MySQL Serverless 高可用系列,价值2615元额度,1个月
简介:     heartbeat工作原理:本次实验,使用广播地址225.0.0.11 694作为heartbeat的网络心跳地址,heartbeat通过网络心跳监测对端服务是否正常, 通过/etc/ha.d/ha.cf 文件的deadtime参数判断对端服务中断,通过参数auto_failback参数控制资源失败自动接管,从而完成httpd服务的双机互备。
    heartbeat工作原理:本次实验,使用广播地址225.0.0.11 694作为heartbeat的网络心跳地址,heartbeat通过网络心跳监测对端服务是否正常,
通过/etc/ha.d/ha.cf 文件的deadtime参数判断对端服务中断,通过参数auto_failback参数控制资源失败自动接管,从而完成httpd服务的双机互备。
两台主机(一台是rhel6.4 arbiter,一台是centos6.8 mymongo1)
一、两台主机的基本信息,重点是hosts文件的IP地址主机名解析
[root@mymongo1 ~]# uname -a
Linux mymongo1 2.6.32-642.el6.x86_64 #1 SMP Tue May 10 17:27:01 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
[root@mymongo1 ~]# hostname
mymongo1
[root@mymongo1 ~]# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
#::1 localhost6.localdomain6 localhost6
192.168.144.111 arbiter
192.168.144.132 mymongo1
[root@mymongo1 ~]# ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:0C:29:40:94:8E
inet addr:192.168.199.131 Bcast:192.168.199.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe40:948e/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:46 errors:0 dropped:0 overruns:0 frame:0
TX packets:30 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:4219 (4.1 KiB) TX bytes:3299 (3.2 KiB)
eth1 Link encap:Ethernet HWaddr 00:0C:29:40:94:98
inet addr:192.168.144.132 Bcast:192.168.144.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe40:9498/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1890 errors:0 dropped:0 overruns:0 frame:0
TX packets:1800 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:253127 (247.1 KiB) TX bytes:252326 (246.4 KiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:8 errors:0 dropped:0 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:576 (576.0 b) TX bytes:576 (576.0 b)
[root@mymongo1 ~]#

[root@arbiter ~]# hostname
arbiter
[root@arbiter ~]# uname -a
Linux arbiter 2.6.32-358.el6.x86_64 #1 SMP Tue Jan 29 11:47:41 EST 2013 x86_64 x86_64 x86_64 GNU/Linux
[root@arbiter ~]# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
#::1 localhost6.localdomain6 localhost6
192.168.144.111 arbiter
192.168.144.132 mymongo1
[root@arbiter ~]# ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:50:56:3E:FE:CF
inet addr:192.168.199.128 Bcast:192.168.199.255 Mask:255.255.255.0
inet6 addr: fe80::250:56ff:fe3e:fecf/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:85 errors:0 dropped:0 overruns:0 frame:0
TX packets:25 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:9437 (9.2 KiB) TX bytes:2719 (2.6 KiB)
eth1 Link encap:Ethernet HWaddr 00:50:56:21:CF:3E
inet addr:192.168.144.111 Bcast:192.168.144.255 Mask:255.255.255.0
inet6 addr: fe80::250:56ff:fe21:cf3e/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2992 errors:0 dropped:0 overruns:0 frame:0
TX packets:3054 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:348131 (339.9 KiB) TX bytes:423727 (413.7 KiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:4 errors:0 dropped:0 overruns:0 frame:0
TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:240 (240.0 b) TX bytes:240 (240.0 b)
[root@arbiter ~]#

二、heartbeat的安装,rhel和centos安装不一样,先安装centos机器的heartbeat
注意: 最少保证2台主机中的centos主机能够上网,centos安装Heartbeats,通过yum方式网络安装
1、首先下载epel-release-6-8.noarch.rpm
wget http://mirrors.sohu.com/fedora-epel/6/x86_64/epel-release-6-8.noarch.rpm
[root@mymongo1 ~]# ls
amoeba Documents install.log mysql-5.6.36.tar.gz Pictures Videos
anaconda-ks.cfg Downloads install.log.syslog mysql-proxy-0.8.2 Public
arbiter epel-release-6-8.noarch.rpm lua-5.1.4 mysql-proxy-0.8.2.tar.gz Templates
cmake-2.8.10.2.tar.gz glib-2.22.5 lua-5.1.4.tar.gz mysql-proxy-0.8.5 test1.sh
Desktop glib-2.22.5.tar Music mysql-proxy-0.8.5.tar.gz test.sh
[root@mymongo1 ~]#
--安装epel,其实是安装yum源
rpm -ivh epel-release-6-8.noarch.rpm
[root@mymongo1 yum.repos.d]# pwd
/etc/yum.repos.d
[root@mymongo1 yum.repos.d]# ls
CentOS-Base.repo CentOS-Debuginfo.repo CentOS-fasttrack.repo CentOS-Media.repo CentOS-Vault.repo epel.repo epel-testing.repo
[root@mymongo1 yum.repos.d]#
[root@mymongo1 yum.repos.d]# cat epel.repo
[epel]
name=Extra Packages for Enterprise Linux 6 - $basearch
#baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6

[epel-debuginfo]
name=Extra Packages for Enterprise Linux 6 - $basearch - Debug
#baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch/debug
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-6&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
gpgcheck=1

[epel-source]
name=Extra Packages for Enterprise Linux 6 - $basearch - Source
#baseurl=http://download.fedoraproject.org/pub/epel/6/SRPMS
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-source-6&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
gpgcheck=1
[root@mymongo1 yum.repos.d]#
[root@mymongo1 yum.repos.d]# cat epel-testing.repo
[epel-testing]
name=Extra Packages for Enterprise Linux 6 - Testing - $basearch
#baseurl=http://download.fedoraproject.org/pub/epel/testing/6/$basearch
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=testing-epel6&arch=$basearch
failovermethod=priority
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6

[epel-testing-debuginfo]
name=Extra Packages for Enterprise Linux 6 - Testing - $basearch - Debug
#baseurl=http://download.fedoraproject.org/pub/epel/testing/6/$basearch/debug
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=testing-debug-epel6&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
gpgcheck=1

[epel-testing-source]
name=Extra Packages for Enterprise Linux 6 - Testing - $basearch - Source
#baseurl=http://download.fedoraproject.org/pub/epel/testing/6/SRPMS
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=testing-source-epel6&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
gpgcheck=1
[root@mymongo1 yum.repos.d]#
--调整yum的配置文件,缓存本次heartbeat安装需要的依赖包
[root@mymongo1 etc]# cat yum.conf
[main]
cachedir=/var/cache/yum/$basearch/$releasever
keepcache=1
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
installonly_limit=5
bugtracker_url=http://bugs.centos.org/set_project.php?project_id=19&ref=http://bugs.centos.org/bug_report_page.php?category=yum
distroverpkg=centos-release
[root@mymongo1 etc]#
--使用yum工具安装heartbeat
yum -y install heartbeat
安装完成后heartbeat的缓存目录
[root@mymongo1 ~]# find / -name heartbeat*.rpm
/var/cache/yum/x86_64/6/epel/packages/ heartbeat-3.0.4-2.el6.x86_64.rpm
/var/cache/yum/x86_64/6/epel/packages/ heartbeat-libs-3.0.4-2.el6.x86_64.rpm
[root@mymongo1 ~]#
[root@mymongo1 ~]# cd /var/cache/yum/x86_64/6/base/packages/
[root@mymongo1 packages]# ll
total 2060
-rw-r--r--. 1 root root 66344 Jul 24 2015 cifs-utils-4.8.1-20.el6.x86_64.rpm
-rw-r--r--. 1 root root 72744 Jun 24 2012 cluster-glue-1.0.5-6.el6.x86_64.rpm
-rw-r--r--. 1 root root 119096 Jun 24 2012 cluster-glue-libs-1.0.5-6.el6.x86_64.rpm
-rw-r--r--. 1 root root 40152 Oct 17 2014 keyutils-1.4-5.el6.x86_64.rpm
-rw-r--r--. 1 root root 23488 Sep 25 2011 libgssglue-0.1-11.el6.x86_64.rpm
-rw-r--r--. 1 root root 343900 Mar 23 08:00 nfs-utils-1.2.3-75.el6.x86_64.rpm
-rw-r--r--. 1 root root 72268 Mar 23 08:02 nfs-utils-lib-1.1.5-13.el6.x86_64.rpm
-rw-r--r--. 1 root root 38264 Oct 17 2014 perl-TimeDate-1.16-13.el6.noarch.rpm
-rw-r--r--. 1 root root 913840 Jul 2 2011 PyXML-0.8.4-19.el6.x86_64.rpm
-rw-r--r--. 1 root root 398016 Mar 24 06:25 resource-agents-3.9.5-46.el6.x86_64.rpm
[root@mymongo1 packages]#

2、在rhel机器上arbiter安装heartbeat,方法是将centos机器mymongo1上的heartbeat包及其依赖包scp到arbiter机器上,
使用rpm -ivh方式安装,安装过程(安装过程中需要其他依赖的rpm包,可以挂载centos cd1镜像到arbiter上找到安装即可):
[root@arbiter heartbeat]# ls
cifs-utils-4.8.1-20.el6.x86_64.rpm keyutils-libs-1.4-5.el6.x86_64.rpm perl-TimeDate-1.16-13.el6.noarch.rpm
cluster-glue-1.0.5-6.el6.x86_64.rpm libevent-1.4.13-4.el6.x86_64.rpm python-argparse-1.2.1-2.1.el6.noarch.rpm
cluster-glue-libs-1.0.5-6.el6.x86_64.rpm libgssglue-0.1-11.el6.x86_64.rpm PyXML-0.8.4-19.el6.x86_64.rpm
heartbeat-3.0.4-2.el6.x86_64.rpm libtirpc-0.2.1-11.el6.x86_64.rpm resource-agents-3.9.5-46.el6.x86_64.rpm
heartbeat-libs-3.0.4-2.el6.x86_64.rpm nfs-utils-1.2.3-75.el6.x86_64.rpm rpcbind-0.2.0-12.el6.x86_64.rpm
keyutils-1.4-5.el6.x86_64.rpm nfs-utils-lib-1.1.5-13.el6.x86_64.rpm
[root@arbiter heartbeat]# rpm -ivh PyXML-0.8.4-19.el6.x86_64.rpm
warning: PyXML-0.8.4-19.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID c105b9de: NOKEY
Preparing... ########################################### [100%]
1:PyXML ########################################### [100%]
[root@arbiter heartbeat]# rpm -ivh perl-TimeDate-1.16-13.el6.noarch.rpm
warning: perl-TimeDate-1.16-13.el6.noarch.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Preparing... ########################################### [100%]
1:perl-TimeDate ########################################### [100%]
[root@arbiter heartbeat]# rpm -ivh cifs-utils-4.8.1-20.el6.x86_64.rpm keyutils-1.4-5.el6.x86_64.rpm keyutils-libs-1.4-5.el6.x86_64.rpm
warning: cifs-utils-4.8.1-20.el6.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Preparing... ########################################### [100%]
file /lib64/libkeyutils.so.1.3 from install of keyutils-libs-1.4-5.el6.x86_64 conflicts with file from package keyutils-libs-1.4-4.el6.x86_64
[root@arbiter heartbeat]# rpm -qa|grep keyutils-libs
keyutils-libs-1.4-4.el6.x86_64
[root@arbiter heartbeat]# rpm -e keyutils-libs
error: Failed dependencies:
libkeyutils.so.1()(64bit) is needed by (installed) krb5-libs-1.10.3-10.el6.x86_64
libkeyutils.so.1(KEYUTILS_0.3)(64bit) is needed by (installed) krb5-libs-1.10.3-10.el6.x86_64
[root@arbiter heartbeat]# rpm -e --nodeps keyutils-libs
[root@arbiter heartbeat]# rpm -qa|grep keyutils-libs
[root@arbiter heartbeat]# rpm -ivh cifs-utils-4.8.1-20.el6.x86_64.rpm keyutils-1.4-5.el6.x86_64.rpm keyutils-libs-1.4-5.el6.x86_64.rpm
warning: cifs-utils-4.8.1-20.el6.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Preparing... ########################################### [100%]
1:keyutils-libs ########################################### [ 33%]
2:keyutils ########################################### [ 67%]
3:cifs-utils ########################################### [100%]
[root@arbiter heartbeat]# rpm -ivh cluster-glue-*
warning: cluster-glue-1.0.5-6.el6.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Preparing... ########################################### [100%]
1:cluster-glue-libs ########################################### [ 50%]
2:cluster-glue ########################################### [100%]
[root@arbiter heartbeat]# rpm -ivh libgssglue-0.1-11.el6.x86_64.rpm
warning: libgssglue-0.1-11.el6.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Preparing... ########################################### [100%]
1:libgssglue ########################################### [100%]
[root@arbiter heartbeat]# rpm -ivh libgssglue-0.1-11.el6.x86_64.rpm
warning: libgssglue-0.1-11.el6.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Preparing... ########################################### [100%]
package libgssglue-0.1-11.el6.x86_64 is already installed
[root@arbiter heartbeat]# rpm -ivh libevent-1.4.13-4.el6.x86_64.rpm
warning: libevent-1.4.13-4.el6.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Preparing... ########################################### [100%]
1:libevent ########################################### [100%]
[root@arbiter heartbeat]# rpm -ivh python-argparse-1.2.1-2.1.el6.noarch.rpm
warning: python-argparse-1.2.1-2.1.el6.noarch.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Preparing... ########################################### [100%]
1:python-argparse ########################################### [100%]
[root@arbiter heartbeat]# rpm -ivh libtirpc-0.2.1-11.el6.x86_64.rpm
warning: libtirpc-0.2.1-11.el6.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Preparing... ########################################### [100%]
1:libtirpc ########################################### [100%]
[root@arbiter heartbeat]# rpm -ivh rpcbind-0.2.0-12.el6.x86_64.rpm
warning: rpcbind-0.2.0-12.el6.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Preparing... ########################################### [100%]
1:rpcbind ########################################### [100%]
[root@arbiter heartbeat]# rpm -ivh nfs-utils-*
warning: nfs-utils-1.2.3-75.el6.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Preparing... ########################################### [100%]
1:nfs-utils-lib ########################################### [ 50%]
2:nfs-utils ########################################### [100%]
[root@arbiter heartbeat]# rpm -ivh heartbeat-*
warning: heartbeat-3.0.4-2.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY
error: Failed dependencies:
resource-agents is needed by heartbeat-3.0.4-2.el6.x86_64
[root@arbiter heartbeat]# rpm -ivh resource-agents-3.9.5-46.el6.x86_64.rpm
warning: resource-agents-3.9.5-46.el6.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Preparing... ########################################### [100%]
1:resource-agents ########################################### [100%]
[root@arbiter heartbeat]# rpm -ivh heartbeat-*
warning: heartbeat-3.0.4-2.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY
Preparing... ########################################### [100%]
1:heartbeat-libs ########################################### [ 50%]
2:heartbeat ########################################### [100%]
[root@arbiter heartbeat]#
3、heartbeat安装完成后,配置以下三个配置文件
[root@mymongo1 ~]# ll /etc/ha.d/
total 32
-rw-------. 1 root root 37 Aug 16 23:53 authkeys
-rw-r--r--. 1 root root 239 Aug 17 00:01 ha.cf
-rwxr-xr-x. 1 root root 745 Dec 2 2013 harc
-rw-r--r--. 1 root root 206 Aug 17 01:01 haresources
drwxr-xr-x. 2 root root 4096 Aug 16 22:42 rc.d
-rw-r--r--. 1 root root 692 Dec 2 2013 README.config
drwxr-xr-x. 2 root root 4096 Aug 16 22:42 resource.d
-rw-r--r--. 1 root root 2082 Mar 24 06:01 shellfuncs
[root@mymongo1 ~]#
heartbeat三个配置文件的所在目录
[root@mymongo1 ~]# rpm -q heartbeat -d
/usr/share/doc/heartbeat-3.0.4/AUTHORS
/usr/share/doc/heartbeat-3.0.4/COPYING
/usr/share/doc/heartbeat-3.0.4/COPYING.LGPL
/usr/share/doc/heartbeat-3.0.4/ChangeLog
/usr/share/doc/heartbeat-3.0.4/README
/usr/share/doc/heartbeat-3.0.4/apphbd.cf
/usr/share/doc/heartbeat-3.0.4/authkeys
/usr/share/doc/heartbeat-3.0.4/ha.cf
/usr/share/doc/heartbeat-3.0.4/haresources
/usr/share/man/man1/cl_status.1.gz
/usr/share/man/man1/hb_addnode.1.gz
/usr/share/man/man1/hb_delnode.1.gz
/usr/share/man/man1/hb_standby.1.gz
/usr/share/man/man1/hb_takeover.1.gz
/usr/share/man/man5/authkeys.5.gz
/usr/share/man/man5/ha.cf.5.gz
/usr/share/man/man8/apphbd.8.gz
/usr/share/man/man8/heartbeat.8.gz
[root@mymongo1 ~]#
heartbeat的ha.cf配置
[root@mymongo1 ~]# cat /etc/ha.d/ha.cf
#heartbeat controlfile
debugfile /var/log/ha-debug
logfile /var/log/ha-log
logfacility local1
keepalive 2
deadtime 30
warntime 10
initdead 60

#bcast eth1,使用广播方式做Heartbeat的心跳
mcast eth1 225.0.0.11 694 1 0

auto_failback on
node arbiter
node mymongo1

crm no
[root@mymongo1 ~]#
heartbeat的authkeys配置
sha1加密字符串随意,但是要求权限是600
[root@mymongo1 ~]# cat /etc/ha.d/authkeys
auth 1
1 sha1 adf220fnasdfinvs02adsf
[root@mymongo1 ~]#
heartbeart的haresources配置
这里注意:配置的资源是浮动vip的地址,vip绑定的网络端口要保持一致,用eth1都用eth1,用eth0都用eth0
并且eht1和eth0要用不同的IP网段,网口后的服务httpd代表资源启动时会连带启动httpd,没有则不启动
[root@mymongo1 ~]# cat /etc/ha.d/haresources
arbiter IPaddr::192.168.144.121/24/eth1 httpd

mymongo1 IPaddr::192.168.144.122/24/eth1

#mysql master
#arbiter IPaddr::192.168.144.11/24/eth1 mysqld

#mysql salve
#mymongo1 IPaddr::192.168.144.12/24/eth1
[root@mymongo1 ~]#
三、本次实验使用http做测试
2台主机分别编辑index.html
[root@mymongo1 ~]# cat /var/www/html/index.html
this is mymongo1,its ip is 192.168.144.132
[root@mymongo1 ~]#
[root@arbiter ~]# cat /var/www/html/index.html
this is arbiter ,its ip is 192.168.144.111!
[root@arbiter ~]#
2台主机均启动http服务
[root@arbiter ~]# service httpd status
httpd (pid 4574) is running...
[root@arbiter ~]#
[root@mymongo1 ~]# service httpd status
httpd (pid 5714) is running...
[root@mymongo1 ~]#

2台主机均启动heartbeat
[root@mymongo1 ~]# /etc/init.d/heartbeat start
Starting High-Availability services: INFO: Resource is stopped
INFO: Resource is stopped
Done.
[root@mymongo1 ~]#
稍等1分钟左右观察浮动IP会启动
[root@mymongo1 ~]# ip add|grep 192.168.144
inet 192.168.144.132/24 brd 192.168.144.255 scope global eth1
inet 192.168.144.122/24 brd 192.168.144.255 scope global secondary eth1
[root@mymongo1 ~]#
[root@arbiter ~]# /etc/init.d/heartbeat start
Starting High-Availability services: INFO: Resource is stopped
INFO: Resource is stopped
Done.
[root@arbiter ~]# ip add|grep 192.168.144
inet 192.168.144.111/24 brd 192.168.144.255 scope global eth1
inet 192.168.144.121/24 brd 192.168.144.255 scope global secondary eth1
[root@arbiter ~]#
网页查看








相关实践学习
如何在云端创建MySQL数据库
开始实验后,系统会自动创建一台自建MySQL的 源数据库 ECS 实例和一台 目标数据库 RDS。
全面了解阿里云能为你做什么
阿里云在全球各地部署高效节能的绿色数据中心,利用清洁计算为万物互联的新世界提供源源不断的能源动力,目前开服的区域包括中国(华北、华东、华南、香港)、新加坡、美国(美东、美西)、欧洲、中东、澳大利亚、日本。目前阿里云的产品涵盖弹性计算、数据库、存储与CDN、分析与搜索、云通信、网络、管理与监控、应用服务、互联网中间件、移动服务、视频服务等。通过本课程,来了解阿里云能够为你的业务带来哪些帮助     相关的阿里云产品:云服务器ECS 云服务器 ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。产品详情: https://www.aliyun.com/product/ecs
目录
相关文章
|
20天前
|
Linux 应用服务中间件 Shell
linux系统服务二!
本文详细介绍了Linux系统的启动流程,包括CentOS 7的具体启动步骤,从BIOS自检到加载内核、启动systemd程序等。同时,文章还对比了CentOS 6和CentOS 7的启动流程,分析了启动过程中的耗时情况。接着,文章讲解了Linux的运行级别及其管理命令,systemd的基本概念、优势及常用命令,并提供了自定义systemd启动文件的示例。最后,文章介绍了单用户模式和救援模式的使用方法,包括如何找回忘记的密码和修复启动故障。
41 5
linux系统服务二!
|
20天前
|
Linux 应用服务中间件 Shell
linux系统服务!!!
本文详细介绍了Linux系统(以CentOS7为例)的启动流程,包括BIOS自检、读取MBR信息、加载Grub菜单、加载内核及驱动程序、启动systemd程序加载必要文件等五个主要步骤。同时,文章还对比了CentOS6和CentOS7的启动流程图,并分析了启动流程的耗时。此外,文中还讲解了Linux的运行级别、systemd的基本概念及其优势,以及如何使用systemd管理服务。最后,文章提供了单用户模式和救援模式的实战案例,帮助读者理解如何在系统启动出现问题时进行修复。
39 3
linux系统服务!!!
|
12天前
|
缓存 资源调度 安全
深入探索Linux操作系统的心脏——内核配置与优化####
本文作为一篇技术性深度解析文章,旨在引领读者踏上一场揭秘Linux内核配置与优化的奇妙之旅。不同于传统的摘要概述,本文将以实战为导向,直接跳入核心内容,探讨如何通过精细调整内核参数来提升系统性能、增强安全性及实现资源高效利用。从基础概念到高级技巧,逐步揭示那些隐藏在命令行背后的强大功能,为系统管理员和高级用户打开一扇通往极致性能与定制化体验的大门。 --- ###
39 9
|
14天前
|
存储 安全 数据管理
如何在 Rocky Linux 8 上安装和配置 Elasticsearch
本文详细介绍了在 Rocky Linux 8 上安装和配置 Elasticsearch 的步骤,包括添加仓库、安装 Elasticsearch、配置文件修改、设置内存和文件描述符、启动和验证 Elasticsearch,以及常见问题的解决方法。通过这些步骤,你可以快速搭建起这个强大的分布式搜索和分析引擎。
30 5
|
24天前
|
Linux 数据库
Linux服务如何实现服务器重启后的服务延迟自启动?
【10月更文挑战第25天】Linux服务如何实现服务器重启后的服务延迟自启动?
126 3
|
24天前
|
关系型数据库 MySQL Linux
Linux系统如何设置自启动服务在MySQL数据库启动后执行?
【10月更文挑战第25天】Linux系统如何设置自启动服务在MySQL数据库启动后执行?
68 3
|
28天前
|
Java Linux 网络安全
NIFI在Linux服务区上的部署配置过程是什么?
【10月更文挑战第21天】NIFI在Linux服务区上的部署配置过程是什么?
47 2
|
1月前
|
Ubuntu Linux 编译器
Linux/Ubuntu下使用VS Code配置C/C++项目环境调用OpenCV
通过以上步骤,您已经成功在Ubuntu系统下的VS Code中配置了C/C++项目环境,并能够调用OpenCV库进行开发。请确保每一步都按照您的系统实际情况进行适当调整。
308 3
|
1月前
|
监控 安全 网络协议
快速配置Linux云服务器
【10月更文挑战第3天】快速配置Linux云服务器
|
1月前
|
Ubuntu Linux 网络安全
Linux中服务管理问题
【10月更文挑战第4天】
26 2
下一篇
无影云桌面