The Cloudera Manager Server database stores information about service and host configurations. For demonstration and proof-of-concept deployments you can use an embedded PostgreSQL database.
Syntax to use prepare external database for CM:
scm_prepare_database.sh <database-type> [options] <database-name> <username> <password>
- Database-type: Supported database types: MariaDB or MySQL- mysql; Oracle – oracle
- PostgreSQL – postgresql
- Database-name: give database name where CM related data will be stored
- Username and password with which CM Server database can be created and accessed
- We also have options to specify host and port number etc. in order to connect mysql server.
Here are the steps to prepare mysql database:
- First, we need to stop the CM server if is running.
sudo service cloudera-scm-server stop
- Execute database script. The following example to setup mysql which is running on the same cluster with a database name ‘scm’ and with username ‘root’ and password ‘itversity’.
sudo /usr/share/cmf/schema/scm_prepare_database.sh mysql -h localhost scm root itversity
You see similar output once it update the db properties settings.
Verifying that we can write to /etc/cloudera-scm-server Creating SCM configuration file in /etc/cloudera-scm-server Executing: /usr/java/jdk1.7.0_67-cloudera/bin/java -cp /usr/share/java/mysql-connector-java.jar:/usr/share/java/oracle-connector-java.jar:/usr/share/cmf/schema/../lib/* com.cloudera.enterprise.dbutil.DbCommandExecutor /etc/cloudera-scm-server/db.properties com.cloudera.cmf.db. [ main] DbCommandExecutor INFO Successfully connected to database.
All done, your SCM database is configured correctly!
- Start CM Server once configured with custom data base
sudo service cloudera-scm-server start