Back to Blog
Centos install postgres5/31/2023 ![]() ![]() If you’re not able to connect, verify the correct ports are open with firewall.We’ll only have to change the Name and Location to connect, which would be: We should be able to connect to the database from a client by selecting “Connect to database” from DaVinci.Once this is done, we can then reload the firewall, as well as the postgres service to update the firewall-cmd systemctl restart postgresql.Finally, we’ll have to enable ports 5234 for tcp and udp so it can communicate with the clients, we can do this with “for i in “tcp” “udp” do firewall-cmd –permanent for i in "tcp" "udp" do firewall-cmd -permanent -add-port=5432/$i done.Note that the password must be set to “DaVinci” Once in the postgres shell, we’ll enter the password configuration with “\password”.Once we have this done, we’ll have to configure the postgres database as the postgres user, we do this by entering the postgres shell as postgres user with “sudo -u postgres sudo -u postgres psql.Once we do that, we’ll have to edit the pg_hba.conf with “vim pg_hba.conf” Once there we’ll go to the IPv4 connection section, comment out everything, and then enter in our own setting with “host all all SERVER_IP_RANGE/NETMASK vim pg_hba.conf.Once in here, we’ll have to edit the conf file to specify the listening address’ with “vim nf” Once there we can go to the listening addresses section and change it to listen_addresses = vim nf. ![]() Once we have the service running, we’ll have to cd into the postgresql directory with “cd cd /var/lib/pgsql/data/.Then we can enable the postgres service with “systemctl enable –now systemctl enable -now postgresql.Next, we’ll initialize the database, we do this with “postgresql-setup postgresql-setup initdb.We can do this with “yum install postgresql yum install postgresql postgresql-server We need to edit the PostgreSQL configuration for the RoR installation to. ![]()
0 Comments
Read More
Leave a Reply. |