来来的爸爸不睡觉

no-sleep Lailai's father
星期五 二月 13, 2009

DIY your OpenStorage device and configuration (steps)

  1. 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.
    1. get root privilege
      #pfexec su -
    2. configure hostname <-> ip map
      vi /etc/hosts
      129.158.144.242 opensolaris localhost loghost
    3. configure ip address for rge0 Ethernet card
      vi /etc/hostname.rge0
      129.158.144.242
    4. configure default route ip (gateway)
      vi /etc/defaultrouter
      129.158.144.254
    5. configure dns server ip
      vi /etc/resolve.conf
      129.158.144.1


  2. Provision ZFS file-system
    1. get root privilege
      pfexec su -
    2. 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
    3. create RAID-Z zpool (I will talk about RAID-Z zpool later)
      # zpool create dpool raidz c0t0d0 c0t1d0 c0t2d0 c0t3d0
    4. 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



  3. 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.
    1. show disk status
      # cfgadm -al
      Ap_Id                          Type         Receptacle   Occupant     Condition
      ...
      sata4/3::dsk/c0t3d0            disk         connected    configured   ok
    2. offline from zpool
      # zpool offline dpool c0t3d0
    3. 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
    4. unplug this disk from the chassis/slot
    5. plug a good disk into the same chassis/slot
    6. 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
    7. clear any warning messages of zpool
      # zpool clear dpool

      # zpool status dpool


      Useful Tips:
      1. 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



  4. 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:
    1. NAS storage: install iscsi target package
      pfexec pkg install SUNWiscsit
    2. SMB sevices: install smb packages
      pfexec pkg install SUNWsmbs
      pfexec pkg install SUNWsmbskr
    3. NFS is installed by default
    4. FC storage: install comstar package
      stay tuned, will coming soon...



  5. Start SMB Services
    1. Enable services
      svcadm enable -r smb/server
      svcs|grep smb
    2. Share folder to smb services
      zfs create -o sharesmb=on dpool/smb
    3. Trouble shooting of smb service on Solaris
      Well, :), there are some tips for that, you have to manually configure some thing, it is Unix ... #$%#$%^%$^
      1. config pam for user authentication
        vi /etc/pam.conf
        other   password required       pam_smb_passwd.so.1     nowarn
      2. there are 2 types of smb services in Solaris
        1. svcadm enable smb/server
        2. /usr/sfw/sbin/smbd -D
      3. 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.

评论:

发表一条评论:
  • HTML语法: 禁用

归档
链接
引用