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

Chapter 4. Multiple OpenShift Servers


As outlined in the OpenShift Enterprise Client Tools Installation Guide, previous versions of the client tools were configured for use with a single OpenShift server at a time. The configuration settings in the ~/.openshift/express.conf file would be overwritten each time the client tools were configured for use with a new server. Starting with OpenShift Enterprise 2.1.5, you can configure the client tools shipped with OpenShift Enterprise for use with multiple servers.
Configuring the client tools for multiple servers is useful for when you are using a single workstation to manage different applications hosted across multiple servers. For example, if your organization is using different OpenShift Enterprise servers for development, production, and testing, and you have an OpenShift Online account for personal use, you can manage applications on any of these servers from the same workstation without overwriting your client tools configuration each time.

4.1. Server Management

4.1.1. Adding a Server

Add an OpenShift server with the following command:
$ rhc server add server.name.example.comrhc server add server.name.example.com
Copy to Clipboard Toggle word wrap
This can be an OpenShift Enterprise, OpenShift Online, or OpenShift Origin server.
When adding a server, you can assign it a nickname to make it easier to reference in any future commands:
$ rhc server add server.name.example.com --nickname Server_Nicknamerhc server add server.name.example.com --nickname Server_Nicknamerhc server add server.name.example.com --nickname Server_Nicknamerhc server add server.name.example.com --nickname Server_Nickname
Copy to Clipboard Toggle word wrap
Note that when adding a server with the server name of openshift.redhat.com, the nickname defaults to online.
When adding a server, specifying a user name associates that user with the server, and you can have different user names with each server:
$ rhc server add server.name.example.com --nickname Server_Nickname --rhlogin user@company.comrhc server add server.name.example.com --nickname Server_Nickname --rhlogin user@company.comrhc server add server.name.example.com --nickname Server_Nickname --rhlogin user@company.comrhc server add server.name.example.com --nickname Server_Nickname --rhlogin user@company.comrhc server add server.name.example.com --nickname Server_Nickname --rhlogin user@company.comrhc server add server.name.example.com --nickname Server_Nickname --rhlogin user@company.com
Copy to Clipboard Toggle word wrap
The client tools automatically manage users when you switch between servers.

4.1.2. Switching Between Servers

When the client tools have been configured for multiple servers, switch to the desired server with the following command:
$ rhc server use server.name.example.comrhc server use server.name.example.com
Copy to Clipboard Toggle word wrap
If you assigned a nickname to a server, you can replace this with the server host name:
$ rhc server use Server_Nicknamerhc server use Server_Nickname
Copy to Clipboard Toggle word wrap

4.1.3. Configuring Server Settings

When you run the rhc setup command for the first time, the ~/.openshift/express.conf file is created, containing the settings for your initial server configuration. When you add another server, or run the rhc setup command again with the --server option, the ~/.openshift/servers.yml file is created, containing the settings for each server. You can edit this file to make any changes to the server configuration, and this takes precedence over the initial ~/.openshift/express.conf file.

Example 4.1. Contents of the ~/.openshift/servers.yml File

-server:
	hostname: dev.openshift.company.com
	nickname: development
	login: user@company.com
	use_authorization_tokens: true
	insecure: true
		
-server
	hostname: openshift.redhat.com
	nickname: online
	login: user@personal.com
	use_authorization_tokens: true
	insecure: false
Copy to Clipboard Toggle word wrap
Configure any server settings with the following command, replacing Server_Setting with the desired server setting:
$ rhc server configure server.name.example.com Server_Settingrhc server configure server.name.example.com Server_Settingrhc server configure server.name.example.com Server_Settingrhc server configure server.name.example.com Server_Setting
Copy to Clipboard Toggle word wrap
If you assigned a nickname to a server, you can replace this with the server host name:
$ rhc server configure Server_Nickname Server_Settingrhc server configure Server_Nickname Server_Settingrhc server configure Server_Nickname Server_Settingrhc server configure Server_Nickname Server_Setting
Copy to Clipboard Toggle word wrap
You can use this command to configure any settings found in the ~/.openshift/servers.yml file, such as the server nickname, the user name associated with the server, or any authorization tokens associated with the account.

Example 4.2. Changing the Nickname of a Server

$ rhc server configure dev.openshift.company.com --nickname dev
Copy to Clipboard Toggle word wrap

Example 4.3. Changing the Default User

$ rhc server configure dev --rhlogin username@example.com
Copy to Clipboard Toggle word wrap

4.1.4. Listing Servers

List any servers you have added with the following command:
$ rhc server list
Copy to Clipboard Toggle word wrap
Alternatively, you can list servers with the rhc servers command.

4.1.5. Viewing a Server

To see information about a specific server, use the following command:
$ rhc server show server.name.example.comrhc server show server.name.example.com
Copy to Clipboard Toggle word wrap
If you assigned a nickname to a server, you can replace this with the server host name:
$ rhc server show Server_Nicknamerhc server show Server_Nickname
Copy to Clipboard Toggle word wrap

4.1.6. Removing a Server

Remove a server with the following command:
$ rhc server remove server.name.example.comrhc server remove server.name.example.com
Copy to Clipboard Toggle word wrap
If you assigned a nickname to a server, you can replace this with the server host name:
$ rhc server remove Server_Nicknamerhc server remove Server_Nickname
Copy to Clipboard Toggle word wrap

Note

You cannot remove the server you are currently using.
トップに戻る
Red Hat logoGithubredditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

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

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

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

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

会社概要

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

Theme

© 2025 Red Hat