Este contenido no está disponible en el idioma seleccionado.

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.
Volver arriba
Red Hat logoGithubredditYoutubeTwitter

Aprender

Pruebe, compre y venda

Comunidades

Acerca de la documentación de Red Hat

Ayudamos a los usuarios de Red Hat a innovar y alcanzar sus objetivos con nuestros productos y servicios con contenido en el que pueden confiar. Explore nuestras recientes actualizaciones.

Hacer que el código abierto sea más inclusivo

Red Hat se compromete a reemplazar el lenguaje problemático en nuestro código, documentación y propiedades web. Para más detalles, consulte el Blog de Red Hat.

Acerca de Red Hat

Ofrecemos soluciones reforzadas que facilitan a las empresas trabajar en plataformas y entornos, desde el centro de datos central hasta el perímetro de la red.

Theme

© 2025 Red Hat