LibraryToggle FramesPrintFeedback

Create a Fabric

Overview

Figure 3 shows an overview of a sample fabric that you will create. The Fabric Ensemble consists of just one Fabric Server (making this fabric suitable only for experimental use) and two managed child containers.

Figure 3. A Sample Fabric with Child Containers

A Sample Fabric with Child Containers

Fabric server

A Fabric Server (or servers) forms the backbone of a fabric. It hosts a registry service, which maintains a replicable database of information about the state of the fabric. Initially, when you create the fabric, there is just a single Fabric Server.

Child containers

Creating one or more child containers is the simplest way to extend a fabric. As shown in Figure 3, the first container in the fabric is a root container, and both child containers are descended from it.

Each child container is an independent Fuse ESB Enterprise container instance, which runs in its own JVM instance. The data files for the child containers are stored under the ESBInstallDir/instances directory.

Steps to create the fabric

To create the simple fabric shown in Figure 3, follow these steps:

  1. (Optional) Customise the name of the root container by editing the ESBInstallDir/etc/system.properties file and specifying a different name for this property:

    karaf.name=root
    [Note]Note

    For the first container in your fabric, this step is optional. But at some later stage, if you want to join a root container to the fabric, you must customise the new container's name to prevent it from clashing with any existing root containers in the fabric.

  2. If you have not already done so, create one (or more users) by adding a line of the following form to the ESBInstallDir/etc/users.properties file:

    Username=Password[,RoleA][,RoleB]...

    At least one of the users must have the admin role, to enable administration of the fabric. For example:

    admin=secretpassword,admin

    When you create the fabric, the entries in users.properties are used to initialize the user data for the Zookeeper login module, which provides security for the fabric.

    [Note]Note

    The initialization of user data from users.properties happens only once, at the time the fabric is created. After the fabric has been created, any changes you make to users.properties will have no effect on the fabric's user data.

  3. To create the first fabric container, which acts as the seed for the new fabric, enter this console command:

    karaf@root> fabric:create --zookeeper-password admin

    The current container, named root by default, becomes a Fabric Server with a registry service installed. Initially, this is the only container in the fabric. The Zookeeper password is used to protect sensitive data in the Fabric registry service (all of the nodes under /fabric).

    [Tip]Tip

    Most of the time, you are not prompted to enter the Zookeeper password when accessing the registry service, because it is cached in the current session. When you join a container to a fabric, however, you must provide the fabric's Zookeeper password.

  4. Create two child containers. Assuming that your root container is named root, enter this console command:

    karaf@root> fabric:container-create-child root child 2
    Jmx Login for root: admin
    Jmx Password for root: 
    The following containers have been created successfully:
    	Container: child1.
    	Container: child2.

    You are prompted to enter a JMX username and password (the JMX port is integrated with the JAAS authentication service). Enter one of the username/password combinations that you defined in step 2.

  5. Invoke the fabric:container-list command to see a list of all containers in your new fabric. You should see a listing something like this:

    karaf@root> fabric:container-list
    [id]                           [version] [alive] [profiles]                     [provision status]
    root                           1.0       true    fabric, fabric-ensemble-0000-1, fuse-esb-full success
      child1                       1.0       true    default                        success
      child2                       1.0       true    default                        success

Shutting down the containers

Because the child containers run in their own JVMs, they do not automatically stop when you shut down the root container. To shut down a container and its children, first stop its children using the fabric:container-stop command. For example, to shut down the current fabric completely, enter these console commands:

karaf@root> fabric:container-stop child1
karaf@root> fabric:container-stop child2
karaf@root> shutdown -f

After you restart the root container, you must explicitly restart the children using the fabric:container-start console command.

Comments powered by Disqus