Note: All of the following config options can be set in
/etc/simp/simp-console.yml
Without any configuration, SIMP Console stores its settings in a SQLite database located in /var/db/simp/simp-console.db
. While this is sufficient for small sites or demonstration purposes it is recommended to use PostgreSQL for larger sites.
Make sure the SIMP Console user has read and write access to the file and its containing directory. Specify a full URL to the database you want to connect to, and the username and password to authenticate.
main.database: 'sqlite:///path/to/location/simp-console.db'
You can also specify additional general and PostgreSQL specific options using main.database.options
.
main.database.options:
database: simp-console-database
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.yml
Alternatively, you can also configure the Simp Console to use a PostgreSQL database through simp-console.yml
using one of the following formats
main.database: postgres://user:password@ip_address:port/database
main.database: 'postgres://ip_address:port/database?user=user&password=password'
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
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