Chapter 3. Creating a New Fabric
Static IP address required for Fabric Server
- For simple examples and tests (with a single Fabric Server) you can work around the static IP requirement by using the loopback address,
- For distributed tests (multiple Fabric Servers) and production deployments, you must assign a static IP address to each of the Fabric Server hosts.
--resolver manualip --manual-ip StaticIPAddressoptions to specify the static IP address explicitly, when creating a new Fabric Server.
Make Quickstart Examples Available
$FUSE_HOME/fabric/io.fabric8.import.profiles.propertiesfile by uncommenting the line that starts with the following:
# importProfileURLs =
- Check that the fabric is running.
- In the
$FUSE_HOME/quickstartsdirectory, change to the directory in which the quickstart example you want to run is located, for example:
- In that directory, execute the following command:
mvn fabric8:deployYou would need to run this command in each directory that contains a quickstart example that you want to run.
- (Optional) Customise the name of the root container by editing the
InstallDir/etc/system.propertiesfile and specifying a different name for this property:
karaf.name=rootNoteFor 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 might need to customise the container's name to prevent it from clashing with any existing root containers in the fabric.
- Any existing users in the
InstallDir/etc/users.propertiesfile are automatically used to initialize the fabric's user data, when you create the fabric. You can populate the
users.propertiesfile, by adding one or more lines of the following form:
Username=Password[,RoleA][,RoleB]...But there must not be any users in this file that have administrator privileges (
adminroles). If the
InstallDir/etc/users.propertiesalready contains users with administrator privileges, you should delete those users before creating the fabric.ImportantIf you leave some administrator credentials in the
users.propertiesfile, this represents a security risk because the file could potentially be accessed by other containers in the fabric.NoteThe initialization of user data from
users.propertieshappens only once, at the time the fabric is created. After the fabric has been created, any changes you make to
users.propertieswill have no effect on the fabric's user data.
- If you use a VPN (virtual private network) on your local machine, it is advisable to log off VPN before you create the fabric and to stay logged off while you are using the local container.NoteA local Fabric Server is permanently associated with a fixed IP address or hostname. If VPN is enabled when you create the fabric, the underlying Java runtime is liable to detect and use the VPN hostname instead of your permanent local hostname. This can also be an issue with multi-homed machines.
- Start up your local container.In JBoss Fuse, start the local container as follows:
cd InstallDir/bin ./fuse
- Create a new fabric by entering the following command:
JBossFuse:karaf@root> fabric:create --new-user AdminUser --new-user-password AdminPass --new-user-role Administrator --zookeeper-password ZooPass --resolver manualip --manual-ip StaticIPAddress --wait-for-provisioningThe current container, named
rootby default, becomes a Fabric Server with a registry service installed. Initially, this is the only container in the fabric. The
--new-user-roleoptions specify the credentials for a new
Administratoruser. The Zookeeper password is used to protect sensitive data in the Fabric registry service (all of the nodes under
--manual-ipoption specifies the Fabric Server's static IP address
StaticIPAddress(see the section called “Static IP address required for Fabric Server”).For more details on fabric:create see section "fabric:create" in "Console Reference".For more details about resolver policies, see section "fabric:container-resolver-list" in "Console Reference" and section "fabric:container-resolver-set" in "Console Reference".
Fabric creation process
- The container installs the requisite OSGi bundles to become a Fabric Server.
- The Fabric Server starts a registry service, which listens on TCP port 2181 (which makes fabric configuration data available to all of the containers in the fabric).NoteYou can customize the value of the registry service port by specifying the
- The Fabric Server installs a new JAAS realm (based on the ZooKeeper login module), which overrides the default JAAS realm and stores its user data in the ZooKeeper registry.
- The new Fabric Ensemble consists of a single Fabric Server (the current container).
- A default set of profiles is imported from
InstallDir/fabric/import(can optionally be overridden).
- After the standalone container is converted into a Fabric Server, the previously installed OSGi bundles and Karaf features are completely cleared away and replaced by the default Fabric Server configuration. For example, some of the shell command sets that were available in the standalone container are no longer available in the Fabric Server.
Expanding a Fabric
- Child container, created on the local machine as a child process in its own JVM.Instructions on creating a child container are found in Child Containers.
- SSH container, created on any remote machine for which you have
sshaccess.Instructions on creating a SSH container are found in SSH Containers.