星期五 二月 13, 2009
DIY your OpenStorage device and configuration (steps)
- Configuration of OS
Once you have installed your opensolaris you can login the gnome desktop. However, it is better to access your server via INTERNET, the following steps are talking about configuring ip staff into your opensolaris server.
- get root privilege
#pfexec su -
- configure hostname <-> ip map
vi /etc/hosts 129.158.144.242 opensolaris localhost loghost
- configure ip address for rge0 Ethernet card
vi /etc/hostname.rge0 129.158.144.242
- configure default route ip (gateway)
vi /etc/defaultrouter 129.158.144.254
- configure dns server ip
vi /etc/resolve.conf 129.158.144.1
- Provision ZFS file-system
- get root privilege
pfexec su -
- find all disks
# format AVAILABLE DISK SELECTIONS: 0. c0t0d0 <ATA-WDC WD10EADS-00L-1A01-931.51GB> /pci@0,0/pci8086,244e@1e/pci1095,7124@0/disk@0,0 1. c0t1d0 <ATA-WDC WD10EADS-00L-1A01-931.51GB> /pci@0,0/pci8086,244e@1e/pci1095,7124@0/disk@1,0 2. c0t2d0 <ATA-WDC WD10EADS-00L-1A01-931.51GB> /pci@0,0/pci8086,244e@1e/pci1095,7124@0/disk@2,0 3. c0t3d0 <ATA-WDC WD10EADS-00L-1A01-931.51GB> /pci@0,0/pci8086,244e@1e/pci1095,7124@0/disk@3,0 4. c4d0 <DEFAULT cyl 2429 alt 2 hd 255 sec 63> /pci@0,0/pci-ide@1f,1/ide@0/cmdk@0,0
- create RAID-Z zpool (I will talk about RAID-Z zpool later)
# zpool create dpool raidz c0t0d0 c0t1d0 c0t2d0 c0t3d0
- monitor zpool status
# zpool list
NAME SIZE USED AVAIL CAP HEALTH ALTROOT
dpool 3.62T 132K 3.62T 0% ONLINE -
# zpool status dpool pool: dpool state: ONLINE scrub: none requested config:
NAME STATE READ WRITE CKSUM dpool ONLINE 0 0 0 raidz1 ONLINE 0 0 0 c0t0d0 ONLINE 0 0 0 c0t1d0 ONLINE 0 0 0 c0t2d0 ONLINE 0 0 0 c0t3d0 ONLINE 0 0 0
errors: No known data errors
- Perform hot-plug
Hot-plug is very import for a storage device. If one disk failed, we can just remove it on a live system without stopping any services.
- show disk status
# cfgadm -al Ap_Id Type Receptacle Occupant Condition ... sata4/3::dsk/c0t3d0 disk connected configured ok
- offline from zpool
# zpool offline dpool c0t3d0
- unconfigure this disk
# cfgadm -c unconfigure sata4/3 ... Continue (yes/no)? y # cfgadm -al Ap_Id Type Receptacle Occupant Condition ... sata4/3 disk connected unconfigured ok
- unplug this disk from the chassis/slot
- plug a good disk into the same chassis/slot
- configure this disk
# cfgadm -al Ap_Id Type Receptacle Occupant Condition ... sata4/3 disk connected unconfigured ok
# cfgadm -c configure sata4/3 # cfgadm -al Ap_Id Type Receptacle Occupant Condition ... sata4/3::dsk/c0t3d0 disk connected configured ok
- clear any warning messages of zpool
# zpool clear dpool
# zpool status dpool
Useful Tips:
- sometimes you forget to unconfigure and offline a faulted disk and unplug it out, the status on OS sytem is in-sync. The sata framework on Solaris can not re-prevision the sata disk automatically, however we can manually trigger the re-prevision.
# cfgadm -c disconnect sata4/3 # cfgadm -c connect sata4/3 # cfgadm -c configure sata4/3 # zpool status dpool
- Install storage services
Once all above is done, the system is ready for becoming any type of storage, including NFS server, NAS storage, SMB server, FC storage, ... Storage software packages are not installed by default, please run the following commands:
- NAS storage: install iscsi target package
pfexec pkg install SUNWiscsit
- SMB sevices: install smb packages
pfexec pkg install SUNWsmbs pfexec pkg install SUNWsmbskr
- NFS is installed by default
- FC storage: install comstar package
stay tuned, will coming soon...
- Start SMB Services
- Enable services
svcadm enable -r smb/server svcs|grep smb
- Share folder to smb services
zfs create -o sharesmb=on dpool/smb
- Trouble shooting of smb service on Solaris
Well, :), there are some tips for that, you have to manually configure some thing, it is Unix ... #$%#$%^%$^
- config pam for user authentication
vi /etc/pam.conf other password required pam_smb_passwd.so.1 nowarn
- there are 2 types of smb services in Solaris
- svcadm enable smb/server
- /usr/sfw/sbin/smbd -D
- customize smb conf if you want to share folder
cp /etc/sfw/smb.conf-example /etc/sfw/smb.conf
vi /etc/sfw/smb.conf
Note: Usually we use the 2.2 way to enable smb server, which can allow all windows user to use the same folder. If you really care about security (I hit security ;) ), use the 2.1 way to enable smb services.
Posted at
10:48下午 二月 13, 2009
by ydzhang in Sun |
|
|
| 归档 |
|
|
| « 十一月 2009 | | 星期日 | 星期一 | 星期二 | 星期三 | 星期四 | 星期五 | 星期六 |
|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | | | | | | | | | | | | | | | 今天 |
|
|
|
|
|
|
| 链接 |
|
|
|
|
|
| 引用 |
|
|
|
今日点击: 30
|
|
|
|
|
|