Note: All of the following config options can be set in
/etc/simp/simp-console.yaml
There is no default database so you must define a PostgreSQL connection string in simp-console.yaml
using one of the following formats
main.database: postgres://ip_address:port/database
main.database.options:
user: user
password: password
main.database: "postgres://"
main.database.options:
user: user
password: password
host: ip_address
port: port
database: database
You can specify additional general and PostgreSQL specific options using main.database.options
.
Follow the instructions below to configure a PostgreSQL database on the same host as the simp-console service.
Install PostgreSQL.
yum -y install postgresql-server
Initialize the database.
postgresql-setup initdb
Enable password authentication for localhost.
sed -i \
-e '/^host\s*all\s*all\s*[0-9:./]*\s*ident$/ s|ident|md5|' \
/var/lib/pgsql/data/pg_hba.conf
Enable and start the database service.
systemctl enable postgresql
systemctl start postgresql
Set up the database for simp-console. (In the example below, we’re using simp_console
for both the database name and the user name. Replace the string REPLACE_ME
below with a password generated for the simp_console
database user.)
runuser -l postgres -c "psql" <<END
create database simp_console;
create user simp_console with encrypted password 'REPLACE_ME';
grant all privileges on database simp_console to simp_console;
END
Configure simp-console to use the database we just created. (Again, replace the string REPLACE_ME
with the password used in the previous step.)
echo "main.database: 'postgres://simp_console:REPLACE_ME@localhost/simp_console'" >> /etc/simp/simp-console.yaml
To migrate a SQLite database to PostgreSQL, use the simp-console migrate
command.
By default, the SIMP Console configures a table prefix for all database tables it manages. This allows admins the capability to run multiple SIMP Console instances using the same underlying database. For example, one could have tables with the names production
, staging
, and dev
all within the same database.
The default prefix is production, but it can be changed. For example, this creates all database tables with dev_ in front of them.
main.database_table_prefix: dev