导航:首页 > 配服务器 > 两台服务器如何能自动切换

两台服务器如何能自动切换

发布时间:2023-04-14 22:57:17

㈠ 两台nfs服务器怎么搭建主备自动切换

方法如下:
1、首先建立 auto.master 文件,没有的话就新建,如果存在的话修改下就行

我的原来就有,于是我就在此基础上修改的

########################

[root@localhost ~]# vi /etc/auto.master

#
# $Id: auto.master,v 1.4 2005/01/04 14:36:54 raven Exp $
#
# Sample auto.master 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/auto.misc
#
# 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.
#
#+auto.master

/var/Net/Files /etc/auto.nfs

################

我把配置文件中红色的部分注释掉了,因为存在的话 查看日志文件的话会有错误提示

tail -f /var/log/messages

Dec 2 08:52:21 localhost automount[6475]: lookup_read_master: lookup(nisplus): couldn't locate nis+ table auto.master

2、然后建立目录

mkdir /var/Net/Files

注意,要保证 Files 目录是空的

3、建立 auto.nfs 配置文件

[root@localhost ~]# vi /etc/auto.nfs

temp -rw,bg,soft,rsize=32768,wsize=32768 10.2.2.136:/var/Net/Files/temp
UPGRADE_FILE -rw,bg,soft,rsize=32768,wsize=32768 10.2.2.136:/var/Net/Files/UPGRADE_FILE
UPGRADE_DOC -rw,bg,soft,rsize=32768,wsize=32768 10.2.2.136:/var/Net/Files/UPGRADE_DOC

4、136是服务器,137是客户端,红色部分需要和服务器中的exports配置文件相对应

[root@localhost rsync]# cat /etc/exports
/var/Net/Files/temp
/ 10.2.2.137(rw,no_root_squash)
/var/Net/Files/UPGRADE_DOC
/ 10.2.2.137(rw,no_root_squash)
/var/Net/Files/UPGRADE_FILE
/ 10.2.2.137(rw,no_root_squash)

服务器要开启 portmap 和 nfs 服务

[root@localhost rsync]# /etc/init.d/portmap restart

[root@localhost rsync]# /etc/init.d/nfs restart

5、客户端启动 autofs 服务

[root@localhost Files]# /etc/init.d/autofs restart

查看日志,保证没有错误

tail -f /var/log/messages

查看服务端是否开启/提供服务

[root@localhost Files]# showmount -e 10.2.2.136(服务端)
Export list for 10.2.2.136:
/var/Net/111 10.2.2.137
/var/Net/Files/temp 10.2.2.137
/var/Net/Files/UPGRADE_DOC 10.2.2.137
/var/Net/Files/UPGRADE_FILE 10.2.2.137

6、测试的方法就是

cd /var/Net/Files目录中看不见任何内容,

然后

cd UPGRADE_FILE

cd UPGRADE_DOC

cd temp

能进去,能使用 ,差不多就这样

阅读全文

与两台服务器如何能自动切换相关的资料

热点内容
java下载文件的文件名 浏览:460
神奇宝贝我的世界电脑版服务器地址 浏览:4
shellls命令 浏览:762
军用压缩饼干怎么吃 浏览:938
人道pdf 浏览:610
分类视觉算法 浏览:257
android弹出键盘位置 浏览:451
安卓怎么下载爱思助 浏览:985
安卓机的呼叫怎么开启 浏览:355
腾讯服务器硬盘什么价 浏览:841
交换机关闭所有端口命令 浏览:91
程序员可以开网店吗 浏览:115
算法工程师面试经验 浏览:686
有什么好用的陪聊app 浏览:698
什么是备中心服务器 浏览:144
linux配置本地yum源 浏览:539
半导体器件与工艺pdf 浏览:528
超大文件解压太慢 浏览:861
微光app主页的爱心代表什么意思 浏览:563
程序员和饺子做饭 浏览:307