Posts

Showing posts with the label OpenSolaris

[Level 3] Open HA Cluster on OpenSolaris in VirtualBox.

There is a article to introduce Open HA Cluster with OpenSolaris in VirtualBox. Please refer to Open HA Cluster On OpenSolaris . Wish this helps. regards, Stanley Huang

[Level 3] How to use DTrace to trace java in OpenSolaris

http://www.solarisinternals.com/wiki/index.php/DTrace_Topics_Java Wish this helps. regards, Stanley Huang Publish Post

[Level 3] ZFS Evil Tuning on OpenSolaris

I saw a good artical about ZFS tuning , the link as following: http://www.solarisinternals.com/wiki/index.php/ZFS_Evil_Tuning_Guide Wish this helps. regards, Stanley Huang

[Level 1] OpenSolaris is died?!

In these days, friends of mine asked about "Is OpenSolaris is died?". My answer is, "OpenSolaris" is died, but the spirit of "Open" "Solaris" is never die. Because some boarders of OpenSolaris, host a new project call " IllumOS ". If you like OpenSolaris, IllumOS might be your best choice. Wish this helps. regards, Stanley Huang

[Level 1] Install Cassandra on OpenSolaris

You can install Cassandra by following steps: # pfexec mkdir -p / var /lib/cassandra # pfexec mkdir -p / var /lib/cassandra/data # pfexec mkdir -p / var /lib/cassandra/commitlog # pfexec mkdir -p / var /lib/cassandra/logs # pfexec mkdir -p / var /log/cassandra # pfexec chown -R root:root / var /lib/cassandra / var /log/cassandra # pfexec chmod -R 755 / var /lib/cassandra Set user environment on ~/.bashrc export CASSANDRA_HOME=$HOME/cassandra/src export CASSANDRA_CONF=$HOME/cassandra/conf export CASSANDRA_PATH=$CASSANDRA_HOME/bin export PATH=$CASSANDRA_PATH:$PATH Then you have to download git (SUNWgit) from OpenSolaris repository to get Cassandra's source code. # pkg install SUNWgit Use git command as following to get the Cassandra's source: # cd ~/ ## change working directory to user home, because we set CASSANDRA_HOME directory in $HOME/cassandra # git clone git: //git.apache.org/cassandra.git src Select the 0.6.3 tag and create...

[Level 2] Setup OpenVPN in OpenSolaris

Down pkgutil from Blastwave: http://sourceforge.net/projects/pkgutil/ Prepare environment: # unzip ./pkgutil-2.0.zip # mkdir -p /var/opt/csw/ # ln -s `pwd` /var/opt/csw/ Install OpenVPN : # /opt/csw/bin/pkgutil -i tun tap # /opt/csw/bin/pkgutil -i openvpn Modify config: # cd  /etc/csw/openvpn # cp ./openvpn.conf.CSW ./openvpn.conf # vi ./openvpn.conf Setting vpn client:  client dev tun proto tcp remote vpn.server.hostname 1194 resolv-retry infinite nobind persist-key persist-tun ca ca.crt cert client1.crt key client1.key comp-lzo verb 3 Wish this helps.  regards,  Stanley Huang

[Level 2] Use mkisofs to backup your filesystem.

You can use mkisofs to backup your filesystem. # mkisofs --allow-lowercase --allow-multidot -r -o ./stanley.iso ./stanley # mount -F hsfs `pwd`/stanley.iso /tmp/t Wish this helps. regards, Stanley Huang

[Level 1] Install Django on OpenSolaris.

Use pkg command to install Django: # pfexec pkg set-authority -O http://pkg.opensolaris.org/webstack  # webstackpfexec pkg refresh  Launch Pkg Manager by downloading. # firefox http://pkg.opensolaris.org/webstack [search "Django"] [click "install"] Wish this helps. regards, Stanley Huang

[Level 3] Control Audio Device.

My laptop will always beep on while boot, and I cannot use the command "xset -b" to turn it off. On community friend( evereasy ) told me that I can use the command "audioctl" to control it. Then I wrote a sample script for it. #!/usr/bin/bash showUsage() {   cat < <EOF Usage:   $0 device [display]   $0 device control value Ex.   $0 $sSampleDevice   $0 $sSampleDevice beep 0 Device: `listDevice | sed -e 's/^/  /'` Control($sSampleDevice): `showControl $sSampleDevice | awk '{print($2)}' | tail +1 | sed -e 's/^/  /'` EOF } listDevice() {   #echo "audioctl list-devices ..."   audioctl list-devices } showDevice() {   #echo "audioctl show-devices ..."   sDevice=$1   audioctl show-device -v -d $sDevice } showControl() {   #echo "audioctl show-control ..."   sDevice=$1   audioctl show-control -v -d $sDevice } alias audioctl='/usr/bin/audioctl' sSampleDevice=`listDevi...

[Level 1] How to check the interface is link up or down in OpenSolaris?

Before, I always got the question "How to check the interface is link up or donw?". Now, you can use the command 'dlamd' with option 'show-link' to check it. # dladm show-link LINK        CLASS     MTU    STATE    BRIDGE     OVER iwh0        phys      1500   down     --         -- bge0        phys      1500   up       --         -- vboxnet0    phys      1500   unknown  --         -- Wish this helps. regards, Stanley Huang

[Level 2] Install firefox plugin "flash player" on OpenSolaris

When I use OpenSolaris b130. I download the flash player from adobe website, and put the library file to the "plugins" folder of firefox, but firefox still cannot display flash content well. So how can we install flash player on OpenSolaris? You can install it from extra repository. extra repository=> https://pkg.sun.com/opensolaris/extra/ pkg name=> firefox/plugin/flashplayer After install it, then you can see it works. Wish this helps. regards, Stanley Huang

[Level 3] Setting Local Repository.

Days ago, I am the speaker of Sun campus seminar,  my subject of the session is the OpenSolaris new feature. Because I have to demo how to install package by package manager, and I'm afraid that the school cannot provide my laptop to surve the net. I decided to setup the local repository on my laptop. The following script is the local repository setup script, please refer to it. regards, Stanley Huang #!/usr/bin/bash clear set -f ## noglob fRepoISO=/Karajon/ISOs/osol-repo-0906-full.iso dMP=/mnt/repo && pfexec mkdir -p $dMP fsRepo=rpool/repo && pfexec zfs create -o compression=on $fsRepo 2>/dev/null dRepo=`zfs get -H mountpoint $fsRepo | awk '{print($3)}'` sHost=192.168.1.100 sHostname=stanley-nb nPort=81 sIF=yge0:1 fBackupPublisher=/PkgPublisher.bak cat < Repository Full ISO Image    : $fRepoISO Iso Image Mount Point        : $dMP Repository ZFS File System   : $fsRepo Re...

[Level 2] Distribution Constructor

What is distribution constructor? It is the tool for user to customize OpenSolaris image. How to create a customize OpenSolaris image, the step as the following: 1. modify the manifest file. # vi /usr/share/distro_const/slim_cd/slime_cd_x86.xml 2. display distribution list. # distro_const build -l /usr/share/distro_const/slim_cd/slime_cd_x86.xml Step           Resumable Description -------------- --------- ------------- im-pop                   Populate the image with packages im-mod                   Image area modifications slim-im-mod              Slim CD Image area Modifications ba-init                  Boot...

[Level 3] The script for demo creating mass zones on OpenSolaris

Days ago, my colleague will demo about the virtualization techniques on OpenSolari. So I share the script for him to demo fast creating zones on OpenSolaris. After test, my lap will create a zone per 3 seconds. That impress him, and he decided to demo on that session. The same script that I'd like to share to you, please refer the following script code. Any question, and suggestion, please feel free to let me know. #!/usr/bin/bash showUsage() {   cat< <EOF Usage:   $0 [c]reate  [original index] [start index] [end index]   $0 [d]estroy [start index]    [end index]   [always yes]   $0 [l]ist Ex.   $0 c 1 2 10   => create  zone2, zone3, ... ,zone10   $0 c 1 3 8    => create  zone3, zone4, ... ,zone8   $0 d 2 10 [F] => destroy zone2, zone3, ... ,zone10   $0 l PS.   for solaris 11 only   all indexes must greater then 1, less then 255 Zones: ...

[Leve 1] Use usb to com to connect SPARC machine in OpenSolaris.

Today, I try to use my colleage's usb to com cable, to connect SPARC machine. 1. check /dev/term folder first. # ls -al /dev/term total 8 drwxr-xr-x   2 root root   2 2009-11-10 18:20 . drwxr-xr-x 252 root sys  252 2009-11-10 18:20 .. 2. connect cable then try again. # ls -al /dev/term total 9 drwxr-xr-x   3 root root   3 2009-11-10 18:00 . drwxr-xr-x 253 root sys  253 2009-11-10 18:00 .. lrwxrwxrwx   1 root root  48 2009-11-10 18:00 0 -> ../../devices/pci@0,0/pci1043,8263@1d/device@1:0 3. use tip command to connect SPRAC machine. PS. you have to set baud rate to 9600. # tip -9600 /dev/term/0 4. Start the SPARC machine then you will get the console. Wish this helps. regards, Stanley Huang

[Level 3] Clone multi-server on VirtualBox guest by ZFS clone.

How to save your disk space while you need multi VirtualBox guest? You can use ZFS clone to clone ZFS filesystem. But while you import the vdi, you willgot an error message with duplicated disk uuid. So you need to modify the disk uuid by command VBoxManage. The complete steps as the following: 1. create zfs pool for VirtualBox VDI. # zpool create vdiPool c1t0d0s0; # default folder is /vdiPool 2. create zfs filesystem for Source VDI. # zfs create vdiPool/vdiSource; # default folder is /vdiPool/vdiSource 3. create VirtualBox guest, and create vdi on /vdiPool/vdiSource/OpenSolaris.vdi 4. clone vdi source # zfs snapshot vdiPool/vdiSource@installed # zfs clone vdiPool/vdiSource@installed vdiPool/vdiTarget1 # VBoxManage internalcommands setvdiuuid /vdiPool/vdiTarget1/OpenSolaris.vdi Wish this helps. regards, Stanley Huang

chm reader in OpenSolaris

If you want to install chm reader on OpenSolaris, you can install xchm from Blastwave repository. Wish this helps. regards, Stanley Huang

[Level 3] Solaris 10 Technical Conference ( 2009/10/25,11/13,12/4 ) -- Advanced ZFS hands-on lab

The following is my lab file, please refer to it.  Wish this helps. regards, Stanley Huang **************************************************************************************************** The purpose of this lab is to let you have advanced ZFS filesystem administration skill. And then you will have the following capabilities. Lab 1: * replace zpool disk. Lab 2: * take ZFS filesystem snapshot, rollback ZFS filesystem. * clone ZFS filesystem. Lab 3: * use ZFS L2ARC * use ZFS ZIL Lab 1: 1. replace zpool disk. # cd /labs/ZFS/files; # zpool create mypool mirror `pwd`/f1 `pwd`/f2 spare `pwd`/f3; # zpool replace mypool `pwd`/f2 `pwd`/f3; # zpool status mypool; -------------------------------------------------------------------------------   pool: mypool  state: ONLINE  scrub: resilver completed after 0h0m with 0 errors on Sun Oct 18 11:13:15 2009 config:     NAME          ...

[Level 2] Solaris 10 Technical Conference ( 2009/10/25,11/13,12/4 ) -- Basic ZFS hands-on lab

The following is my lab file, please refer to it.  Wish this helps. regards, Stanley Huang **************************************************************************************************** The purpose of this lab is to let you have basic ZFS administration skill. And then you will have the following capabilities. Lab 1: * create ZFS pool. * check ZFS pool status. * set ZFS pool properties. * destroy ZFS pool. Lab 2: * create ZFS filesystem. * check ZFS filesystem status. * set ZFS filesystem properties. * destroy ZFS filesystem. Lab 1: 1. prepare files with command mkfile. # mkdir -p /labs/ZFS/files; # cd /labs/ZFS/files; # mkfile 128m f1 f2 f3 f4 f5 f6 f7 f8 f9; 2. create ZFS pool. # zpool create mypool mirror `pwd`/f1 `pwd`/f2 spare `pwd`/f3; # zpool create myraidz raidz `pwd`/f4 `pwd`/f5 `pwd`/f6 spare `pwd`/f7; 3. list ZFS pools, and check pool status. # zpool list; --------------------------------------------------- # zpool list mypool...

[Level 2] Solaris 10 Technical Conference ( 2009/10/25,11/13,12/4 ) -- Basic DTrace hands-on lab

The following is my lab file, please refer to it.  Wish this helps. regards, Stanley Huang **************************************************************************************************** The purpose of this lab is to let you have basic DTrace skill. And then you will have the following capabilities. Lab 1: * know dtrace probes. * use dtrace tool kits to monitor your system. * download dtrace tool kits. * write your first D-script. 1. list dtrace probes. # dtrace -l; 2. list demo dtrace tools # cd /usr/demo/dtrace; # ls -l *.d; ------------------------------------------------------------------ -rw-r--r--   1 root     bin         1677  5月 14 23:52 applicat.d -rw-r--r--   1 root     bin         1699  5月 14 23:52 badopen.d -rw-r--r--   1 root     bin     ...