Chapter 5. Managing Partitions
In Penrose Virtual Directory, a virtual directory is defined through the relationships of different server entities: servers (connections), applications (sources), individual entries (identities), and links between entities (mappings). All of these relationships are contained in the partition entry.
This chapter describes how to create and manage partition entries.
The complete virtual directory set up is defined in a container entry called a partition. The partition is a Java object which controls the operations and lives of all of the other components of the virtual directory configuration, including sources, connections, and mappings. The partition contains all of the Java classes and common files used by these virtual directory components. In this way, a partition is functionally similar to an application server like Tomcat.
A default partition is created with every Penrose Server instance, and this is usually sufficent to define the complete Penrose Virtual Directory deployment. It is also possible, depending on the deployment requirements, to have multiple partitions within a single Penrose Server instance.
It can also be necessary to have multiple Penrose Server instances with the same virtual directory configuration. Penrose Virtual Directory partitions can be easily exported from one Penrose Server instance and imported on another, making it easy to have a consistent virtual directory on different servers.
By default, every new server already has a partition named DEFAULT
. Server entries can have an unlimited number of partitions. To create a new partition:
In Penrose Server, open the server entry.
In the top menu, click the Partitions menu item, and select the New Partition... option.
Alternatively, right-click the Partitions folder, and select the New Partition... option.
Fill in a name for the new partition, and click Finish.
The new partition, with all of its subfolders, is listed in the Partitions section.
The partition configuration can be exported from one Penrose Server and imported into another Penrose Server. This makes it much easier to have the same virtual directory mirrored on multiple servers.
Open the server entry in Penrose Studio, and expand the Partitions folder.
Right-click the partition to export under the Partitions folder.
Select Export... from the drop-down menu.
Fill in the path to the directory to which to save the partition configuration file, and click the Finish button.
The import partitions directory must be local to the machine where Penrose Studio is being run.
Open the server entry in Penrose Studio, and expand the Partitions folder.
Right-click the Partitions folder.
Select Import Partition... from the drop-down menu.
Fill in the name for the new partition. The name can be different than the original name. Click Next.
Fill in the path to the directory to the partition directory, and click Finish.
The imported partition is listed beneath the Partitions folder.
Penrose Server has a tool, partition.sh
, which can manage partitions, and this tool is used to import and export partitions.
On the first server, export the partition. For example:
/opt/vd-server-2.0/bin/partition.sh export partitionpartition_name
/path/to/exported/partition
The partition must be imported from a directory which is local to the Penrose Server instance, so the exported partition must be available on a fileserver or the local machine. For example, copy the exported partition to the target Penrose Server machine:
scp -r ExamplePartition2/ root@server2.example.com:/opt/vd-server-2.0/partitions/ExamplePartition2/
Import the partition into the target Penrose Server.
/opt/vd-server-2.0/bin/partition.sh import partitionpartition_name
/local/path/to/exported/partition
The partition is a Java MBean object which starts and runs automatically with Penrose Server. Each source, connection, directory, and mapping is also an MBean object, controlled by the partition object. The partition can be started and stopped, which also starts or stops all of the sources, connections, directories, and mappings configured under it.
To start or stop a partition from Penrose Studio:
Open the server entry in Penrose Studio, and expand the Partitions folder.
Right-click the partition to start or stop under the Partitions folder.
Select Start or Stop from the drop-down menu.
To start or stop a partition from the command line, run the partition.sh
command. For example:
/opt/vd-server-2.0/bin/partition.sh stop partition DEFAULT
The partition.sh
command is explained in Section A.7, “partition.sh”.
Penrose Virtual Directory comes with many different Java libraries which define different entry types, such as org.safehaus.penrose.partition.Partition
for a partition and org.safehaus.penrose.directory.Entry
for virtual directory entries. It is possible to add custom classes to support special entries or to define specific subtree elements quickly.
To use a class for a specific partition only, create a lib/
directory in the partition directory,
.
/opt/vd-server-2.0/partitions/
partition_name/DIR-INF
To make a custom class available for any partition, put the JAR file in the /opt/vd-server-2.0/lib/ext
directory.
Do not put any custom libraries in /opt/vd-server-2.0/lib/
. This directory is reserved for built-in libraries, and any custom files may be deleted or overwritten during upgrades.