Обсуждение: Cannot start a cluster
Hello, Thank you for reading my post. I am a novice PostgreSQL user. ---- OS: Windows 8.1 Pro ---- PostgreSQL: 9.4.1 ---- Commands are issued in command line in "cmd.exe" ran as user "postgres". Some time ago, I created a cluster "my_cluster_1" with a database inside "my_db_1". Today, when I try to start the cluster, here is what happens: ============================================================================== windows_cmd.exe_ran_as_user_postgres> pg_ctl start -o "-p 5449" -D my_cluster_1 server starting windows_cmd.exe_ran_as_user_postgres> psql -p 5449 psql: could not connect to server: Connection refused (0x0000274D/10061) Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 5449? could not connect to server: Connection refused (0x0000274D/10061) Is the server running on host "localhost" (127.0.0.1) and accepting TCP/IP connections on port 5449? ============================================================================== Question 1: How can I investigate what the problem is? Is there a log file somewhere? Question 2: Given the messages above, can you see what's wrong and how to fix the problem? Note that I do not experience this problem with another cluster that I have: ============================================================================== windows_cmd.exe_ran_as_user_postgres> pg_ctl start -o "-p 5450" -D my_cluster_2 server starting LOG: database system was shut down at 2015-11-25 10:29:17 CET LOG: database system is ready to accept connections LOG: autovacuum launcher started windows_cmd.exe_ran_as_user_postgres> psql -p 5450 psql (9.4.1) WARNING: Console code page (437) differs from Windows code page (1252) 8-bit characters might not work correctly. See psql reference page "Notes for Windows users" for details. Type "help" for help. postgres=# \c my_db_2 WARNING: Console code page (437) differs from Windows code page (1252) 8-bit characters might not work correctly. See psql reference page "Notes for Windows users" for details. You are now connected to database "my_db_2" as user "postgres". my_db_2=# ============================================================================== Thank you for helping. Best regards. -- View this message in context: http://postgresql.nabble.com/Cannot-start-a-cluster-tp5875045.html Sent from the PostgreSQL - novice mailing list archive at Nabble.com.
Léa Massiot wrote: > Today, when I try to start the cluster, here is what happens: > ============================================================================== > windows_cmd.exe_ran_as_user_postgres> pg_ctl start -o "-p 5449" -D > my_cluster_1 > server starting > > windows_cmd.exe_ran_as_user_postgres> psql -p 5449 > psql: could not connect to server: Connection refused (0x0000274D/10061) > Is the server running on host "localhost" (::1) and accepting > TCP/IP connections on port 5449? Can you check with Task Manager if the PostgreSQL server processes are running? Look into the server log file to see what happened: In your cluster directory there is a file postgresql.conf. Check the following entries: log_destination logging_collector log_directory log_filename They should help you to find the log file. Yours, Laurenz Albe
Hello and thank you for your answer. > Can you check with Task Manager if the PostgreSQL server processes are > running? No: no PostgreSQL processes are running. About the log file: With the cluster that I can start (the one associated with the port 5450), if I use the command: windows_cmd.exe_ran_as_user_postgres> pg_ctl start -o "-p 5450" -D my_cluster_2 -l "D:\somewhere\pg_logs_2.txt" The file "pg_logs_2.txt" is created and written. With the cluster that I CANNOT start (the one associated with the port 5449), if I use the command: windows_cmd.exe_ran_as_user_postgres> pg_ctl start -o "-p 5449" -D my_cluster_1 -l "D:\somewhere\pg_logs_1.txt" The file "pg_logs_1.txt" is created but nothing is written in it. So I still have no clue about what's going wrong. Thank you for helping. Best regards. Léa -- View this message in context: http://postgresql.nabble.com/Cannot-start-a-cluster-tp5875045p5875066.html Sent from the PostgreSQL - novice mailing list archive at Nabble.com.
2015-11-25 10:55 GMT-02:00 Léa Massiot <lmhelp1@orange.fr>:
Hello and thank you for your answer.
> Can you check with Task Manager if the PostgreSQL server processes are
> running?
No: no PostgreSQL processes are running.
About the log file:
With the cluster that I can start (the one associated with the port 5450),
if I use the command:
windows_cmd.exe_ran_as_user_postgres> pg_ctl start -o "-p 5450" -D
my_cluster_2 -l "D:\somewhere\pg_logs_2.txt"
The file "pg_logs_2.txt" is created and written.
With the cluster that I CANNOT start (the one associated with the port
5449), if I use the command:
windows_cmd.exe_ran_as_user_postgres> pg_ctl start -o "-p 5449" -D
my_cluster_1 -l "D:\somewhere\pg_logs_1.txt"
The file "pg_logs_1.txt" is created but nothing is written in it.
So I still have no clue about what's going wrong.
Thank you for helping.
Best regards.
Léa
--
View this message in context: http://postgresql.nabble.com/Cannot-start-a-cluster-tp5875045p5875066.html
Sent from the PostgreSQL - novice mailing list archive at Nabble.com.--
Sent via pgsql-novice mailing list (pgsql-novice@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-novice
Some questions:
Is there any chance that this port ("5449") is already in use by another process? I believe you can check it using netstat (or any other tool of preference of course)
Have you tried using another port number ? I know that "5450" is up and running, but maybe the problem is related to starting two instances in parallel, so you could test another port (e.g.: 5451 instead of 5449) while 5450 is working.
Hope it helps you finding the source of the problem.
Hello and thank you for your answer. > Is there any chance that this port ("5449") is already in use by another > process? I just checked: this port is not already used by another process. > I know that "5450" is up and running No, I stopped the cluster. > Have you tried using another port number ? No, changing the port in the cluster's "postgresql.conf" configuration file ("port" parameter) doesn't change anything. Best regards. -- View this message in context: http://postgresql.nabble.com/Cannot-start-a-cluster-tp5875045p5875095.html Sent from the PostgreSQL - novice mailing list archive at Nabble.com.
Can you try to increase the log level and then see if anything is logged in the log file.
thanks, AmitOn Wed, Nov 25, 2015 at 8:40 PM, Léa Massiot <lmhelp1@orange.fr> wrote:
Hello and thank you for your answer.
> Is there any chance that this port ("5449") is already in use by another
> process?
I just checked: this port is not already used by another process.
> I know that "5450" is up and running
No, I stopped the cluster.
> Have you tried using another port number ?
No, changing the port in the cluster's "postgresql.conf" configuration file
("port" parameter) doesn't change anything.
Best regards.
--
View this message in context: http://postgresql.nabble.com/Cannot-start-a-cluster-tp5875045p5875095.htmlSent from the PostgreSQL - novice mailing list archive at Nabble.com.
--
Sent via pgsql-novice mailing list (pgsql-novice@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-novice
--
Amit Sharma
Hello Amit and others, Indeed, I incremented the log level and found out that the cluster had been created with a PostgreSQL server version 9.1 while I am now using a PostgreSQL server version 9.4. This is the reason why I cannot start the cluster. Thank you for your help. -- View this message in context: http://postgresql.nabble.com/Cannot-start-a-cluster-tp5875045p5875124.html Sent from the PostgreSQL - novice mailing list archive at Nabble.com.