Archive for the ‘solaris’ Category.

Static IPs with NWAM

NWAM (Network Auto Magic) is a very easy way of getting a DHCP lease on OpenSolaris. It runs as a service, enabled by default on install, which will automatically try and get you a DHCP address when Solaris detects that you plugged your ethernet cable in! To most people thats nothing special, but theres more to it.

You can also use it to automatically configure a static IP address upon boot too.

Simply edit the file /etc/nwam/llp to your desired settings. For example:

e1000g0   static   192.168.0.45/24

Easy!

The /24 part of that string represents the netmask. in this case, it would be expressed as 255.255.255.0 in decimal notation.

Then create /etc/defaultrouter so that your machine can reach the outside world! For example…

192.168.0.1

…as this is the address of the router on my LAN
Finally, create the /etc/resolv.conf file, so that the OS knows where to look to resolve DNS names!

On my LAN , this would be:

nameserver   192.168.0.1

If your still having trouble resolving host names, you may need to check that the /etc/nsswitch.conf file reflects the fact that you want to look in both files and the DNS to resolve host names. The hosts and ipnodes entries should look like this:

hosts:        files dns
ipnodes:      files dns

Once all that is done you can simply restart the NWAM service:

pfexec svcadm restart nwam

Indexing your man pages

Its not as boring as you think, but you’ll HAVE to do it when you don’t have a windex file and want to search using man -k :

anton@opensolaris:/$ man -k grub
/usr/share/man/windex: No such file or directory

To get round this, we simply go ahead and create the index with catman:

anton@opensolaris:/$ pfexec time catman -w

real        2.9
user        1.8
sys         0.1

Its pretty quick, and you get left with a little index in /usr/share/man/windex. Its just an ascii version of all the names of your manpages, plus a one line summary of what each one does:

1        1 (3openssl)    - OpenSSL configuration functions
1        1 (3openssl)    - OpenSSL configuration functions
1394        ieee1394 (7d)    - Solaris IEEE-1394 Architecture
2        2 (3openssl)    - \& OpenSSL configuration cleanup functions
2        2 (3openssl)    - \& OpenSSL configuration cleanup functions
2        2 (3openssl)    - \& OpenSSL configuration cleanup functions
2.1        EasyTAG (1)    - Tag editor for MP3 and Ogg Vorbis files
2_F32_Sat    mlib_SignalConvertShift_U8_S8_Sat (3mlib)   – data type convert
with shifting
5.0        MySQL (1)    - MySQL RDBMS version 5.0 for Solaris
6to4        tun (7m)    - tunneling STREAMS module
6to4relay    6to4relay (1m)    - administer configuration for 6to4 relay router
communication
6to4tun     tun (7m)    - tunneling STREAMS module
7-Zip        7-Zip (1)    - A file archiver with highest compression ratio

So now when you do your man -k , you’ll get something useful!:

anton@opensolaris:/$ man -k grub
bootadm     bootadm (1m)    - manage bootability of GRUB-enabled operating system
grub        grub (5)    - GRand Unified Bootloader software on Solaris
installgrub    installgrub (1m)    – install GRUB in a disk partition or a floppy

Crucially you only want to do catman -w , otherwise you’ll be reformatting all your manpages!

From the man page of catman:

-w                  Only create the windex database that  is
used  by whatis(1) and the man(1) -f and
-k options.  No manual  reformatting  is
done.

Solaris support for Rock processor

Its been added to snv (Solaris Nevada, the development build of Solaris) build 100 (were on 99 at the moment).

This includes the following changes:

6368478 Solaris needs to support the Rock processor
6440653 stores to sun4v error queue head registers are missing a membar #Sync
6639717 FLUSH instruction used more than necessary in sun4v

zfs in linux, maybe! (read only)

Ok, so Linux doesn’t have ZFS yet, but it might not be that far off. There are signs of a readonly implementation, depending on whether or not people actually understand the license, being considered by linux kernel hackers. This would be a huge boost for linux, and Solaris alike. As Darren Moffat points out, ZFS already exists in the FreeBSD source tree, and its likely to be in Mac OSX . Given this, surely its only a matter of time before we see it put in. Already we’ve seen Linus have talks with Jeff Bonwick, which is definitely a good sign.

Maybe once this is done, a proper attempt at getting dtrace across might happen. After all, something like dtrace is highly desirable on any operating system.

Open High Availability Cluster

A year ago Sun announced that it was going to be open sourcing its high availability cluster software. According to this blog, they are now delivering on that promise six months ahead of schedule by releasing two million lines of code. TWO MILLION!!!! thats loads! OHAC isn’t quite the same as Solaris Cluster. Its basically most of the code base, but not all packaged up and is not currently supported by Sun. However, Sun is intending on moving the development work away from the official product and onto the OHAC in the future. This is great news for anyone thinking of developing there own custom agents for their own software, or for anyone who just wants to poke around some enterprise-class cluster software!

project indiana is born!

The latest version of Opensolaris can be found at opensolaris.com . This was known as project indiana whilst in development and is now yours absolutely free! (support does cost). Its basically Sun’s home rolled distro of opensolaris.org , and now contains IPS (Image Packaging System) . Essentially IPS is like apt for ubuntu and debian:

you want netbeans?

pkg install netbeans

Theres also a graphical installer too! Theres a screencast you might want to watch which explains a little about how to use it, and what its about!

You should also note that its made it onto distrowatch.com, to rank 69!!!!Hopefully enough people will blog about the release to push that figure up!!!Surely it should make it to the top ten, for all the features it has?

Abusing Solaris with style

Turning Solaris to goo with destructive commands is something I’ve been enjoying for a while now, so its great to see someone add cash to the equation and take the next step in “squashing” bugs.. and hard drives.

:)

cd into, or make a directory beginning with a leading “-”

Having ZFS and SAMBA on the home machine is great. It was simple to set up a share and offer it out to my house mates for them to backup their dissertation work on. With ZFS compressing the files, some of my file systems are getting a 1.6x ratio (60% disk space for free compared with a non-compressing file system)

The interesting bit comes with file permissions and Windows file attributes which aren’t quite the same, in fact, not at all. The attributes get mapped onto the unix file permissions in an interesting way, and you’ll need to keep that in mind when ls -l ing around a shared directory.

Meanwhile, there was a directory named “—-FILES—-” on the share. Trying to use

cd "----FILES----"

doesn’t quite work! Despite quoting the directory name, cd still tries to take some of those dashes as a switch. I’m not sure if theres a way around this using the relative path, but there is a different workaround: simply use the absolute path, instead of a relative one to get you there, eg:

cd /mydir/----FILES..../

To make a directory with leading dashes, you’ll need to specify the full pathname, or use something like this to make the process less painful:

mkdir `pwd`/--mydir--

Sun Connection –bringing back your hardware!

My final year dissertation project is a software tool for asset tracking in a data center environment. The basic idea is that you run this tool after install your Solaris machine, and it reports back information about the hardware to a database for later inspection. Its also has hooks for being run as a service, so you can probe the machine at any time to see what its got. Simple enough, right?

Well, Sun has just announced that their Service Tag technology has just been open sourced. They fit in as a part to their Sun Connection infrastructure management platform. Basically, the service tags are the little bits of software used to identify you hardware and report it back to you. This can be implemented for hardware and software, and should mean that ISVs and all hardware vendors can make their products that little bit easier to manage! To quote the site:

Open Service Tag is the reference implementation of a standards initiative that will seek the involvement of OEMs (Original Equipment Manufacturer) and ISVs (Independent Software Vendor) to define a standard definition for product identification and discovery.

This is very good news for System Administrators! I can speak from experience that its not nice having to open up hundreds of machines looking for a particular piece of hardware, because there isn’t a command to find it. I truly hope that Sun go through all their back catalog of hardware to make sure absolutely everything is possible to find! This should also include bits of hardware that carry other interesting things built in, like motherboard network interfaces.

Its also quite entertaining that if a Sun product isn’t called a “Sun Java Web enabled, scalable ..” something or other, it still has important sounding features like “Sun Update Satellite Console”.

Its also surprising that Sun has been working on this since May 2007 and I’ve missed it till now! A high level overview of how this might help you manage your enterprise can be found here.

Abusing Solaris attempt #2: stressing out ZFS, PART2

In my last post, the files were being written to an IDE hard disks. Now lets see what happens if we write to /tmp instead. Will Solaris cope with ten million files in /tmp? First, if we want to make use of the compression, we need to make a file system:

We make the files (we can use files instead of real disks…):

anton@solaris-devx ~ $ mkfile 100M /tmp/file1
anton@solaris-devx ~ $ mkfile 100M /tmp/file2

and then su to root to make the ZFS file system (mirrored):

# zpool create crazedPool mirror /tmp/file1 /tmp/file2

I should note that for some reason ZFS didn’t make use of the entire file size:

# zfs list crazedPool
NAME USED AVAIL REFER MOUNTPOINT
crazedPool 110K 63.4M 20K /crazedPool

And now the real test. How about a big file? Lets say, 100G?:

anton@solaris-devx dir1 $ time mkfile 100G woot
real 1m21.995s
user 0m0.191s
sys 0m30.308s

And what about 10000 files, each 10M in size?:
anton@solaris-devx dir1 $ i="0"
anton@solaris-devx dir1 $ time while [ $i -lt 10000 ]
> do
> mkfile 10M la0$i
> i=$[$i+1]
> done
real 1m46.789s
user 0m4.665s
sys 0m43.492s

So far, so good. So now lets push the envelope off the desk. Or maybe off a cliff. Lets see what happens when we make a 100TB file with ZFS!

anton@solaris-devx dir1 $ ls -l megaFile
-rw------- 1 anton staff 107374182400000 Mar 15 18:05 megaFile

and the compression ratio?:

anton@solaris-devx tmp $ zfs get compressratio crazedPool
NAME PROPERTY VALUE SOURCE
crazedPool compressratio 1.00x -

hmm, not quite what I was expecting!