このコンテンツは選択した言語では利用できません。
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:
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
rhc server add server.name.example.com
$ rhc server add server.name.example.comrhc server add server.name.example.com
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:
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
Note that when adding a server with the server name of
rhc server add server.name.example.com --nickname Server_Nickname
$ 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
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:
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
The client tools automatically manage users when you switch between servers.
rhc server add server.name.example.com --nickname Server_Nickname --rhlogin user@company.com
$ 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
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:
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
If you assigned a nickname to a server, you can replace this with the server host name:
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
rhc server use server.name.example.com
$ rhc server use server.name.example.comrhc server use server.name.example.com
rhc server use Server_Nickname
$ rhc server use Server_Nicknamerhc server use Server_Nickname
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
Configure any server settings with the following command, replacing Server_Setting with the desired server setting:
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
If you assigned a nickname to a server, you can replace this with the server host name:
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
rhc server configure server.name.example.com 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
rhc server configure Server_Nickname Server_Setting
$ 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
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
$ rhc server configure dev.openshift.company.com --nickname dev
Example 4.3. Changing the Default User
rhc server configure dev --rhlogin username@example.com
$ rhc server configure dev --rhlogin username@example.com
4.1.4. Listing Servers リンクのコピーリンクがクリップボードにコピーされました!
リンクのコピーリンクがクリップボードにコピーされました!
List any servers you have added with the following command:
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
rhc server list
$ rhc server list
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:
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
If you assigned a nickname to a server, you can replace this with the server host name:
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
rhc server show server.name.example.com
$ rhc server show server.name.example.comrhc server show server.name.example.com
rhc server show Server_Nickname
$ rhc server show Server_Nicknamerhc server show Server_Nickname
4.1.6. Removing a Server リンクのコピーリンクがクリップボードにコピーされました!
リンクのコピーリンクがクリップボードにコピーされました!
Remove a server with the following command:
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
If you assigned a nickname to a server, you can replace this with the server host name:
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
rhc server remove server.name.example.com
$ rhc server remove server.name.example.comrhc server remove server.name.example.com
rhc server remove Server_Nickname
$ rhc server remove Server_Nicknamerhc server remove Server_Nickname
Note
You cannot remove the server you are currently using.