闲来无事,开始折腾Solaris的机器,虚拟化一直是作为之后几年的首要卖点,当然啊了,从整体的应用角度而言,确实是这样。 越来越多的end-user开始自己安装或者通过老外的requirement开始进行zone的deploy,目前手上就遇到大概2个case. 而且在过一段时间,等ip address assignment结束,还有一个case也将开始使用zone.
早先在CSS team里其实接触过zone,但是更多的表现是已webzone的方式使用的,完全不知道是何物。今天初装,有半天领悟。
#zonecfg -z yourzonename
#zonecfg:yourzonename> create -b
set zonepath=/local/zones/yourzonename
set autoboot=true
add fs
set dir=/app --->做这个之前确保是localdisk而不是nfs。
set special=/app
set type=lofs
add options rw
add options nodevices
end
add fs
set dir=/env
set special=/env
set type=lofs
add options rw
add options nodevices
end
add fs
set dir=/etc/home
set special=/etc/home
set type=lofs
add options rw
add options nodevices
end
add net
set address=137.58.166.216/24 --->确保你有IP,而非DHCP。netmask是跟着主机的netmask走的. 之后在里面设置会导致报错。
set physical=bge0
set defrouter=137.58.166.1 -->取保你的router是走的通的,跟主机保持一致。
end
add attr
set name=machine
set type=string
set value=sun4u
end
set
add capped-cpu --->cpu
set ncpus=1
add capped-memory -->memory
set physical=2048m
set swap=2048m
end
commit
exit
set autoboot=true
add fs
set dir=/app --->做这个之前确保是localdisk而不是nfs。
set special=/app
set type=lofs
add options rw
add options nodevices
end
add fs
set dir=/env
set special=/env
set type=lofs
add options rw
add options nodevices
end
add fs
set dir=/etc/home
set special=/etc/home
set type=lofs
add options rw
add options nodevices
end
add net
set address=137.58.166.216/24 --->确保你有IP,而非DHCP。netmask是跟着主机的netmask走的. 之后在里面设置会导致报错。
set physical=bge0
set defrouter=137.58.166.1 -->取保你的router是走的通的,跟主机保持一致。
end
add attr
set name=machine
set type=string
set value=sun4u
end
set
add capped-cpu --->cpu
set ncpus=1
add capped-memory -->memory
set physical=2048m
set swap=2048m
end
commit
exit
如果实在记不住,可以考虑使用help查看,而且每次set后也可以查看。
#/usr/sbin/zoneadm list -civ
ID NAME STATUS PATH BRAND
IP
0 global running / native
shared
- yourzonename configured /local/zones/yourzonename native
shared
ID NAME STATUS PATH BRAND
IP
0 global running / native
shared
- yourzonename configured /local/zones/yourzonename native
shared
#zoneadm -z yourzonename install
#zoneadm -z yourzonename boot
#zlogin -C -z yourzonename -->这点很好重要,之前我有很多服务没起来,是因为忽视掉了这一步。用console登录后还有些配置,已经机器的完成启动。
--
Alex Tu
-----------------------------------------------------------
ShangHai,China
评论