NIS服務器故障排除
NIS服務器生成數(shù)據(jù)庫的時候出錯:Unknown hostUpdating protocols...
目標:將主機A配置為nis服務器,nis域名為testnis,主機A的nis域名為yangbo.testnis
步驟如下:
1. 修改/etc/sysconfig/network文件, 加入一行:NISDOMAIN=testnis,即配置nis域名為testnis,并且修改HOSTNAME為yangbo.testnis
2. hostname命令修改主機名為yangbo.testnis
3. 修改/etc/hosts文件,將127.0.0.1這一行改為:127.0.0.1 yangbo.testnis yangbo yangbo
4. 啟動ypserv,yppasswdd服務成功
5. rpcinfo查詢ypserv和yppasswd已經(jīng)成功使用了RPC服務:
運行 rpcinfo -u yangbo ypserv,結果為
program 100004 version 1 ready and waiting
program 100004 version 2 ready and waiting
運行 rpcinfo -u yangbo yppasswdd,結果為
program 100009 version 1 ready and waiting
6. 建立NIS數(shù)據(jù)庫,這一步遇到了問題,系統(tǒng)提示:failed to send 'clear' to local ypserv: RPC: Unknown hostUpdating passwd.byuid...
--------我到網(wǎng)上查,有些人是說這是因為找不到的主機及ip 對應關系,可是在/etc/hosts文件中,這個映射關系我已經(jīng)建立了阿。莫非我配置的不對?請問該怎么配置?
[root@yangbo ~]# /usr/lib/yp/ypinit -m
At this point, we have to construct a list of the hosts which will run NIS
servers. yangbo.testnis is in the list of NIS server hosts. Please continue toadd
the names for the other hosts, one per line. When you are done with the
list, type a <control D>.
next host to add: yangbo.testnis
next host to add:
The current list of NIS servers looks like this:
yangbo.testnis
Is this correct? [y/n: y] y
We need a few minutes to build the databases...
Building /var/yp/testnis/ypservers...
Running /var/yp/Makefile...
gmake[1]: Entering directory `/var/yp/testnis'
Updating passwd.byname...
failed to send 'clear' to local ypserv: RPC: Unknown hostUpdating passwd.byuid...
failed to send 'clear' to local ypserv: RPC: Unknown hostUpdating group.byname...
failed to send 'clear' to local ypserv: RPC: Unknown hostUpdating group.bygid...
failed to send 'clear' to local ypserv: RPC: Unknown hostUpdating hosts.byname...
failed to send 'clear' to local ypserv: RPC: Unknown hostUpdating hosts.byaddr...
failed to send 'clear' to local ypserv: RPC: Unknown hostUpdating rpc.byname...
failed to send 'clear' to local ypserv: RPC: Unknown hostUpdating rpc.bynumber...
failed to send 'clear' to local ypserv: RPC: Unknown hostUpdating services.byname...
failed to send 'clear' to local ypserv: RPC: Unknown hostUpdating services.byservicename...
failed to send 'clear' to local ypserv: RPC: Unknown hostUpdating netid.byname...
failed to send 'clear' to local ypserv: RPC: Unknown hostUpdating protocols.bynumber...
failed to send 'clear' to local ypserv: RPC: Unknown hostUpdating protocols.byname...
failed to send 'clear' to local ypserv: RPC: Unknown hostUpdating mail.aliases...
failed to send 'clear' to local ypserv: RPC: Unknown hostgmake[1]: Leaving directory `/var/yp/testnis'
yangbo.testnis has been set up as a NIS master server.
Now you can run ypinit -s yangbo.testnis on all slave server.