Add multiple configurations
If you are using multiple profiles for multiple environments, you can configure the CLI to recognize them.
To do that, use the cb configure
command and pass the name of your
environment-specific profile file in the --profile
parameter.
After running the command, the configuration will be added as a new entry to the
config
file. For example, running the following command cb
configure --server https://192.167.65.4 --username test@hortonworks.com --profile
staging
will add the “staging” entry:
default:
username: test1@cloudera.com
server: https://192.167.65.4
staging:
username: test2@cloudera.com
server: https://192.167.65.4
Example
#cb configure --server https://192.167.65.4 --username test2@cloudera.com --profile staging
INFO: [writeConfigToFile] dir already exists: /Users/rkovacs/.cb
INFO: [writeConfigToFile] writing credentials to file: /Users/rkovacs/.cb/config
# cat /Users/rkovacs/.cb/config
default:
username: test1@cloudera.com
server: https://192.167.65.4
output: table
staging:
username: test2@cloudera.com
server: https://192.167.65.4