- Neueste
- Die meisten Stimmen
- Die meisten Kommentare
I doubt that changing the port will make any difference...
You may want to review the memory usage of the EC2 and see if its being exhausted. You may also want to review the Server logs to see why its stopping.
Thanks Gary. My web server (Apache TomEE) is working normally. The problem is only related to the Postgres database. I will try to see, as you said, if it is a problem of memory usage of EC2.
Thanks Gary. My web server (Apache TomEE) is working normally. The problem is only related to the Postgres database. I will try to see, as you said, if it is a problem of memory usage of EC2.
Thanks Gary. My web server (Apache TomEE) is working normally. The problem is only related to the Postgres database. I will try to see, as you said, if it is a problem of memory usage of EC2.
Thanks Gary. My web server (Apache TomEE) is working normally. The problem is only related to the Postgres database. I will try to see, as you said, if it is a problem of memory usage of EC2.
Thanks Gary. My web server (Apache TomEE) is working normally. The problem is only related to the Postgres database. I will try to see, as you said, if it is a problem of memory usage of EC2.
-
Verify Port Status: Before attempting to modify the port, confirm whether port 5432 is currently open or closed. You can use tools like telnet, netstat, or firewall management interfaces to check the port status.
-
Check for Conflicts: Ensure that there are no other applications or services currently using port 5432. Port conflicts can prevent PostgreSQL from binding to the specified port.
-here's a step-by-step guide to changing the TCP port number for PostgreSQL in Linux:
Check Current Port Configuration:
First, confirm the current port configuration for PostgreSQL. You can typically find this information in the PostgreSQL configuration file (postgresql.conf). Look for the port directive. Alternatively, you can use the netstat command to check which port PostgreSQL is currently listening on:
netstat -tuln | grep postgres
Identify Firewall Software: Determine which firewall software you are using on your Linux system. Common firewall software on Linux includes iptables (legacy) and firewalld (more common in recent distributions). You'll use different commands depending on the firewall software.
Modify Firewall Rules:
Let's assume you're using firewalld which is common on modern Linux distributions like Fedora, CentOS, and RHEL. To modify the firewall rules, first, identify the service associated with PostgreSQL:
firewall-cmd --get-services | grep postgres
Open New Port:
If there isn't a predefined service for PostgreSQL, you can manually add the port:
firewall-cmd --zone=public --add-port=5432/tcp --permanent
Reload Firewall Configuration:
After adding the new port, reload the firewall configuration to apply the changes:
firewall-cmd --reload
Verify Changes:
Check if the new port is now open in the firewall:
firewall-cmd --zone=public --list-ports
Update PostgreSQL Configuration:
Open the PostgreSQL configuration file (postgresql.conf) with a text editor like nano or vi:
sudo nano /etc/postgresql/<version>/main/postgresql.conf
Find the port directive and change the port number to 5432 or the new port you specified.
Restart PostgreSQL Service:
After updating the configuration, restart the PostgreSQL service for the changes to take effect:
sudo systemctl restart postgresql
Test Connectivity:
Verify that PostgreSQL is now listening on the new port:
netstat -tuln | grep postgres
Additionally, test connectivity to PostgreSQL from remote hosts using the new port.
Thanks! I will try to apply your recommendations and I will let you know what happens.
Relevanter Inhalt
- AWS OFFICIALAktualisiert vor 3 Jahren
Can you please write question in more detail, where is your Postgres’s and what is the firewall ?
If the input field for modifying the firewall rule is inactive, it's possible that your user account may not have the necessary permissions to make changes to firewall settings. You may need to check if you have the appropriate permissions or if there are any restrictions in place that prevent modifications