1.4. Initialize Your Local Container
Prerequisites Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
This tutorial assumes you have a fresh installation of Red Hat JBoss Fuse on your local machine (see Installation Guide). If you have previously experimented with the local container instance, it might be a good idea to perform a cold start before you proceed.
Forcing a cold start Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
(Optional) If you are not sure what state your local container is in or if you have previously used your local container in the context of a fabric, it is a good idea to force a cold start before you continue. This ensures that your container is in a known state (a plain, unmanaged container) and makes it more likely that you will be able to follow the tutorial steps without any problems.
To force a cold start, perform the following steps:
- If the container is currently running, shut it down by entering the following console command:
JBossFuse:karaf@root> shutdown -f
JBossFuse:karaf@root> shutdown -fCopy to Clipboard Copied! Toggle word wrap Toggle overflow NoteIf your container has any child instances running, you must also shut the child instances down. On *NIX systems, you could use the commandps -ef | grep karafto discover any child instances. - Delete the
InstallDir/data/directory.WarningThis will completely wipe the state of the container (apart from the configuration settings stored underInstallDir/etc/).NoteIf your container has any child instances, you must also delete theInstallDir/instances/directory, which contains the data for the child instances. - Start the container by entering the following commands:
cd InstallDir/bin ./fuse
cd InstallDir/bin ./fuseCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Create a fabric on your local container Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
To access the necessary Fabric functionality and Fabric commands, you need to create a fabric on your local container. Perform the following steps:
- 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 theusers.propertiesfile, by adding one or more lines of the following form:Username=Password[,RoleA][,RoleB]...
Username=Password[,RoleA][,RoleB]...Copy to Clipboard Copied! Toggle word wrap Toggle overflow But there must not be any users in this file that have theadminrole. If theInstallDir/etc/users.propertiesalready contains users with theadminrole, you should delete those users before creating the fabric.WarningIf you leave some administrator credentials in theusers.propertiesfile, this represents a security risk because the file could potentially be accessed by other containers in the fabric.NoteThe initialization of user data fromusers.propertieshappens only once, at the time the fabric is created. After the fabric has been created, any changes you make tousers.propertieswill have no effect on the fabric's user data. - To create the fabric container, enter the following console command:
JBossFuse:karaf@root> fabric:create --new-user AdminUser --new-user-password AdminPass --zookeeper-password ZooPass --wait-for-provisioning
JBossFuse:karaf@root> fabric:create --new-user AdminUser --new-user-password AdminPass --zookeeper-password ZooPass --wait-for-provisioningCopy to Clipboard Copied! Toggle word wrap Toggle overflow The--new-userand--new-user-passwordoptions specify the credentials for a new administrator user. TheZooPasspassword specifies the password that is used to protect the Zookeeper registry.NoteIf 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. A 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. To be absolutely sure about the hostname, you could specify the IP address explicitly—see chapter "Creating a New Fabric" in "Fabric Guide".
Install JClouds and Fabric commands on the local container Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
After a cold start, the container does not have the required cloud commands installed by default. To enable support for accessing and administering the AWS EC2 provider, deploy the
cloud-aws.ec2 profile into your local container, as follows:
JBossFuse:karaf@root> fabric:container-add-profile root cloud-aws.ec2
JBossFuse:karaf@root> fabric:container-add-profile root cloud-aws.ec2