Updating Databases with New User Passwords
Main PostgreSQL Database
The chapter PostgreSQL Configuration tells how to change the password for the "netrounds" user in a configuration file.
You also need to update the password in the following files:
/etc/netrounds/netrounds.conf
/etc/netrounds/plugin.yaml
/etc/netrounds/probe-connect.conf
Furthermore, you must update that user's role in the database. How to do that is explained below.
-
Log in to the database using:
sudo -u postgres psql
-
Inside the database, execute this command (substituting the correct new password):
ALTER ROLE netrounds WITH PASSWORD 'securePassword';
The relevant PostgreSQL documentation is found here: www.postgresql.org/docs/9.0/sql-alterrole.html
Another option is to run the following after logging in to the database:
\password netrounds
and then provide the password twice.
After changing the password in the database as well as in the configuration files, reboot the system:
sudo reboot
Using Special Characters in the Password
In the ALTER ROLE
query, if the character used to surround the password
string occurs in the password itself, that character must be escaped. The escape character
is a single quote (').
Suppose you want to set the password #secure
. To this end, run the
query
ALTER ROLE netrounds WITH PASSWORD ''#secure';
However, if you run
\password netrounds
you can enter any password characters without escaping them.
TimescaleDB Database
To change the password for the paa
user, do the following:
-
Connect to the database as the
paa
user (passwordpaa
). Full details on how to do this are found in the document Querying Metrics in TimescaleDB, chapter Preparations.Then run:
ALTER USER paa PASSWORD 'new_password';
-
In the file
/etc/netrounds/metrics.yaml
, enter the new password in the fielddb-password
. Then restart the netrounds-metrics service:sudo systemctl start netrounds-metrics
To change the password for the paaread
user, do the following:
-
Connect to the database as the
paaread
user (passwordpaaread
) and runALTER USER paaread PASSWORD 'new_password';
Streaming API
Regaring authentication for accessing Kafka via the Streaming API, see the document Streaming API Guide, chapter Configuring the Streaming API.