一、
Sun
发展简史
(本节不作学习要求)
(一)硬件体系
·
81--89 Sun1/2/3 CISC Motrala 680x0系列
·
89--94 Sun4/60 sparc1 Risc sparc: 65 sparc1+ ; 70 sparc2; Server : Sun/290/670/690
·
93--96 Sparc10/20 SuperSparc: Server : 1000/2000
·
96--97 Solaris-test1(140/170/170E/200E)
o
Solaris-testSparc SBUS体系结构,UPA接口
o
Solaris-test2
o
Server : E150,E3000
·
98--99 Solaris-test5 ,Solaris-test10 PCI体系结构 (IDE外设)
o
Solaris-test30,Solaris-test60
o
Server : E250,E450,E3500
·
00-04 …..
(二)软件体系
·
Solaris 1.x SunOS 4.1.3+OpenWindow 1.x BSD
·
Solaris 2.x System V 32bit
·
2.5.1 SunOS 5.5.1 +OpenWindows
·
2.6 SunOS5.6+CDE1.2
·
Solaris 2.7(7) 64 bit
·
Solaris 5.8 (Solaris 8)
·
Solaris 10
二、
PROM
状态命令与参数
(本节不作学习要求)
(一)指令集
格式: OK> 指令
1.banner 显示当前机器配置状况,CPU,内存,hostid,EtherNet
2.probe-scsi 显示内部SCSI通道所挂接设备
3.probe-scsi-all 显示所有SCSI通道及所挂接设备
4.probe-ide 显示所有IDE通道及所挂接设备(针对U10,U5) probe-fcal-all
5.devalias 显示设备别名,如 cdrom,disk,disk0,disk1等
6.printenv 无参数,显示环境变量或参数为环境变量名 如: printenv auto-boot?
7.setenv 设置环境变量,如: setenv auto-boot? false
8.set-default 恢复环境变量预定值 如:set-default auto-boot?
9.set-defaults 恢复所有环境变量预定值
10.boot device [option] 启动主机
device :设备别名,如:cdrom,disk,net 或直接设备名。如:Solaris-test60 外置CDROM/pci@1f,4000/scsi@3,1/disk@6,0:f
option : -r 系统重新配置 -s 启动单用户环境
如,捷迅的Unix系统都是从网络来安装的,我们在运行进用如下命令即可:
1.banner 显示当前机器配置状况,CPU,内存,hostid,EtherNet
2.probe-scsi 显示内部SCSI通道所挂接设备
3.probe-scsi-all 显示所有SCSI通道及所挂接设备
4.probe-ide 显示所有IDE通道及所挂接设备(针对U10,U5) probe-fcal-all
5.devalias 显示设备别名,如 cdrom,disk,disk0,disk1等
6.printenv 无参数,显示环境变量或参数为环境变量名 如: printenv auto-boot?
7.setenv 设置环境变量,如: setenv auto-boot? false
8.set-default 恢复环境变量预定值 如:set-default auto-boot?
9.set-defaults 恢复所有环境变量预定值
10.boot device [option] 启动主机
device :设备别名,如:cdrom,disk,net 或直接设备名。如:Solaris-test60 外置CDROM/pci@1f,4000/scsi@3,1/disk@6,0:f
option : -r 系统重新配置 -s 启动单用户环境
如,捷迅的Unix系统都是从网络来安装的,我们在运行进用如下命令即可:
boot net
11.eject [cdrom|floppy] 弹出cdrom或floppy
12.reset 复位
12.reset 复位
(二)环境变量
·
1.auto-boot? 预定值=true 自动启动 =false 进入PROM状态
·
2.diag-switch? 预定值=false 启动状态,启动设备名为boot-device =true 诊断状态,启动设备名为diag-device
·
3.boot-device 预定值=disk
·
4.diag-device 预定值=net
·
5.tpe-link-test? 网络检测 =true 检测网络(一部分机器具有此变量)
三、系统安装
(本节不作学习要求,主要是我的安装和配置的经验,仅供对Solars系统安装和配置感兴趣的同事参考)
(一)
系统配置步骤
主机名 luhua
网络连接(y/n) y
IP地址 172.16.12.121
命名服务 agile.agilesoft.com
子网(y/n) y
地理,时区 PRC
时间
网络连接(y/n) y
IP地址 172.16.12.121
命名服务 agile.agilesoft.com
子网(y/n) y
地理,时区 PRC
时间
(二)
系统安装步骤
系统安装 初始化
软件安装 完全
硬盘分区 手动,用户化
软件安装 完全
硬盘分区 手动,用户化
/ 4000
swap 300
backup 4300
swap 300
backup 4300
(
三)安装
Solaris
之后的
9
个主要的设置
1. 下载并安装最新的补丁
e.g.
ftp://sunsolve.sun.com/pub/patches/
8_Recommended.zip
J2SE_Solaris_8_Recommended.zip
安装补丁前,kill dtlogin 和inetd进程,以确保没有人登录进系统。安装后重启系统。
2. 设置路由: vi /etc/defaultrouter, add the default gateway to the file.
e.g.
ftp://sunsolve.sun.com/pub/patches/
8_Recommended.zip
J2SE_Solaris_8_Recommended.zip
安装补丁前,kill dtlogin 和inetd进程,以确保没有人登录进系统。安装后重启系统。
2. 设置路由: vi /etc/defaultrouter, add the default gateway to the file.
# cat /etc/defaultrouter
10.6.2.1
10.6.2.1
3. 设置DNS:vi /etc/resolv.conf
# cat /etc/resolv.conf
nameserver 10.6.2.15
nameserver 10.0.13.11
search sz.mydomain.com abcd.mydomain.com mydomain.com abcd.com
nameserver 10.6.2.15
nameserver 10.0.13.11
search sz.mydomain.com abcd.mydomain.com mydomain.com abcd.com
4. vi /etc/nsswitch.conf 在hosts:file 后,加上dns, e.g.
# cat /etc/nsswitch.conf
hosts: files dns
......
hosts: files dns
......
5. 把管理域的域名加到 /etc/defaultdomain中。 e.g.
# cat /etc/defaultdomain
abcd.sz
abcd.sz
注意:这个域名与主机的DNS域名是两个概念。这是基于管理的需要而设,与实际DNS可不相同。
6. vi /etc/hosts
# cat /etc/hosts
#
# Internet host table
#
127.0.0.1 localhost
10.6.3.191 admin
#
10.6.3.192 db1
10.6.3.193 app1
10.0.13.5 loghost
#
# Internet host table
#
127.0.0.1 localhost
10.6.3.191 admin
#
10.6.3.192 db1
10.6.3.193 app1
10.0.13.5 loghost
7. 为man建立index,这样就可用man -k搜索。
catman -w
8. 建立一个管理用户作为远程登录,用su来管理
# user add -s /usr/bin/bash -d /export/home/admin -m admin
# passwd admin
# passwd admin
9. 下载并安装Sudo
请参考:
http://www.chinaunix.net/bbsjh/3/10466.html
实际工作中,这是很有用的:不必告诉有特殊需要的普通用户关的Root的帐号,但给他权限。Sudo的操作是有记录可查的,可将log放到远程的log服务器中。[
请参考:
http://www.chinaunix.net/bbsjh/3/10466.html
实际工作中,这是很有用的:不必告诉有特殊需要的普通用户关的Root的帐号,但给他权限。Sudo的操作是有记录可查的,可将log放到远程的log服务器中。[
(四)、安装
Solaris
之后
NFS
安装和配置
NFS
服务器
(
被共享
)
1.启动服务
/etc/rc3.d/S15nfs.server start
2:共享目录
vi /etc/dfs/dfstab
e.g.
# hostname admin
# cat /etc/dfs/dfstab
share -F nfs -o ro=db1:app1:app2:app3:app4,anon=0 /usr/js
share -F nfs -o rw=db1:app1:app2:app3:app4,nosuid /home
# cat /etc/dfs/dfstab
share -F nfs -o ro=db1:app1:app2:app3:app4,anon=0 /usr/js
share -F nfs -o rw=db1:app1:app2:app3:app4,nosuid /home
3. 诊断
查看服务器的已共享资源 dfshares
查看共享资源被利用的状况 dfmounts
查看服务器的已共享资源 dfshares
查看共享资源被利用的状况 dfmounts
NFS
客户端
(
使用共享
)
1.启动服务
/usr/lib/nfs/statd
2. 运行mount , e.g.
app4# mount admin:/home /home
3. 开机自动mount
vi /etc/vfstab, 加入新的一行启动mount配置:
e.g
vi /etc/vfstab, 加入新的一行启动mount配置:
e.g
app4:~% cat /etc/vfstab
#device device mount FS fsck mount mount
admin:/home - /home nfs - yes -
.....
#device device mount FS fsck mount mount
admin:/home - /home nfs - yes -
.....
这样,开机后,系统自动将admin:/home目录 mount 到app4的/home目录.
关于Linux的NFS与Solaris不同点:
1. Solaris的目录共享设置文件是/etc/dfs/dfstab, 而RadHat Linux共享目录设置文件是/etc/exports
2. Solaris开机自动mount设置文件是/etc/vfstab, 而RadHat Linux开机自动mount设置文件是/etc/fstab
关于Linux的NFS与Solaris不同点:
1. Solaris的目录共享设置文件是/etc/dfs/dfstab, 而RadHat Linux共享目录设置文件是/etc/exports
2. Solaris开机自动mount设置文件是/etc/vfstab, 而RadHat Linux开机自动mount设置文件是/etc/fstab
(五)、安装
Solaris
之后
NIS
安装和配置
Server
1. /etc/nsswitch.conf
e.g.
e.g.
# cat /etc/nsswitch.conf
passwd: files nis
group: files nis
netgroup: files nis
...
passwd: files nis
group: files nis
netgroup: files nis
...
2. vi /etc/defaultdomain
e.g.
# cat /etc/defaultdomain
agile.sz
agile.sz
注意:这个域名与主机的DNS域名是两个概念。这是基于管理的需要而设,与实际DNS可不相同。
3. /var/yp/Makefile
4. ypinit -m
5. 启动 /usr/lib/netsvc/yp/ypstart
6. 诊断
ypcat hosts
ypcat passwd
yp which -m
3. /var/yp/Makefile
4. ypinit -m
5. 启动 /usr/lib/netsvc/yp/ypstart
6. 诊断
ypcat hosts
ypcat passwd
yp which -m
Client
1. /etc/nsswitch.conf
e.g.
e.g.
# cat /etc/nsswitch.conf
passwd: files nis
group: files nis
netgroup: files nis
...
passwd: files nis
group: files nis
netgroup: files nis
...
2./etc/hosts
#app4:~% cat /etc/hosts
10.6.3.197 app4.sz
10.6.3.191 admin
10.6.3.197 app4.sz
10.6.3.191 admin
3. /etc/defaultdomain
#app4:~% cat /etc/defaultdomain
agile.sz
agile.sz
注意:要与Server的设置相同。
4. ypinit -c
5./usr/lib/netSvc/yp.ypstart
根据所示,输入NIS Server的hostame:ad
5./usr/lib/netSvc/yp.ypstart
根据所示,输入NIS Server的hostame:ad