Configure PostgreSQL database access

You can store your PostgreSQL credentials in the secure credentials vault. To do this, use the scvcli command line utility to add the credentials, and reference these credentials in opennms-datasources.xml:

  1. Create encrypted credentials for the PostgreSQL database connections:

    sudo -u opennms ${OPENNMS_HOME}/bin/scvcli set postgres opennms password (1)
    sudo -u opennms ${OPENNMS_HOME}/bin/scvcli set postgres-admin postgres password
    1 Replace both password instances with the actual passwords for your opennms and postgres database accounts.
  2. Edit opennms-datasources.xml with vi:

    sudo -u opennms vi /opt/opennms/etc/opennms-datasources.xml
  3. Set encrypted credentials to access the PostgreSQL database:

    <jdbc-data-source name="opennms"
                        database-name="opennms" (1)
                        class-name="org.postgresql.Driver"
                        url="jdbc:postgresql://localhost:5432/opennms"
                        user-name="${scv:postgres:username}" (2)
                        password="${scv:postgres:password}" /> (3)
    
    <jdbc-data-source name="opennms-admin"
                        database-name="template1"
                        class-name="org.postgresql.Driver"
                        url="jdbc:postgresql://localhost:5432/template1"
                        user-name="${scv:postgres-admin:username}" (4)
                        password="${scv:postgres-admin:password}" /> (5)
    1 Set the database name that Meridian should use.
    2 Set the user name to access the opennms database table.
    3 Set the password to access the opennms database table.
    4 Set the postgres user for administrative access to PostgreSQL.
    5 Set the password for administrative access to PostgreSQL.
Detect and assign Java environment and persist in /opt/opennms/etc/java.conf
sudo /opt/opennms/bin/runjava -s
Initialize the database and detect system libraries persisted in /opt/opennms/etc/libraries.properties
sudo /opt/opennms/bin/install -dis
Define any necessary startup configuration, such as open file descriptors or maximum Java heap
echo "JAVA_HEAP_SIZE=16384" | sudo tee ${OPENNMS_HOME}/etc/opennms.conf
echo "MAXIMUM_FILE_DESCRIPTORS=512000" | sudo tee ${OPENNMS_HOME}/etc/opennms.conf
These values are provided as examples; ideal values will vary based on your environment and workload
Enable Meridian core instance on system boot and start immediately
sudo systemctl enable --now opennms
Allow connection to the web UI from your network
sudo firewall-cmd --permanent --add-port=8980/tcp
sudo systemctl reload firewalld