Questo contenuto non è disponibile nella lingua selezionata.
12.7. Switching Between Multiple OpenShift Environments
The client tools now support the environment variable
OPENSHIFT_CONFIG, which overrides the default configuration file that the client tools will read from. This enables specifying only once the configuration file rather than having to specify it every time using the --config option. See Section 12.6, “Using Multiple OpenShift Configuration Files”. When you define the OPENSHIFT_CONFIG setting in your environment, the client tool will read the defined configuration file.
Procedure 12.3. To Switch Between OpenShift Environments
- Set the
OPENSHIFT_CONFIGenvironment variable under a bash shell using the following command:export OPENSHIFT_CONFIG=bob
# export OPENSHIFT_CONFIG=bobCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Run
rhc setupto create the new configuration file: ~/.openshift/bob.conf. Specify which broker server you want to connect to using the--serveroption:rhc setup --server broker.example.com
# rhc setup --server broker.example.comCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Verify that you are connected to the defined environment by running an
rhccommand:rhc domain show
# rhc domain showCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Restore to default configuration by removing the value in
OPENSHIFT_CONFIGwith the following command:export OPENSHIFT_CONFIG=
# export OPENSHIFT_CONFIG=Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Note
Authentication tokens are stored locally based on the broker server and the username, so you do not need to sign in again as you switch between servers.
To check which broker server you are currently configured to use, run the following command:
rhc account
# rhc account