database create
Registers an existing external database with Cloudbreak.
Sub-commands
mysql
Registers a MySQL database configuration
oracle11
Registers an Oracle 11 database configuration
oracle12
Registers an Oracle 12 database configuration
postgres
Registers a Postgres database configuration
Required options
--name [$VALUE]
Name for the database
--db-username [$VALUE]
Username for the JDBC connection
--db-password [$VALUE]
Password for the JDBC connection
--url [$VALUE]
JDBC connection URL in the form jdbc:db-type://address:port/db
--type [$VALUE]
Name if the service that will use the database (AMBARI, DRUID, HIVE, OOZIE, RANGER,
SUPERSET, or other custom type)
If using MySQL and Oracle, the
--connector-jar-url value [$VALUE]
parameter is required in all cases except the following: If you are using a custom
image and you already placed the JAR file on the machine, then this parameter is not
required.
Options
--description [$VALUE]
Description for the database
--server [$VALUE]
Cloudbreak server address [$CB_SERVER_ADDRESS]
--username [$VALUE]
Cloudbreak user name (e-mail address) [$CB_USER_NAME]
--password [$VALUE]
Cloudbreak password [$CB_PASSWORD]
--workspace [$VALUE]
Name of the workspace holding the resource
--profile [$VALUE]
Selects a config profile to use [$CB_PROFILE]
--auth-type [$VALUE]
Authentication method to use. Values: oauth2, basic [$CB_AUTH_TYPE]
Examples
Registers an existing Postgres database called “test-postgres” with Cloudbreak:
cb database create postgres --name testpostgres --type HIVE --url jdbc:postgresql://test-db.cic6nusrpqec.us-west-2.rds.amazonaws.com:5432/testdb --db-username testuser --db-password MySecurePassword123
The connection URL includes three components db-type://address:port/db:
- Database type “jdbc:postgresql”
- Endpoint “test-db.cic6nusrpqec.us-west-2.rds.amazonaws.com:5432”
- Port “5432”
- Database name “testdb”
Registers an existing MySQL database called “testmysql” with Cloudbreak:
cb database create mysql --name testmysql --type OOZIE --url jdbc:mysql://test-db.cic6nusrpqec.us-west-2.rds.amazonaws.com:5432/testdb --db-username test --db-password test --connector-jar-url http://example-page/driver-file.JAR
Note | |
---|---|
Make sure to specify JDBC connection URL in the form
|