How to modify container properties in Fabric environment
Environment
- JBoss Fuse
- 6.0
Issue
- How to modify container etc/jre.properties file in Fabric?
- Can I modify other properties files in Fabric?
- How to modify a etc/*.cfg file in Fabric?
- I would not like to set logging properties for each container one by one if possible.
- I would like to change a logging pattern for all containers - fabric servers and especially for child one
Resolution
-
You can always modify the file directly on the container and it will only affect the single container itself. However, it is always recommended to use profile approach to modify properties files since any manual modification could potentially get lost if you update the container's profile.
For instance, you can directly modify the "default" profile and it will ultimately affect all the containers. Or alternatively, if you would like to modify a single container, then you can create a new profile derived from the "default" profile and apply the new profile to the container after modification is done.
Container's jre.properties file is not modifiable directly through a profile. This file is only used as an include into config.properties, which is modifiable.
In order to do so, you need to add following configure to the "org.fusesource.fabric.agent" configuration:
config.xxx = yyyIt will end up adding a line “xxx = yyy” to etc/config.properties and restart the container.
Here is detailed steps:
- Create a new profile;
- Logon to Management Console and locate the newly created profile;
- On the profile's "Config Files" tab, add "org.fusesource.fabric.agent.properties" in the text field and clicked "add";
- Click the "org.fusesource.fabric.agent.properties" link in the list and add following properties:
config.xxx = yyy - Click "Save".
-
Only config.properties and system.properties are directly modifiable using profiles. Both jre.properties and custom.properties are included in config.properties, so they can be overridden by modifying through config.properties. When using fabric, users.properties and keys.properties are not used because the security settings are stored in the fabric registry.
-
Modify a etc/*.cfg file is pretty much the same as modifying a properties file. So you can create the file in the default profile and copy the content. Though any modification will affect all containers. If you would like to modify a single container only, you’d have to edit the file directly on that container (although it is not recommended as the reason I have mentioned in the bulletin point #1), or create a derived profile, change the keys you need and assign it to the container you want to change.
However, there is one thing that is different from modifying a properties file: you currently have to use .properties for the file suffix but not .cfg. For instance, if you would like to modify "etc/org.ops4j.pax.logging.cfg" file, you would have to use "org.ops4j.pax.logging.properties" instead. So org.ops4j.pax.logging.cfg -> org.ops4j.pax.logging.properties. Here is detailed steps:
- Create a new profile;
- Logon to Management Console and locate the newly created profile;
- On the profile's "Config Files" tab, add "org.ops4j.pax.logging.properties" in the text field and clicked "add";
- Click the "org.ops4j.pax.logging.properties" link in the list to open it. Then copy the content from container's "etc/org.ops4j.pax.logging.cfg" file and paste to it;
- Make necessary modification and click "Save".
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
