免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1116 | 回复: 0
打印 上一主题 下一主题

Solaris9(sparc)搭建NIS环境 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-11-28 12:16 |只看该作者 |倒序浏览

Solaris9(sparc)搭建NIS环境

硬件环境:2台U 10:lion、dove
软件环境:
操作系统:solaris9
Master server : lion (135.252.160.53)
Client server : dove (135.252.160.51)
此NIS环境中没有配置slave server

配置具体步骤如下:

一、配置NIS主控服务器
1.
确认lion机上的/etc/hosts文件中有所有NIS服务器和客户机(此例中为lion、dove这两台机器)的配置:

lion:/] 4 # cat etc/hosts
#
# Internet host table
#
127.0.0.1       localhost
135.252.160.53  lion    loghost
135.252.160.51  dove
注:135.252.160.51  dove是添加到hosts里的。
2. 配置Makefile文件,定义NIS域名,创建相应的ASCII源文件,定义时间区域timezone
# domainname nisdomain
# domainname > /etc/defaultdomain
# cd /etc;touch ethers bootparams netgroup
# cat /etc/timezone
GMT+08:00       nisdomain
3.  
编辑/etc/auto_master文件,把+auto_master这行注释掉
4. 编辑/etc/auto_home文件,注释掉+auto_home这行,并加入自动挂接NIS服务器上的用户家目录配置
# cat /etc/auto_home
#+auto_home
*       lion:/export/home/&
5.配置NIS服务器,使/export/home目录成为共享资源
# cat /etc/dfs/dfstab-----------------------------------设置共享资源
share -d "home dirs" /export/home
6.检查NFS服务器端进程mountd和nfsd是否在运行
Solaris 9 # pgrep –xl mountd
Solaris 9 # pgrep –xl nfsd
Solaris10# svcs -a | grep nfs | egrep -e "server|client"
online         14:18:27
svc:/network/nfs/client:default
online         14:18:28 svc:/network/nfs/server:default
如果NFS服务器没在运行就开启它:
Solaris 9 # /etc/init.d/nfs.server start
        Solaris10# svcadm
enable nfs/server
7.
共享已设定的共享资源
# shareall
8.创建用户帐号usera,userb,userc,设定用户家目录位于/export/home目录下,并设定密码
# useradd -d /export/home/usera -m usera
# useradd -d /export/home/userb -m userb
# useradd -d /export/home/userc -m userc
# passwd usera
# passwd userb
# passwd userc
# grep user /etc/passwd-----------------修改/etc/passwd,把用户家目录改为位于/home目录,如下所示
usera:x:100:1::/home/usera:/bin/sh
userb:x:101:1::/home/userb:/bin/sh
userc:x:102:1::/home/userc:/bin/sh
9.复制NIS切换文件模版
# cd /etc;cp nsswitch.conf nsswitch.bak;cp nsswitch.nis nsswitch.conf   
10.设置lion成为NIS主控服务器(ypinit -m)
# ypinit -m
此处输出省略…>
        next host to add:  lion-----------------主控服务器
        next host to add:  ****-----------------辅助服务器 (此NIS环境中没有配置slave server)
         next host to
add:  ^D------------------------按CTRL+D组合键停止输入服务器列表
此处输出省略…>
Is this correct?  [y/n: y]  y
此处输出省略…>
Do you want this procedure to quit on non-fatal errors? [y/n: n]  n
此处输出省略…>
Building /var/yp/nisdomain/ypservers...
Running /var/yp /Makefile...
此处输出省略,正常的话可看到NIS制作地图的信息显示…>
lion has been set up as a yp master server without any errors.-------信息表明成功的成为主控服务器
If there are running slave yp servers, run yppush now for any data bases
which have been changed.  If there are no running slaves, run ypinit
on
those hosts which are to be slave servers.
11.确认NIS服务器守护进程已启动,如未启动用下面命令启动
Solaris 9 # /usr/lib/netsvc/yp/ypstart
Solaris 10# svcadm enable nis/server
12.确定本系统是NIS主控服务器
    # ypwhich -m
    audit_user lion
    user_attr lion
    输出省略…>
    输出的内容显示了NIS域提供的每一个地图的名字,以及控制这些地图的主控服务           器的名字
二、配置NIS客户端

1.        确认clusterc机上的/etc/hosts文件中有所有NIS服务器(此例中为lion、dove)的配置
2.        配置NIS域名
# domainname nisdomain
# domainname > /etc/defaultdomain
3.        配置dove机成为NIS客户机(ypinit -c)
# ypinit -c
        next host to add:  lion
        next host to add:  **** (此NIS环境中没有配置slave server)
        next host to add:  ^D
Is this correct?  [y/n: y]  y
4.        复制NIS名称切换文件模板
# cd /etc;cp nsswitch.conf nsswitch.bak;cp nsswitch.nis nsswitch.conf
5.        启动NIS客户端进程
Solaris 9 # /usr/lib/netsvc/yp/ypstart
starting NIS (YP server) services: ypserv ypbind done.
Solaris10# svcadm enable nis/client
6.        确定本机已经可以使用NIS
# ypwhich -m

               
               
               

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/25705/showart_432142.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP