![]() ![]() To configure IDENT authentication, add entries to the /etc/postgresql/12/main/pg_nf file. ![]() Locate the line #listen_addresses = ‘localhost’ and change it to: listen_addresses = '*' To enable other computers to connect to your PostgreSQL server, edit the file /etc/postgresql/12/main/nf There are detailed comments in the file to guide you. To allow both IPv4 and IPv6 connections replace ‘localhost’ with ‘::’įor details on other parameters, refer to the configuration file or to the PostgreSQL documentation for information on how they can be edited. Run the following command at a terminal prompt to connect to the default PostgreSQL template database: sudo -u postgres psql template1 Now that we can connect to our PostgreSQL server, the next step is to set a password for the postgres user. The above command connects to PostgreSQL database template1 as user postgres. Once you connect to the PostgreSQL server, you will be at a SQL prompt. You can run the following SQL command at the psql prompt to configure the password for the user postgres. From a terminal prompt enter the following to restart PostgreSQL: sudo systemctl restart rvice #SAMPLE POSTGRESQL DATABASE FOR PSEQUEL PASSWORD#ĪLTER USER postgres with encrypted password 'your_password' Īfter configuring the password, edit the file /etc/postgresql/12/main/pg_hba.conf to use MD5 authentication with the postgres user: local all postgres md5įinally, you should restart the PostgreSQL service to initialize the new configuration. The above configuration is not complete by any means. Please refer to the PostgreSQL Administrator’s Guide to configure more parameters. You can test server connections from other machines by using the PostgreSQL client. Replace the domain name with your actual server domain name. Here is presented a very basic and simple way to replicate a PostgreSQL server (master) in a standby server.įirst, create a replication user in the master to be used by the standby server: $ sudo -u postgres createuser -replication -P -e replicator PostgreSQL has a nice feature called Streaming Replication which provides the capability to continuously ship and apply the WAL XLOG records to some number of standby servers in order to keep them current. Let’s configure the master server to turn on the streaming replication.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |