Este conteúdo não está disponível no idioma selecionado.

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.
  1. Create a profile called local_values
    JBossFuse:karaf@root> profile-create local_values
    Copy to Clipboard Toggle word wrap
  2. 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
    Copy to Clipboard Toggle word wrap
    The contents of the io.fabric8.examplesystem PID in the local_values profile will be:
    url=www.example.com
    Copy to Clipboard Toggle word wrap
  3. Add the new profile to the proxy-server container.
    JBossFuse:karaf@root> container-add-profile proxy-server local_values
    Copy to Clipboard Toggle word wrap
  4. Create another new profile.
    JBossFuse:karaf@root> profile-create local_values_test
    Copy to Clipboard Toggle word wrap
  5. Set the values in profile:io.fabric8.examplesystem to local_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
    Copy to Clipboard Toggle word wrap
    The content of pid:csp.test will be:
    testUrl=${profile:io.fabric8.examplesystem/url}
    Copy to Clipboard Toggle word wrap
  6. Add the local_values profile to the abc container.
    JBossFuse:karaf@root> container-add-profile abc local_values
    Copy to Clipboard Toggle word wrap
  7. Add the local_values_test profile to the abc container.
    JBossFuse:karaf@root> container-add-profile abc local_values_test
    Copy to Clipboard Toggle word wrap
  8. Sign on to the abc container.
    JBossFuse:karaf@root> fabric:container-connect abc
    Copy to Clipboard Toggle word wrap
  9. 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
    Copy to Clipboard Toggle word wrap
Voltar ao topo
Red Hat logoGithubredditYoutubeTwitter

Aprender

Experimente, compre e venda

Comunidades

Sobre a documentação da Red Hat

Ajudamos os usuários da Red Hat a inovar e atingir seus objetivos com nossos produtos e serviços com conteúdo em que podem confiar. Explore nossas atualizações recentes.

Tornando o open source mais inclusivo

A Red Hat está comprometida em substituir a linguagem problemática em nosso código, documentação e propriedades da web. Para mais detalhes veja o Blog da Red Hat.

Sobre a Red Hat

Fornecemos soluções robustas que facilitam o trabalho das empresas em plataformas e ambientes, desde o data center principal até a borda da rede.

Theme

© 2025 Red Hat