The Nok Nok S3 CDT package includes helper scripts that provision an operational database instance to get your test or development deployment up and running quickly. The helper scripts provided are already configured to create and use either a Postgres or a MySQL database instance for your operational data. Instructions for Option 1 outlines how to use these scripts to provision your operational database.
If you want to deploy the CDT with an Oracle or a CockroachDB database, or if you already have a database that you would like to use, then you have to install the database instance yourself. We call this Option 2 "BYODb" for "Bring Your Own Database." The Nok Nok CDT package does not contain scripts for this option, but instructions for Option 2 outlines how to configure the CDT to work with your database.
Option 1: Use the CDT to Provision the Database Instance
All of the configurations required to provision a Postgres or MySQL database instance are pre-configured in the CDT helper scripts. This includes a default password for the database connection. The following instructions use the CDT to prepare and provision the database.
Change the default password for the CDT-provisioned database instance.
Edit either the $NN_CDT_HOME/postgres/.env or the $NN_CDT_HOME/mysql/.env file. Replace the default value of the NN_AUTHDB_USER_PASSWORD field with your new password.
In addition, edit either the $NN_CDT_HOME/nns3/postgres.env or the $NN_CDT_HOME/nns3/mysql.env file.Replace the default value of the NN_AUTHDB_USER_PASSWORD field with your new password.
Provision the database instance(s).
cd ${NN_CDT_HOME}
bin/deploy_db.shOption 2: Bring Your Own Database Instance (BYODb)
The Nok Nok CDT package supports a Postgres, MySQL, Oracle or CockroachDB database to store the operational data for your deployment. The following instructions describe how to configure the CDT scripts to work with your BYODb instance. Your database should already be installed, but it does not have to be on the same server as the Nok Nok S3 Suite.
When you create the database, specify the UTF-8 character encoding so that Unicode characters can be stored. See Install on Linux.
Find the .env file in the ${NN_CDT_HOME}/nns3 directory that corresponds to your type of database: postgres.env, mysql.env, oracle.env or cockroachdb.env. The following table lists the properties to change in the .env file that corresponds to your type of database.
Property | Description |
|---|---|
NN_AUTHDB_HOST | Hostname or IP address where the database is reached |
NN_AUTHDB_LISTENER_PORT | Port number where the database server is listening |
NN_AUTHDB_JDBC_CONNECTION_PROPERTIES | Optional: JDBC connection properties. |
NN_AUTHDB_JDBC_DRIVER_CLASS | Optional: JDBC driver class name. |
NN_AUTHDB_JDBC_JAR | Optional: Third party JDBC jar file name. |
NN_AUTHDB_JNDI_JDBC_URL | The JNDI JDBC URL to connect to the database. |
NN_DATASOURCE_FACTORY | Optional: DataSource factory class name. |
NN_AUTHDB_LISTENER_PORT | Port number where the database server is listening |
NN_AUTHDB_NAME | Database name |
NN_AUTHDB_USER_NAME | Database username |
NN_AUTHDB_USER_PASSWORD | Password for the database user |