今天再次配置NIS服务器时,在尝试更新slave的机器时,出现报错!
[root@slave yp]# /usr/lib/yp/ypinit -s master.test
Can’t enumerate maps from master.test. Please check that it is running.
对此,排错的思路如下:
1、检查master机器的ypservers配置,/var/yp/Makefile文件
2、在slave的机器上开启ypbind服务,并进行联机测试
3、ypserv.conf文件
具体细节如下:
1、ypservers的配置
[root@master yp]# cat /var/yp/ypservers
master.test
slave.test
Makefile文件
[root@master yp]# vi /var/yp/Makefile
NOPUSH=false #允许数据据传输
为了方便排错,我已将该文件权限修改为所有权限
[root@master yp]# cat /etc/ypserv.conf
* : * : * : none
2、开启slave的ypbind服务,并以客户端的形式来测试master的服务器
[root@slave yp]# service ypbind restart
关闭 NIS 服务: [确定]
关联到 NIS 域: [确定]
监听 NIS 域服务器。
[root@slave yp]# ypcat -h master.test passwd.byname
student42:$1$Md5TZRrf$UAVsieQiP9NtK1MzWnphw0:542:500::/home/student42:/bin/bash
student22:$1$w2k.mygE$dRvYKxBzZDJ6bbTPja/rM.:522:500::/home/student22:/bin/bash
student47:$1$7QBTdlNj$ElSoXDtFd.2PvPf7GuJjv0:547:500::/home/student47:/bin/bash
student27:$1$uFsh0iUk$HvDfHSxkRtWCU.4KscHBj.:527:500::/home/student27:/bin/bash
省去很多结果…
以客户端形式可以获取到服务器上的用户信息
[root@slave yp]# ypwhich -x
Use “ethers” for map “ethers.byname”
Use “aliases” for map “mail.aliases”
Use “services” for map “services.byname”
Use “protocols” for map “protocols.bynumber”
Use “hosts” for map “hosts.byname”
Use “networks” for map “networks.byaddr”
Use “group” for map “group.byname”
Use “passwd” for map “passwd.byname”
该问题的报错,仍在继续。网友反映说slave的机器上要开启ypbind服务,我这边开了这个服务,仍然不能够从master处获取更新。
If your database is corrupt or your /etc/hosts files are incorrect, you’ll get map enumeration errors as shown. Use the make command again to rebuild your database on the master when necessary.
针对ubuntu官网上的这句话,我估计可能是我的hosts文件的不是很好。于是修改master及slave的host文件:
[root@slave yp]# 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.10.40 master
192.168.10.41 slave
再次配置发现OK
[root@slave yp]# /usr/lib/yp/ypinit -s master
We will need a few minutes to copy the data from master.
Transferring services.byname…
Trying ypxfrd … success
Transferring rpc.bynumber…
Trying ypxfrd … success
Transferring passwd.byname…
Trying ypxfrd … success
Transferring services.byservicename…
Trying ypxfrd … success
Transferring ypservers…
Trying ypxfrd … success
Transferring netid.byname…
Trying ypxfrd … success
Transferring protocols.bynumber…
Trying ypxfrd … success
Transferring rpc.byname…
Trying ypxfrd … success
Transferring hosts.byaddr…
Trying ypxfrd … success
Transferring mail.aliases…
Trying ypxfrd … success
Transferring passwd.byuid…
Trying ypxfrd … success
Transferring hosts.byname…
Trying ypxfrd … success
Transferring protocols.byname…
Trying ypxfrd … success
Transferring group.byname…
Trying ypxfrd … success
Transferring group.bygid…
Trying ypxfrd … success
现在再配置客户端就行了。不清楚的话,看其他的内容!
本文出自 “潜入技术的海洋” 博客,请务必保留此出处http://myhat.blog.51cto.com/391263/450259