Archive

Archive for the ‘(Open)Solaris’ Category

Netatalk on OpenSolaris (incl. Service Discovery)

February 17th, 2010

I just found an excellent article via an excellent article via another excellent article about building Netatalk on OpenSolaris.

Thanks folks, after about 15min of compile-time and a some copy&paste, my ZPool is now visible in Finder. :-)

,

OpenSolaris snv_132 released

February 5th, 2010
Comments Off

The OpenSolaris development package repository

http://pkg.opensolaris.org/dev/

has been updated to reflect the changes up to and including snv_132 for both x86/x64 and SPARC platforms. This update includes fixes to the Caiman “Slim Install” and the Image Packaging System (IPS).
[...]
Users who wish to update their system to the development build can do so by setting their preferred publisher to the above URL and using the “image-update” facility provided by the pkg(1) command or by the “Update All” facility of the Package Manager GUI.

[Quelle: David Comay via opensolaris-annouce]

One of the reasons why I love Solaris…

February 1st, 2010
Comments Off
shl@napfel ~ % uptime
[...] up 1 day(s), [...] load average: 1106,24, 2363,14, 3015,00

No, the box is not glowing in the dark yet, just a little ooops with fork(). But still rock solid and pretty much usable.

shl@napfel ~ % uname -a
SunOS napfel 5.11 snv_130 i86pc i386 i86pc

This is why I love Solaris!

,

OpenSolaris: git help –web

January 26th, 2010
Comments Off

Um die Web-Hilfe von git auf OpenSolaris nutzen zu koennen ist leider etwas Handarbeit noetig.

git clone git://git.kernel.org/pub/scm/git/git.git
cd git
make quick-install-html
pfexec mkdir -p /usr/share/doc/git-doc
cd /usr/share/doc/git-doc
pfexec mv ~/share/doc/git-doc/* .

Nun funktioniert z.B. git help --web init wie erwartet, und der Browser wird geoeffent um die Hilfe-Seite anzuzeigen.
Wenn das git-Repository sonst nicht mehr benoetigt wird kann es natuerlich anschliessend wieder geloescht werden. Ebenso ~/share, sofern keine anderen Daten dort gelagert werden.

OpenSolaris snv_131 released

January 24th, 2010
Comments Off

The OpenSolaris development package repository

http://pkg.opensolaris.org/dev/

has been updated to reflect the changes up to and including snv_131 for both x86/x64 and SPARC platforms. This update includes fixes to the Caiman “Slim Install” and the Image Packaging System (IPS).
[...]
Users who wish to update their system to the development build can do so by setting their preferred publisher to the above URL and using the “image-update” facility provided by the pkg(1) command or by the “Update All” facility of the Package Manager GUI.

[Quelle: David Comay via opensolaris-annouce]

rsync vs. zfs send|zfs receive

January 20th, 2010
Comments Off

Problemstellung:

Gedankengang #1:
Es war schon spaet abends, wirklich nachgedacht wurde nicht, klein Sebastian startet ein rsync und denkt “so lang wird das schon nicht dauern”. Problematik dabei ist bzw. war allerdings, dass auf dem Pool u.A. auch diverse OpenSource-Projekte und -Sammlungen im Quelltext vorlagen, so z.B. pkgsrc, was ohne mit der Wimper zu zucken zu mehreren Millionen kleinen Files fuehrt. Ebenfalls kam der kleine Sebastian nicht auf die Idee fuer das rsync ein LAN-Kabel anzuschliessen und schickte den kompletten Datenstrom ueber WLAN durch die Luft. (Immerhin zwar n, aber im Vergleich zu Gigabit-Ethernet immernoch langsam.) Einigen wir uns auf keine so gute Idee, auch wenn sie zum Ziel gefuehrt hat.

rsync -avzP -e "ssh -p 22" /Volumes/tank/* shl@<ziel>:/tank/transfer

Gedankengang #2: (ein paar Tage spaeter)
Die Daten sind auf dem neuen Pool angekommen – so weit so gut. Und damit es noch einen Lern-Erfolg gibt, machen wir das jetzt nochmal in richtig. Damit ich den – in diesem Falle – ueberfluessigen Layer Netzwerk los werde, schliesse ich die USB-Platten vom Mac direkt an die OpenSolaris-Box an. Hierfuer muss der Pool allerdings erst umbenannt werden, da eine Maschine nicht zwei Pools des gleichen Namens mounten kann.

sudo zpool export tank
sudo zpool import oldtank tank
sudo zpool export oldtank

Die Schritte im Detail: wir exportieren den Pool, damit wir ihn per import <neu> <alt> umbenennen koennen und exportieren ihn nochmals, damit wir ihn an die andere Kiste anschliessen koennen. Hier noch ein

pfexec zpool import oldtank

und zumindest das erste Problem ist gegessen.

ZFS bietet von Haus aus eine durchdachte Moeglichkeit an um Daten von A nach B zu schieben, naemlich zfs send | zfs receive. Durch die Pipe (|) kann man hier auch prima z.B. ssh als Transport-Medium nutzen. Allerdings kann zfs send nur Snapshots uebertragen – aber bei einem Filesystem was effektiv still steht (hier oldtank) tut das ja nun wirklich nicht weh.

Das folgende Script habe ich die letzten Monate auf meinem Mac zum snapshot’en benutzt. In groben Zuegen basiert es auf Jeff’s Snapshot-Script, allerdings erstellen wir hier keinen Timestamp sondern einen hoffentlich eindeutigen String fuer die Snapshots die wir kopieren moechten, in diesem Falle “NOWITSTHETIME“.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/bash
 
FS=`zfs list -t filesystem | grep oldtank | awk '/^[a-z0-9]+\//{ print $1}'`
#NOW=`date +%Y-%m-%d`
NOW=NOWITSTHETIME
 
for I in $FS; do
 echo "Snapshot'ing ${I}@$NOW ..."
 zfs snapshot ${I}@$NOW
 if [ $? = 0 ]; then
  echo "success!"
 else
  echo "failed ($?)!"
 fi
done

Im naechsten Script – ich entschuldige mich im Vorfeld fuer die massive und z.T. unnoetige Nutzung von grep, aber mir gefaellt das halt so ;-) – schicken wir die eben erstellten Snapshots nach tank/transfer2 (vorher natuerlich anlegen, sonst wird das nix…):

1
2
3
4
5
6
7
#!/bin/bash
 
for i in `zfs list -rH -t snapshot | awk '{print $1}' | grep oldtank | grep -v tank/transfer2/oldtank | grep NOWITSTHETIME`
do
echo "sending Snapshot" $i "to transfer2"
pfexec zfs send $i | pfexec zfs receive tank/transfer2/$i
done

Fragt sich nun natuerlich: was haben wir gewonnen?
zfs send serialisiert den Datenstrom, was z.B. dazu fuehrt, dass es vollkommen egal ist, ob wir mit Millionen von kleinen Dateien oder drei grossen 1TB-Files arbeiten. Ebenfalls koennen wir uns den kompletten Weg der Daten sicher ueber deren Zustand sein, denn wir vertrauen durchweg auf die Integritaetschecks von ZFS. Wenn gewuenscht (ich habe nicht wirklich einen Sinn darin gesehen) kann man durch die Pipes noch z.B. gzip einbauen, oder eben Transport-Mechanismen wir ssh oder sonstwas nutzen. Konstrukte wie

zfs send tank@BRIEFTAUBE > file
Benutze file mit Brieftaube
cat file | zfs receive tank@BRIEFTAUBE

sind genauso moeglich. Und auch die Nutzung als Backup ist durchaus eine Ueberlegung wert.
Um zur urspruenglichen Problemstellung zurueck zu kommen: im Vergleich zur Methode #1 ist die Loesung mit zfs send eindeutig schneller. Und – zumindest ich – habe damit ein besseres Gefuehl.

Beide Scripte sind per git auf github verfuegbar.
(git clone git://github.com/shl/zfssnapsend.git)

, ,

Solaris Express Community Edition – Build 130

January 12th, 2010
Comments Off

Derek hat ein neues Release von SXCE (Solaris Express Community Edition) angekündigt.

Download ist wie immer per opensolaris.org möglich, und trotz Umweg über das SUN Download-Center auch mit wget nutzbar.

Außerdem gibt es bei diesem Release zwei wichtige Punkte zu beachten:

  • Nevada RE Build 130 is the final SXCE build.
  • After January 2010, all existing SXCE releases will be removed from the SDLC (Sun Download Center) and no additional SXCE images of any kind will be distributed.