2、主备服务器的自动切换主要依赖于服务器上的集群软件,心跳检测是集群软件中为实现自动切换功能而设的一种手段,用以判定集群中的其他服务器是否正常工作。
3、集群软件通常由 *** 作系统厂商配备或由第三方公司提供,具体有哪些品牌/型号首先要看你服务器上用的是哪种 *** 作系统。少数应用系统,像ORACLE数据库甚至会自带集群软件。方法如下:
1、首先建立 automaster 文件,没有的话就新建,如果存在的话修改下就行
我的原来就有,于是我就在此基础上修改的
########################
[root@localhost ~]# vi /etc/automaster
#
# $Id: automaster,v 14 2005/01/04 14:36:54 raven Exp $
#
# Sample automaster file
# This is an automounter map and it has the following format
# key [ -mount-options-separated-by-comma ] location
# For details of the format look at autofs(5)
#
/misc /etc/automisc
#
# NOTE: mounts done from a hosts map will be mounted with the
# "nosuid" and "nodev" options unless the "suid" and "dev"
# options are explicitly given
#
/net -hosts
#
# Include central master map if it can be found using
# nsswitch sources
#
# Note that if there are entries for /net or /misc (as
# above) in the included master map any keys that are the
# same will not be seen as the first read key seen takes
# precedence
#
#+automaster
/var/Net/Files /etc/autonfs
################
我把配置文件中红色的部分注释掉了,因为存在的话 查看日志文件的话会有错误提示
tail -f /var/log/messages
Dec 2 08:52:21 localhost automount[6475]: lookup_read_master: lookup(nisplus): couldn't locate nis+ table automaster
2、然后建立目录
mkdir /var/Net/Files
注意,要保证 Files 目录是空的
3、建立 autonfs 配置文件
[root@localhost ~]# vi /etc/autonfs
temp -rw,bg,soft,rsize=32768,wsize=32768 1022136:/var/Net/Files/temp
UPGRADE_FILE -rw,bg,soft,rsize=32768,wsize=32768 1022136:/var/Net/Files/UPGRADE_FILE
UPGRADE_DOC -rw,bg,soft,rsize=32768,wsize=32768 1022136:/var/Net/Files/UPGRADE_DOC
4、136是服务器,137是客户端,红色部分需要和服务器中的exports配置文件相对应
[root@localhost rsync]# cat /etc/exports
/var/Net/Files/temp
/ 1022137(rw,no_root_squash)
/var/Net/Files/UPGRADE_DOC
/ 1022137(rw,no_root_squash)
/var/Net/Files/UPGRADE_FILE
/ 1022137(rw,no_root_squash)
服务器要开启 portmap 和 nfs 服务
[root@localhost rsync]# /etc/initd/portmap restart
[root@localhost rsync]# /etc/initd/nfs restart
5、客户端启动 autofs 服务
[root@localhost Files]# /etc/initd/autofs restart
查看日志,保证没有错误
tail -f /var/log/messages
查看服务端是否开启/提供服务
[root@localhost Files]# showmount -e 1022136(服务端)
Export list for 1022136:
/var/Net/111 1022137
/var/Net/Files/temp 1022137
/var/Net/Files/UPGRADE_DOC 1022137
/var/Net/Files/UPGRADE_FILE 1022137
6、测试的方法就是
cd /var/Net/Files目录中看不见任何内容,
然后
cd UPGRADE_FILE
cd UPGRADE_DOC
cd temp
能进去,能使用 ,差不多就这样在多交换机的局域网环境中,交换机的级联、堆叠和集群是3种重要的技术。级联技术可以实现多台交换机之间的互连;堆叠技术可以将多台交换机组成一个单元,从而提高更大的端口密度和更高的性能;集群技术可以将相互连接的多台交换机作为一个逻辑设备进行管理,从而大大降低了网络管理成本,简化管理 *** 作。看你怎么访问你的web了,如果是ip地址访问,做的麻烦点,需要1,2上面都做设置
如果是域名访问,可以用dns来解决,需要有宕机检测
以上是网络解决,要不就多一个网卡做心跳线互联,自己写脚本
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)