Fuse 6 is no longer supported
As of February 2025, Red Hat Fuse 6 is no longer supported. If you are using Fuse 6, please upgrade to Red Hat build of Apache Camel.이 콘텐츠는 선택한 언어로 제공되지 않습니다.
6.5. Environment Specific Values in Fabric Profiles.
If you run a number of Fuse systems you may want to define environment-specific configurations. To do this you can create a profile containing properties as key-value pairs, and assign it to a container. When it is assigned to a container, every profile in that container can refer to the information stored in it.
For example, use the following commands to set up a proxy server and define environment-specific values for it.
- Create a profile called
local_values
JBossFuse:karaf@root> profile-create local_values
JBossFuse:karaf@root> profile-create local_values
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Edit the new profile to include the hostname information.
JBossFuse:karaf@root> fabric:profile-edit --pid io.fabric8.examplesystem/url=www.example.com local_values
JBossFuse:karaf@root> fabric:profile-edit --pid io.fabric8.examplesystem/url=www.example.com local_values
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The contents of theio.fabric8.examplesystem PID
in thelocal_values
profile will be:url=www.example.com
url=www.example.com
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Add the new profile to the
proxy-server
container.JBossFuse:karaf@root> container-add-profile proxy-server local_values
JBossFuse:karaf@root> container-add-profile proxy-server local_values
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Create another new profile.
JBossFuse:karaf@root> profile-create local_values_test
JBossFuse:karaf@root> profile-create local_values_test
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Set the values in
profile:io.fabric8.examplesystem
tolocal_values_test
.JBossFuse:karaf@root> fabric:profile-edit --pid 'csp.test/testUrl=${profile:io.fabric8.examplesystem/url}' local_values_test Setting value:${profile:io.fabric8.examplesystem/url} key:testUrl on pid:csp.test and profile:local_values_test version:1.0
JBossFuse:karaf@root> fabric:profile-edit --pid 'csp.test/testUrl=${profile:io.fabric8.examplesystem/url}' local_values_test Setting value:${profile:io.fabric8.examplesystem/url} key:testUrl on pid:csp.test and profile:local_values_test version:1.0
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The content ofpid:csp.test
will be:testUrl=${profile:io.fabric8.examplesystem/url}
testUrl=${profile:io.fabric8.examplesystem/url}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Add the
local_values
profile to theabc
container.JBossFuse:karaf@root> container-add-profile abc local_values
JBossFuse:karaf@root> container-add-profile abc local_values
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Add the
local_values_test
profile to theabc
container.JBossFuse:karaf@root> container-add-profile abc local_values_test
JBossFuse:karaf@root> container-add-profile abc local_values_test
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Sign on to the
abc
container.JBossFuse:karaf@root> fabric:container-connect abc
JBossFuse:karaf@root> fabric:container-connect abc
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Issue the
config:proplist
command to show resolved environment settings.JBossFuse:admin@abc> config:proplist --pid csp.test fabric.zookeeper.pid = csp.test service.pid = csp.test testUrl = www.example.com
JBossFuse:admin@abc> config:proplist --pid csp.test fabric.zookeeper.pid = csp.test service.pid = csp.test testUrl = www.example.com
Copy to Clipboard Copied! Toggle word wrap Toggle overflow