手机版
你好,游客 登录 注册 搜索
背景:
阅读新闻

主从NIS服务器配置手册

[日期:2013-05-25] 来源:Linux社区  作者:linuxadmin [字体: ]

主从NIS服务器配置环境及背景

主服务器为node3,从服务器为node9。由于考虑到单点故障可能性较大,经讨论在原有的基础上搭建一个从nis服务器。实施要求,尽可能依据主nis服务器的配置。

主、从服务器系统版本:

Red Hat Enterprise Linux Server release 5.5 (Tikanga
客户端系统版本:
Red Hat Enterprise Linux AS release 4 (Nahant Update 7)

配置过程

1,配置主服务器

为便于区分主从服务器,建议修改node3,node9的主机名

将node3修改为nis,将node9 修改为slavenis

1)编辑/etc/sysconfig /network文件

HOSTNAME=nis

2)修改/etc/hosts文件

192.168.111.3nis.godson.ictnisnis

192.168.111.9 slavenis.godson.ictslavenisslavenis

重启网络:

/etc/init.d/network restart

3)修改/etc/yp.conf文件,加入一条

domain godson.ict server slavenis  #指定备用服务器

4)修改/var/yp/Makefile文件

NOPUSH=false  #允许主服务器向从服务器传递数据库文件

vim /var/yp/ypservices  添加从服务器主机名
slavenis.godson.ict 

重启服务:

/etc/init.d/ypserv restart

/etc/init.d/ypbind restart

/etc/init.d/yppasswdd restart

/etc/init.d/ypxfrd restart

5)查看服务是否启动:

rpcinfo -p

6)将服务设置开机启动:

chkconfig --level 35 ypxfrd on

7)建立主服务器的数据库文件:

/usr/lib64/yp/ypinit -m

 

 

2,配置从服务器

1)修改/etc/sysconfig/network文件

HOSTNAME=slavenis

NISDOMAIN=godson.ict

2)修改/etc/rc.local文件

echo “/bin/nisdomainname godson.ict”>>/etc/rc.local

3)修改/etc/hosts文件

192.168.111.3nis.godson.ictnisnis

192.168.111.9 slavenis.godson.ictslavenisslavenis

重启网络:

/etc/init.d/network restart

4)安装rpm包:ypserv,ypbind,yp-tools,portmap

5)修改/etc/nsswitch.conf文件

6)修改/etc/yp.conf文件

domain godson.ict server nis

domain godson.ict server slavenis

ypserver nis           

7)修改/etc/ypserv.conf文件

*          : godson.ict : *    : none

重启服务:

/etc/init.d/ypserv restart

/etc/init.d/ypxfrd restart

/etc/init.d/ypbind restart

/etc/init.d/portmap restart

8)将服务设置开机启动:

chkconfig --level 35 ypxfrd on

chkconfig --level 35 ypbind on

chkconfig --level 35 ypserv on

chkconfig --level 35 portmap on

 

9)同步主服务器的数据库文件:

/usr/lib64/yp/ypinit -s nis

linux
相关资讯       NIS  NIS服务器 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款