Chapter 3. Creating a Container
Abstract
There are several ways to create a new container. The way in which you create the container depends on where the container will be located and the features you want the container to do.
When you add a container to a fabric, you are given the option to create one of the following container types:
- child container—a container that is collocated with a parent containerNoteChild containers require less application code to be downloaded to the host machine. The child container uses the same container binary as its parent container.
- remote root container—a container located on a remote host that is capable of spawning child containersImportantCreating a root container requires that the host machine have ssh enabled.
- cloud-managed Fuse container—a root container that is hosted on a cloud infrastructureNoteThe management console uses the jCloud library to access the cloud infrastructure.
You must also decide if the new container is going to be a registry server for the fabric.
Important
Registry servers should not be placed in child containers and should not host any other services such as a message broker or business application.
3.1. Creating a Child Container
Abstract
A child container is created using the infrastructure put in place by a root container and is collocated with its parent container.
Overview
If you have a Fuse container deployed onto a remote host you can use that container to create more containers on the host. This saves you from needing to use ssh. It also minimizes the amount of code needed to be downloaded over the network.
The child container uses the same binaries and root folder as the parent container. The child's data is stored in a separate data folder from the root container and the other child containers spawned by the root container. While the child container uses the same underlying binary files as the root container, it runs in its own JVM.
The only limitations on a child container are:
- it cannot be used to spawn other child containers
- it is deleted along with its parent container
Procedure
To create a child container:
- Selectfrom the main menu.The Containers page opens.
- Click.The Create Fuse Container page opens.
- In the Name field, enter a name for the new container.
- If you want to make the new container a registry server check Make container a distributed registry server.ImportantIt is not advisable to make a child container a registry server. Registry servers should be run on separate hosts from other containers to maintain the integrity of the fabric.
- If you want to pass any special flags to the container's JVM:
- Check JVM Options.
- Enter the options to pass to the JVM in the field next to the check box.
- If you need to use a Maven proxy to access the repository containing your Fuse artifacts, check the Maven Proxy URL field and enter the URL for your Maven proxy.
- If you want to create multiple instances of the container, enter a number greater than one in the Count field.When you create multiple containers the container's number is appended to the value specified in the Name field.
- Select how the container will report its IP address to other containers from the options in the Resolver drop-down list.The options are:
- Local Hostname
- When a requests for the container's location are made, the container's local hostname is returned.
- Local IP
- When a requests for the container's location are made, the container's local IP address is returned.
- Public Hostname
- When a requests for the container's location are made, the container's public hostname address is returned.
- Public IP
- When a requests for the container's location are made, the container's public IP address is returned.
- Click.The Select profiles to install on the container page opens.
- Select the version of profiles you want to use for provisioning the container.The value of this drop down defaults to the value set on the Profiles page.
- Select one or more profiles to deploy to the container.
- Click.The Select the type of container page opens.
- Select Child container.
- Click.The Select a parent for the child container page opens.
- Select the root container that will be the parent for the new container.
- Click.The wizard closes and the new container will appear in the list of containers. Initially the Active indicator may be red, but should turn green shortly after adding it. The Provisioned indicator may also show gray bars, but should turn green when the specified profiles are fully provisioned.