このコンテンツは選択した言語では利用できません。

2.5. Creating Environment Variables on Node Hosts


With the release of OpenShift Enterprise 2.1, you can provide environment variables for all applications on a node host by specifying them in the /etc/openshift/env directory. By creating a file in the /etc/openshift/env directory on a node host, an environment variable is created with the same name as the file name, and the value being set to the contents of the file.
Environment variables set in the /etc/openshift/env directory are only set for gear users, and not for system services or other users on the node host. For example, the MCollective service does not have access to these settings during the gear and cartridge creation process.
Application owners can use the rhc env set command to override any environment variables set in the /etc/openshift/env directory.

Procedure 2.4. Creating Environment Variables on a Node Host

  1. Create a new file in the /etc/openshift/env directory on the node hosts that you want the environment variable set. For example, to allow applications to use an external database, set an external database environment variable EXT_DB_CONNECTION_URL with the value of mysql://host.example.com:3306/
    # echo mysql://host.example.com:3306/ > /etc/openshift/env/EXT_DB_CONNECTION_URLecho mysql://host.example.com:3306/ > /etc/openshift/env/EXT_DB_CONNECTION_URLecho mysql://host.example.com:3306/ > /etc/openshift/env/EXT_DB_CONNECTION_URLecho mysql://host.example.com:3306/ > /etc/openshift/env/EXT_DB_CONNECTION_URL
    Copy to Clipboard Toggle word wrap
  2. To make the changes take effect for existing applications, ask affected application owners to restart their applications by running the following commands:
    $ rhc app stop -a appnamerhc app stop -a appname
    $ rhc app start -a appnamerhc app start -a appname
    Copy to Clipboard Toggle word wrap
    Alternatively, you can restart all gears on affected node hosts. The downtime caused by restarting all gears is minimal and around a few seconds.
    # oo-admin-ctl-gears restartall
    Copy to Clipboard Toggle word wrap
トップに戻る
Red Hat logoGithubredditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

Red Hat ドキュメントについて

Red Hat をお使いのお客様が、信頼できるコンテンツが含まれている製品やサービスを活用することで、イノベーションを行い、目標を達成できるようにします。 最新の更新を見る.

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

Theme

© 2025 Red Hat