Archive for the ‘Sun’ Category

Here is the one-stop resource page, with an install-less compatibility check tool and a live-cd check tool. Want a second opinion, here is a review.

A colleague shared this howto that he found on Google. I was able to look up and found a source of this howto. This looks a bit more complete than other ones that I saw.

I have been getting several Sun Cluster inquiries from people recently. So, here is a quick intro with links to lots of resources:

Sun Cluster is Sun’s clustering technology that can bring high availability to your applications or you can extend it to fit your high availability needs.. Since it’s free to download, you can install it on a single physical machine with multiple cluster nodes in different zones in Solaris 10 for testing purpose. You can also install it on at least 16-nodes to make your application both fault tolerant and scaling. Before you ask further questions, make sure you have read the documentation.

Here are lots of pictures from JavaOne 2007: Day 1, Day 2, Day 3, Day 4.

Rather than following my long howto, I’ve written a script to automate much of the work. You still need to follow the manual hand edits stated in step 5 of the howto. For debug build, follow the instructions stated in this howto. Below are the environment variable file and build script file that I used to make a debug build of R / HDF5. You should change environment variables in bash.profile to fit your environment. This script assumes the following directory structure:

./bash.profile
./makeall.sh
./src/[R_SRC]
./src/[NCSA_HDF5_SRC]
./src/[R_HDF5_SRC]
./src/[SZIP_SRC]

NOTE: This script is provides AS-IS without any guarantee. Although the author tested this script in his own environment, it may or may not work in all environments. Since the source is provided, the author expect you to carefully exam the code prior to execution, which will enable you to become aware of potential risks. By running this script, you agree not to hold the author liable for anything that may happen as result of running this script.

bash.profile

export LANG=en_US
export LC_ALL=en_US
export LC_MESSAGES=en_US
export BASE_DIR=/export
export STUDIO_DIR=/opt/studio11/SUNWspro
export R_VER=R-2.5.0
export HDF5_VER=hdf5-1.6.5
export SZIP_VER=szip-2.0
export CC="${STUDIO_DIR}/bin/cc -g"
export CXX="${STUDIO_DIR}/bin/CC -g"
export F77="${STUDIO_DIR}/bin/f77 -g"
export CFLAGS="-xtarget=opteron -I${BASE_DIR}/build/hdf5-1.6.5/include -DH5_USING_PURIFY"
export CXXFLAGS="-xtarget=opteron"
export FFLAGS="-xtarget=opteron"
export FCFLAGS="-xtarget=opteron"
export LDFLAGS="-xtarget=opteron -L/usr/lib -L/opt/csw/lib"
export PATH=${STUDIO_DIR}/bin:/usr/ccs/bin:/usr/dt/bin:/usr/xpg4/bin:/usr/bin:/opt/csw/bin:/usr/sfw/bin
export R_HOME=${BASE_DIR}/build/${R_VER}
export HDF5_HOME=${BASE_DIR}/build/${HDF5_VER}
export SZIP_HOME=${BASE_DIR}/build/${SZIP_VER}
export LD_LIBRARY_PATH=/opt/csw/lib:/usr/lib:/usr/local/lib:/usr/sfw/lib:${R_HOME}/lib:${HDF5_HOME}/lib:${SZIP_HOME}/lib

makeall.sh

#!/usr/bin/bash --debug

# Initialize env variables
source ./bash.profile
DEBUG=0
POINTER="buildszip"

# Set debug mode to 1 or 0
# Debug mode will cause the script to pause after each make intall
# to enable the user to double check if each modeule was built correctly
# Souce: http://tldp.org/LDP/abs/html/testbranch.html#ISALPHA
while [ $# -gt 0 ]; do    # Until you run out of parameters . . .
  case "$1" in
    -d|--debug)
              # "-d" or "--debug" parameter?
              DEBUG=1
              ;;
# Reserved for future use
#    -c|--conf)
#              CONFFILE="$2"
#              shift
#              if [ ! -f $CONFFILE ]; then
#                echo "Error: Supplied file doesn't exist!"
#                exit $E_CONFFILE     # File not found error.
#              fi
#              ;;
  esac
  shift       # Check next set of parameters.
done

tocontinueornot()
{
  if [ ${DEBUG} = 1 ]; then
    echo "So far so good? [y/n/r]"
    read TOCONTINUE
    case "${TOCONTINUE}" in
      "y" | "Y" | "Yes" | "YES" | "yes" )
        echo "Continue to the next step."
        ;;
      "n" | "N" | "No" | "NO" | "no" )
        echo "Exiting."
        exit 0
        ;;
      "r" | "R" | "retry" | "Retry" | "RETRY" )
        echo "Attempting to rerun for this module."
        case "$POINTER" in
          "buildszip" ) buildszip;;
          "buildncsahdf5" ) buildncsahdf5;;
          "configurerhdf5" ) configurerhdf5;;
          "buildr" ) buildr;;
          "installrhdf5" ) installrhdf5;;
        esac
        ;;
      esac
  fi
}

buildszip()
{
  echo "=============================================================="
  echo "Building SZip"
  echo "=============================================================="
  cd ${BASE_DIR}/src/${SZIP_VER}
  make clean
  ./configure --prefix=${SZIP_HOME}
  make
  make check
  make install
  POINTER="buildszip"
  tocontinueornot
}

buildncsahdf5()
{
  echo "=============================================================="
  echo "Building NCSA HDF5 Library"
  echo "=============================================================="
  cd ${BASE_DIR}/src/${HDF5_VER}
  make clean
  #./configure --disable-shared --enable-debug --disable-production --with-zlib=/usr --with-szlib=${SZIP_HOME}  --prefix=${HDF5_HOME} --enable-cxx
  ./configure --enable-debug --disable-production --with-zlib=/usr --with-szlib=${SZIP_HOME}  --prefix=${HDF5_HOME} --enable-cxx
  make
  make check
  make install
  POINTER="buildncsahdf5"
  tocontinueornot
}

configurerhdf5()
{
  echo "=============================================================="
  echo "Configure R HDF5"
  echo "Note: This script assumes you already tweaked the configure"
  echo "script according to the instructions poted at"
  echo "http://vegdave.wordpress.com/2006/12/02/builld-project-r-with-hdf5-on-solaris-10-x64-in-32bit/"
  echo "=============================================================="
  cd ${BASE_DIR}/src/hdf5
  ./configure --with-hdf5=${HDF5_HOME}  --with-zlib=/usr
  echo "Output the last line of config.log. Note: you should see exit 0"
  tail -1 config.log
  POINTER="configurerhdf5"
  tocontinueornot
}

buildr()
{
  echo "=============================================================="
  echo "Build R"
  echo "=============================================================="
  cd ${BASE_DIR}/src/${R_VER}
  make clean
  ./configure --prefix=${R_HOME} --with-x=no
  make
  make check
  make install
  POINTER="buildr"
  tocontinueornot
}

installrhdf5()
{
  cd ${R_HOME}/lib/R/bin
  ./R CMD INSTALL ${BASE_DIR}/src/hdf5
  POINTER="installrhdf5"
  tocontinueornot
}

# call each function to build/configure each module
buildszip
buildncsahdf5
configurerhdf5
buildr
installrhdf5

CommunityOne is a mini conference on the day before JavaOne. Here are some pictures from the event.

Recently, a friend of mine asked me about setting up Studio 11 in Solaris within VMWare. So, I took some time to build an image for him.

Solaris Express, Developer Edition is easier to install than Solaris 10. It’s almost as simple as keep clicking Next or Enter key until you are done. ;) I ran the installation in VMWare Server 1.02 environment. I assume you already familiar with VMWare and skipped a few VMWare setup steps. If you need help with that, read step 1 – 15 in this blog entry. Solaris Express, Developer Edition 02/07 requires 768MB of RAM. So make sure you allocate enough for this VM. Here are the steps:
1. Choose “Solaris Express, Developer Edition” at the boot menu.
2. Choose 1 for Solaris Interactive
3. Press F2 to continue (i.e. keep US-English Keyboard Layout)
4. Press Enter to continue
5. Press Enter to continue
6. Enter 1 for English
7. Select your time zone and click Next
8. Click Next to accept the time
9. Enter root password twice and click Next
10. Check Accept and click Next
11. If you don’t want localization, click click Next. Else, check any additional localization you want before click Next.
12. Click Next to accept the default disk for partition customization
13. Click Next to accept the default primary partition configuration (i.e. the first partition should be Solaris with all the space you allocated for it.)
14. You may either keep the default partition or change it anyway you like. Here is how I did mine: Choose c1t0d0 node and click Modify button. Remove /export/home partition. Specify 4GB for swap (this is necessary if you want to install Java ES 5 later. If not, specify 2 x the amount of RAM you allocated for the VM. If there are still extra space left after specified new swap space, add rest of the free space to root (/). Click OK and then Next.
15. Click Install Now.
16. Click Reboot Now at end of the installation.
On your first boot, you might want to login to the console as root for the system to automatically go through “post install setup”. You might want to also install VMware Tools. If you need help with that, see Appendix A in this blog entry. I had to comment out unwanted extra large resolution listings in /etc/X11/xorg.conf in order to keep the resolution at 1024×768. Perhaps this could be a minor RFE for VMWare team.

The best way to configure HTTPS/SSL on Sun Java System Application Server 8.1/8.2 is using the command line. The command you should use is asadmin create-ssl. See also this documentation.

Special thanks to Bernhard T. for the tip.

Thanks to Tom D. for pointing me this blog entry on ZFS tuning. The trick documented in this blog entry can be very useful for people who use ZFS on direct-attached storage arrays.

Here is a few tips that I gave to another person today:

* Do not add a new fs that masks existing system folder. For example, do not add a new dir at /usr/bin. Doing so will cause the masking of /usr/bin with another empty directory you might specify. This means that Solaris can’t
find Bourne shell executable and therefore can’t give you a shell when you attempt to login.

* Try to use shutdown instead of halt (i.e. zlogin test-zone shutdown). This will allow Solaris to go through a clean shutdown process.

Hope this helps.