PGSolZones

Running PostgreSQL in Solaris Zones

Sometimes the terms 'Zones' and 'Containers' are used interchangeably. A Solaris Container is generally defined as the combination of a Solaris Zone and Resource Management facility. For more info, check out the Zones Community on OpenSolaris.org.

Setting up Solaris Zones to run PostgreSQL is quite simple, but before delving into the specifics, there are several options to consider:

  1. Install PostgreSQL in the global zone and run different PostgreSQL instances in different sparse root zones. The PostgreSQL binary will be shared by all zones, but not the data. This method will simplify PostgreSQL upgrade as all zones will automatically see the same binary.
  2. Install PostgreSQL in a whole root zone so different zones will have their own binary. In this approach, you can run different versions of PostgreSQL in different zones.
  3. A combination of 1 & 2. Install PostgreSQL in the global zone, create some sparse root zones to run some instances of PostgreSQL using the shared binary, and create some whole root zones to run their own copy of PostgreSQL.

The above scenarios apply only if Solaris packages are used. If you build your own PostgreSQL binary, you can still run different versions even in sparse root zones by just placing the binaries in different locations in the non-global zone's local filesystem.

Running PostgreSQL in Multi-Zones Environment

The combination of Solaris Zones and Resource Management are very powerful and can be used effectively, especially in a hosting environment, because it offers both virtualization and resource control that allows a single machine to be shared by many users securely and with very flexible resource provisioning based on users needs. Joyent is a good example of a hosting company that sell their hosting services by giving each customer a Solaris Container. From the customer's perspective, it's as if the user has a machine to himself, but in reality, he only has a slice of the system.

In this kind of hosting environment, it is quite simple to setup PostgreSQL such that every customer can run his own instance of the PostgreSQL database in the Zone assigned to him and use the shared PostgreSQL binaries installed in the shared global filesystem.

This blog entry has a step by step example demonstrating the first approach, with PostgreSQL binary installed in the global zone and using a sparse root zone to run PostgreSQL. By default, the installed PostgreSQL binary is shared with all zones.

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.

Sign up or Log in to add a comment or watch this page.


The individuals who post here are part of the extended Sun Microsystems community and they might not be employed or in any way formally affiliated with Sun Microsystems. The opinions expressed here are their own, are not necessarily reviewed in advance by anyone but the individual authors, and neither Sun nor any other party necessarily agrees with them.

Copyright 1994-2009 Sun Microsystems, Inc.
Powered by Atlassian Confluence
Sun Guidelines on Public Discourse Privacy Policy Terms of Use Trademarks Site Map Employment Investor Relations Contact