This is a discussion on Seven Useful OpenSolaris ZFS Home Server Tips - Solaris Rss ; A lot of people have read last year's article " A Small and Energy-Efficient OpenSolaris Home Server " (Thanks a lot to Andre Lue from the EON project for linking to it!) and there was quite some discussion on different ...
A lot of people have read last year's article "A Small and Energy-Efficient OpenSolaris Home Server" (Thanks a lot to Andre Lue from the EON project for linking to it!) and there was quite some discussion on different RAID options as a result of my RAID-Greed article.
So let's continue the theme and have a look at the following home server tips that helped me a lot during my own home server planning, building and installing:
#1: Figure Out Your Home Server Goals, Constraints and Priorities
It's always good to know what you want to do with your home server, be aware of your constraints and then prioritize your specific requirements. This may sound trivial, but this it exactly what is often overlooked in the frenzy of studying features, data sheets, pricing etc.
This is also a very personal thing: Everybody follows different goals, has different constraints and decides on different priorities. The following lists should therefore serve as sources of inspiration:
Potential Home Server Goals
As you see, there are many things you can do with a home server, and I'm sure you have many ideas yourself. Just make a list of all the things you want to do with your home server as it will give you a sense of the features you're likely going to want when selecting its components.
- A backup file server for your laptop or other systems.
- An infrastructure server for routing, (Dyn)DNS, DHCP, Email, etc.
- A development/testing machine for your code projects.
- A file server for family documents, photos, movies, etc.
- A Sun Ray Server for your family.
- A staging machine for a web presence or service that you host elsewhere.
- A media server for your MP3 or video player in your living room.
- A networked time machine server for your Mac backups.
Next, let's face some common constraints when running a server machine at home:
Potential Home Server Constraints
Again, you may find some more constraints that are important for you.
- Budget: Probably the most common constraint.
- Existing hardware: Do you have some components sitting around that you could reuse?
- Space: Not everyone has a large closet or extra room for running a server at home.
- Noise: If you're forced to run your server where people live, then you want it to be silent.
- Power Consumption: This is like the budget question, but over time, on a yearly basis.
- WAF: Another important constraint, especially when running the machine in the living room!
When purpose meets constraints, you need to prioritize. And more often than not compromises need to be made, goals rethought or constraints re-evaluated (like raising your budget). Here are some features that you want to prioritize:
Home Server Priorities
I have already assigned some numbers for you, because in my experience, this is the most useful way to prioritize: You never want your precious photos to get lost, disk space is darn cheap (and becomes cheaper every day) and performance is a good thing when transcoding videos, doing high speed backups or running virtual machines.
- Fault Tolerance: What happens if a component fails? (And every component will fail, sooner or later. The question is just how soon and quick you're going to replace it!) In particularly: What if a disk fails? What if two disks fail in a short time span?
- Performance: How important is performance so you can accomplish your server's goals without pulling some hairs off?
- Disk Space: How much net data do you want/need to store on your home server?
But again, this is your server, and your priorities may differ and you might have other priorities to sort into the above list.
#2: Check Out Some Cool Home Server Builds
There's a myriad of home servers that have been documented on the web for different operating systems. Here are a couple of interesting OpenSolaris home server builds to look at, in no particular order:
I'm sure there are more interesting OpenSolaris home server setups out there, just have a look around and collect as many inspirations for your own setup as you can!
- Rolf Kersten was among the first in Germany to own an Eee PC and boot OpenSolaris from it. Now that his tiny netbook friend has almost retired, he found a way to turn it into an OpenSolaris Eee PC Homeserver.
- Simon Breden's Blog has a number of interesting blog posts about his home server, from choosing components to testing SSDs to setting up OpenSolaris, many interesting aspects are covered.
- Matthias Pfuetzner's recently upgraded home server is very interesting, too. He has blogged a lot about his experience with low-power hardware, booting from compact flash and storing data on USB disks.
- Jan Brosowski's new home server (in German) is powering his Sun Rays at home, virtualizing desktop machines and a few other tasks.
- Tim Foster's Home NAS was recently built based on an Atom board and an ION chipset. It's going to store a lot of video soon...
- Chris Gerhard's home server is another Sun Ray installation for the whole family - including Sun Ray picture frames and lots of tweaks for parental controls, GNOME optimizations and other useful stuff.
- Gregor Longariva (blogs in German) recently blogged about his latest home server, including NetATalk and some IPV6 woes.
- Joerg Moellenkamp chose an AMD Phenom for his home server, so he can have enough oomph for multiple virtual machines.
#3 Find the Right OpenSolaris (or ZFS) Distribution for You
It doesn't have to be the OpenSolaris distribution, there are also some interesting alternatives based on the OpenSolaris source code:
#4 Become Familiar With OpenSolaris
- If you don't want to get all the X/GNOME baggage and prefer a more minimalistic approach, then check out the JeOS project. It stands for "Just enough OS" and features "examples of heavily reduced, text-based, headless server-oriented forms of the Sun-managed OpenSolaris distribution".
- Nexenta is an alternative distribution tailored towards providing an easy to configure NAS-Appliance version of OpenSolaris.
- EON ZFS Storage is a RAM-based ZFS storage appliance running live from CD-ROM, USB or other devices, optimized to give you an embedded NAS storage appliance feeling.
- Check out other OpenSolaris distributions as well.
- And if you don't like OpenSolaris at all, remember that ZFS is also available in FreeBSD as well since 2007.
OpenSolaris is easy to learn if you're already familiar with a variant of Unix or Linux. But it pays off a lot to dig deeper, especially for those topics that are unique to OpenSolaris.
The blogs you see above are a great starting point for many OpenSolaris tips and tricks, and here are a few more:
#5: Become Familiar with ZFS
- The OpenSolaris Community Groups cover a lot of interesting topics around our favourite OS, from Accessibility and Appliances to ZFS and Zones.
- Browse the OpenSolaris Projects and find new stuff to try out.
- Join an OpenSolaris User Group near you and discuss your favorite topics over a beer or two.
- Two books are highly recommended: Solaris Internals and Solaris Performance and Tools, and they have a huge wiki with lots of articles to browse. If you're looking for an all-in-one book, then the OpenSolaris Bible is for you. And if you have a Linux background, then Pro OpenSolaris is written specifically for Linux users who want to quickly get up to speed with OpenSolaris.
- And don't forget to read the free manual: You'll find everything at docs.sun.com.
ZFS, being probably the most important feature of OpenSolaris, warrants its own tip. Make sure to understand how it works and try it out on some test pools to get a feel for it. Make sure to regularly visit the ZFS Community on OpenSolaris.org and check out the ZFS Best Practices Guide. A while ago, I blogged about "7 Easy Tips for ZFS Starters" and hope you still get a few useful tips out of it. And here's ZFS tip number eight: Scrub your pools regularly.
But in the end, it's your own experience that counts. So dive right into it and collect your own ZFS experience, and feel comfortable with it when setting up pools and filesystems for real.
#6: Use Zones to Manage Your Services
With all the chatter about ZFS, you shouldn't forget the OpenSolaris Zones feature. It is very useful for managing your services, separating applications and setting up secure environments for your users and daemons.
For instance, my own home server has a zone running Mediatomb for serving video files, another one for serving music to my MP3 player, one zone per user as their own sandboxes and so on. Or imagine having a secure externally accessible login zone that is separated from everything else. And you can combine zones with Crossbow and create your own de-militarized zones and multi-tiered network architectures, all inside the same machine!
Once you get the hang of it, working with zones is the natural way to handle almost everything running on your server. And Uli's and Detlef's Container Guide is definitely your friend.
#7: Script Everything
This may be the most important tip of all, and it took me some time to figure it out.
You know how it goes: You install the OS, set up some users, install software, configure everything, tinker with some services, apply patches, etc. But after some time you hardly know what you did. Sure, you wanted to document it. Some time. Yeah, right.
For exactly this reason, I decided to not configure or install anything by hand: Everything is scripted.
And by scripting everything, I really mean everything:
Good things happen when you script everything:
- All users on the system are setup by a script.
- Package repository configurations, software installation, extra software and their configuration are done with scripts.
- Every service is running in a zone (see above) and all zones can be setup and teared down completely automatically.
- Even small things like setting up power management or ZFS auto snapshots are configured with scripts.
- And while we're at it: The Service Management Facility (SMF) offers a lot of scripting opportunities to make your life easier, too!
Granted, this takes a lot of time, and the beginning is probably the hardest part. But you'll notice quickly that you can reuse elements of your scripts, or even set up small libraries of frequently used functions and build up your own management infrastructure.
- You're forced to think before you do. This makes you aware of all the things that you need to configure or figure out when setting up your system.
- You learn a lot about scripting, the way the system works and how to properly set up stuff.
- The scripts become their own documentation: If you later want to know how you did it, you have it all written down, no excuses.
- Your system becomes independent of the installation: Imagine a complete disaster that kills your whole machine. Just set up a new one from scratch, import your data pools (where you should also store all your scripts), start your scripts and you're ready to go again in minutes!
- You become confident: When developing your scripts, you'll do a lot of testing and bugfixing. And once your scripts do what you want reliably, you'll gain a lot of confidence, and a nice sense of fulfillment.
I'll share some of my own scripts in future posts, but I encourage you to develop scripts of your own, so you can learn new stuff by developing them, instead of using pre-canned stuff that you don't fully understand.
Running a home server is more than just serving videos or storing backup data. It's a playground for growing new skills, developing stuff, testing new technologies and learning new stuff. I hope the tips above help you do more of that and get the most out of your OpenSolaris (or other OS based) home server.
Are you thinking about running your own OpenSolaris home server? Or do you run one already? What are your experiences? What's your setup and configuration? What lessons did you learn and what would you do differently if you had to start from scratch? Feel free to share your experience by leaving a comment below.