Содержание
- tap349
- problems with new homebrew versioning scheme
- psql: could not connect to server: Connection refused
- command not found: psql
- psql: could not connect to server: No such file or director
- Postgresql 9.3 в Ubuntu для веб-приложения Django Ошибка: cluster_port_ready: не удалось найти двоичный файл psql
- 2 ответа
- Postgresql 9.3 в Ubuntu для веб-приложения Django Ошибка: cluster_port_ready: не удалось найти двоичный файл psql
- 2 ответа
- Postgresql 9.3 в ubuntu для веб-приложения Django Ошибка: cluster_port_ready: не удалось найти двоичный файл psql
- 2 ответа
- Cannot create cluster at all
- Bisser
- Glowsome
- Bisser
- t.lamprecht
- t.lamprecht
- Bisser
- t.lamprecht
- Bisser
- t.lamprecht
- t.lamprecht
- Bisser
- t.lamprecht
- Bisser
- Glowsome
- Bisser
tap349
problems with new homebrew versioning scheme
running brew upgrade has created quite a mess for me because of a new versioning scheme: postgresql95 formula is replaced with postgresql@9.5 (this is because homebrew/core now supports multiple versions). but this migration was not smooth and resulted in many errors, to name a few:
invalid value for parameter «TimeZone»: «UTC»
should be fixed by restarting service or the whole system according to SO.
command not found: psql
psql must have a symlink in /usr/local/bin/ (it has been added to PATH in
/.zshenv in my case) — it’s gone now for some mysterious reason.
psql: FATAL: database «db_name» does not exist
this is because running brew upgrade has created new data directory for postgresql@9.5 (/usr/local/var/postgresql@9.5) while all my databases are stored in /usr/local/var/postgres.
solution
so this is what I did to fix problems mentioned above:
- brew untap ‘homebrew/versions’ (it’s deprecated now)
- brew untap ‘caskroom/versions’ (it’s deprecated now)
- brew uninstall postgresql postgresql95 postgresql@9.5 (remove everything)
- brew install postgresql@9.5 (install latest 9.5 version)
- brew switch postgresql@9.5 9.5.6 (switch to latest 9.5 version)
- brew prune postgresql@9.5 (remove old 9.5 versions — if any)
brew link postgresql@9.5 —force (create symlink in /usr/local/bin)
it’s not recommended though — it must be better to add bin directory of specific PostgreSQL installation to PATH explicitly in
cd /usr/local/var && mv postgres postgresql@9.5 (rename directory with databases)
it might be necessary to remove existing postgresql@9.5 directory beforehand that could be created when upgrading PostgreSQL (but still double check it doesn’t contain any databases).
rm /usr/local/Cellar/postgresql95 (remove symlink to postgresql@9.5 )
I guess it has been created for compatibility reasons.
NOTE: installing postgresql formula still installs the latest version (9.6 as of now) — all directories are named just postgresql accordingly. but its binaries are not symlinked into usr/bin/local directory by default (now they all point to 9.5 installation) — if you need it run brew link postgresql —force manually.
psql: could not connect to server: Connection refused
solution
the problem usually appears after hard reboot. the latter doesn’t allow PostgreSQL to exit gracefully and delete its PID files — postmaster.pid in particular. so upon reboot PostgreSQL thinks it’s still running and corresponding service fails to start.
so just delete that PID file and start the service:
or else try to restart the service (stopping the service might remove obsolete PID file — I didn’t try this method though):
command not found: psql
solution
in my case only versioned formula of PostgreSQL ( postgresql@9.5 ) was installed but it didn’t create a symlink to psql in /usr/local/bin/.
to solve this problem either:
install the latest version of PostgreSQL ( postgresql )
unversioned formula creates a symlink in /usr/local/bin/ automatically.
create symlinks for binaries from old version of PostgreSQL manually
add the whole bin/ from old version of PostgreSQL to PATH
psql: could not connect to server: No such file or director
solution
to diagnose this and similar problems run postgres in the foreground (see brew info postgresql output ):
it turns out /usr/local/var/postgres contains data for PostgreSQL 9.6 (when postgresql formula was installed, 9.6 was the latest version).
=> it’s necessary to migrate existing data from a previous major version (9.6) to the latest one (10) (see brew info postgresql output ):
this command will install a previous major version of PostgreSQL (if it has been uninstalled) which is required to upgrade database.
after upgrade is complete, you can remove old major version along with its data (/usr/local/var/postgres.old):
now make sure postgresql service is started:
Источник
Postgresql 9.3 в Ubuntu для веб-приложения Django Ошибка: cluster_port_ready: не удалось найти двоичный файл psql
У меня есть некоторые проблемы с Postgresql 9.3, работающей на Ubuntu 14.04.5
У меня было веб-приложение django, работающее с использованием NGINX/Gunicorn, в течение нескольких недель, а затем однажды я использовал его и получил ошибку OperationalError:
После исследования выяснилось, что сервер postgresql не работает. Затем я попытался запустить его и получил следующую ошибку:
Тревожно, но мои данные хорошо зарезервированы, поэтому я сделал:
и тогда я получил:
Нет проблем. Я скину его и создам новый, подумал я
что побежал нормально, и я побежал
снова, и теперь он создал кластер, по-видимому, но не запустится:
Кто-нибудь есть какие-либо советы о том, как решить эту проблему? Я сделал apt-get удалить и установить для postgresql, и все еще те же результаты.
Итак, я попробовал предложение ниже, чтобы выполнить следующее:
2 ответа
Поэтому я не смог восстановить экземпляр postgres, который пытался запустить, поэтому я воспользовался этой статьей о переполнении стека, как очистить и полностью удалить postgres. Что касается того, почему это произошло, я все еще в растерянности. Я прочитал, что моя проблема могла быть вызвана переменными среды локали для LANGUAGE и LANG_ALL. Или возможно, что это могло быть вызвано после обновления, потому что я не указал, какую версию postgres я хотел установить при первом запуске apt-get. Независимо от того, вот команды, которые я выполнил, которые вернули меня в бизнес:
После этой команды я снова получил несколько ошибок с жалобой на неверный каталог данных, поэтому по совету поста, который не помечен как ответ по ссылке выше, я также запустил:
Казалось, что все прошло хорошо, поэтому я вернулся к инструкциям, изложенным в принятом ответе:
Это завершилось без ошибок, за исключением того, что пользователь postgres уже был удален предыдущими командами.
Затем я удостоверился, что мои переменные окружения локали были установлены, на основе связанной статьи под названием: «Ошибка при обнаружении кластеров PostgresSQL не найдена»: #dpkg-configure locales
Когда все было закончено, я сделал новую установку, на этот раз указав номер версии:
после завершения установки postgres запускается автоматически, и теперь все в порядке.
Источник
Postgresql 9.3 в Ubuntu для веб-приложения Django Ошибка: cluster_port_ready: не удалось найти двоичный файл psql
У меня возникли проблемы с postgresql 9.3, запущенным на ubuntu 14.04.5
У меня было веб-приложение django, работающее с использованием NGINX/Gunicorn, в течение нескольких недель, и однажды я пошел использовать его, и я получил OperationalError:
После исследования выяснилось, что сервер postgresql не работает. Затем я попытался запустить его и получил следующую ошибку:
Тревожный, но мои данные подкреплены очень хорошо, поэтому я сделал:
и тогда я получил:
Нет проблем. Я брошу его и создаю новый, я подумал:
это нормально, и я побежал:
опять же, и теперь он создал кластер, по-видимому, но не начал:
есть ли у кого-нибудь какие-либо рекомендации относительно того, как решить эту проблему? Я сделал apt-get удалять и устанавливать для postgresql и все те же результаты.
Итак, я попробовал следующее предложение:
Поэтому я побежал:
2 ответа
Поэтому я не смог восстановить экземпляр postgres, который я пытался запустить, поэтому я использовал эту статью о том, как очистить и полностью удалить postgres. Насколько это произошло, я все еще в растерянности. Я читал, что моя проблема могла быть вызвана переменными среды локали для LANGUAGE и LANG_ALL. Или возможно, что это могло быть вызвано после обновления, потому что я не указал, какую версию postgres, которую я хотел установить, когда я запускал apt-get изначально. Несмотря на это, вот команды, которые я запускал, которые вернули меня в бизнес:
После этой команды я снова получил некоторые ошибки, связанные с недопустимым каталогом данных, поэтому по совету сообщения, которое не помечено как ответ из ссылки выше, я также запускал:
Кажется, все идет хорошо, поэтому я вернулся к инструкциям, изложенным в принятом ответе:
Это оказалось законченным без ошибок, за исключением того, что пользователь postgres уже был удален предыдущими командами.
Затем я установил, что мои переменные среды локали были установлены на основе соответствующей статьи под названием » Решение проблемы без обнаружения PostgresSQL Cluster». Я побежал: # dpkg-reconfigure locales
Как только все закончилось, я сделал новую установку, на этот раз указав номер версии:
после завершения установки postgres автоматически запускается, и теперь все выглядит нормально.
Источник
Postgresql 9.3 в ubuntu для веб-приложения Django Ошибка: cluster_port_ready: не удалось найти двоичный файл psql
У меня проблемы с postgresql 9.3, запущенным на ubuntu 14.04.5
У меня было веб-приложение django, работающее с использованием NGINX / Gunicorn, в течение нескольких недель, затем однажды я пошел использовать его и получил OperationalError:
После исследования стало очевидно, что сервер postgresql не запущен. Затем я попытался запустить его и получил следующую ошибку:
Тревожно, но резервные копии моих данных сохраняются нормально, поэтому я сделал:
И тогда я получил:
Нет проблем. Брошу и создаю новый, подумал я:
Все прошло нормально, и я побежал:
Снова, и теперь он явно создал кластер, но не запустился:
Есть ли у кого-нибудь совет, как с этим справиться? Я выполнил удаление и установку apt-get для postgresql, и все те же результаты.
Итак, я попробовал следующее предложение, чтобы выполнить следующее:
2 ответа
После этой команды у меня снова появилось несколько ошибок с жалобами на неверный каталог данных, поэтому по совету сообщения, которое не помечено как ответ по ссылке выше, я также запустил:
Казалось, все прошло хорошо, поэтому я вернулся к инструкциям, изложенным в принятом ответе:
Оказалось, что все прошло без ошибок, за исключением того, что пользователь postgres уже был удален предыдущими командами.
Затем я убедился, что переменные среды моего языкового стандарта были установлены, на основе связанной статьи под названием: Устранение ошибки «Кластеры PostgresSQL не найдены» Я побежал: # dpkg-reconfigure locales
Когда все было закончено, я выполнил новую установку, на этот раз указав номер версии:
После завершения установки postgres запустился автоматически, и теперь вроде все в порядке.
Создать кластер базы данных postgresql:
Если это сообщение об ошибке:
Это означает, что postgresql уже запущен, вам нужно перезапустить его.
Вы можете перезапустить службу postgresql в ubuntu 14.04 с помощью этой команды:
В новом Ubuntu с systemd перезапустите postgresql с помощью этой команды:
Источник
Cannot create cluster at all
Bisser
New Member
I go to the web gui I push the button Create Cluster. I type the name of the cluster and push the Create button.
I get an error — cluster config ‘/etc/pve/corosync.conf’ already exists (500).
What to do next?
I got to that situation in the following way as long as I remember:
In the beginning i successfully created a cluster then I tried to add a node. Then I was shown some error which I don’t remember and there was a spinning wheel. I waited for sometime then I closed the browser and opened it again. The second node I was adding got messed up and I reinstalled it because there was nothing on it. On the node where I created the cluster the failed node still shows in the web ui as not accessible. Then I searched the web and found some commands to run to delete the cluster. I don’t remember everything I tired. So now I am able to push the create cluster button on the web but I get the above error. Please advise.
Glowsome
Active Member
check the following :
— on the node you are trying to ‘create the cluster’ run : pvecm nodes from commandline/console session
If this returns information the node you are trying to create the cluster on already is acting like a member of a previous attempt to create a cluster.
To be quick on explanation, dont try to recreate the cluster, as it seems to have been created, focus on the error of the node-add , your problem is there.
Bisser
New Member
this is what I get from pvecm nodes
Nodeid Votes Name
1 1 51.89.X.X (local)
I cannot add a new node because I cannot access the Join Information button — it is Disabled.
t.lamprecht
Proxmox Staff Member
So you neither could click the «Create Cluster» but also not the «Join Information»??
Can you post the output of:
Best regards,
Thomas
Do you already have a Commercial Support Subscription? — If not, Buy now and read the documentation
t.lamprecht
Proxmox Staff Member
Best regards,
Thomas
Do you already have a Commercial Support Subscription? — If not, Buy now and read the documentation
Bisser
New Member
Create cluster is enabled but I cannot create cluster because I get cluster config ‘/etc/pve/corosync.conf’ already exists (500).
Join Information is disabled. Join Cluster is enabled.
the result from
pvesh get /cluster/config/join —output-format=yaml
is
unable to read ‘/etc/pve/nodes/PX-XXX1/pve-ssl.pem’ — No such file or directory
Output of
cat /etc/pve/corosync.conf
logging <
debug: off
to_syslog: yes
>
nodelist <
node <
name: GE-XXX3
nodeid: 1
quorum_votes: 1
ring0_addr: 51.89.X.XXX
>
node <
name: PX-XXX1
nodeid: 2
quorum_votes: 1
ring0_addr: 139.99.XXX.X
>
>
quorum <
provider: corosync_votequorum
>
totem <
cluster_name: Bxxxxxx
config_version: 2
interface <
bindnetaddr: 51.89.X.XXX
ringnumber: 0
>
ip_version: ipv4
secauth: on
version: 2
>
t.lamprecht
Proxmox Staff Member
Huh, did you fiddled with your SSL certificates? As above seems to be the underlying issue of your situation..
Best regards,
Thomas
Do you already have a Commercial Support Subscription? — If not, Buy now and read the documentation
Bisser
New Member
I haven’t touched anything about certificates. But I remember on the second server when I was trying to add it to the cluster the error shown was something about SSL.
It could be because I tried to change the node name of the server I was adding but that created even a bigger mess so I just reverted the node name back it still didn’t work so I reinstalled the second server but now I have a problem with the main node.
pvecm updatecerts — returns
(re)generate node files
merge authorized SSH keys and known hosts
pvesh get /cluster/config/join —output-format=yaml
again the same
unable to read ‘/etc/pve/nodes/PX-XXX1/pve-ssl.pem’ — No such file or directory
Isn’t there a button to just get rid of everything cluster related and start from scratch?
t.lamprecht
Proxmox Staff Member
That alone won’t help you, the missing SSL Certificate file needs to be fixed too.
But it seems that in your corosync configuration both nodes are already added, so you probably are not quorated (see pvecm status ) and thus the updatecerts command could not re-generated the missing SSL file.
Maybe it’s really the best thing to kill the cluster, here are the steps required — as there’s no simple button, separating a clusters in a general way is not really possible, as they share resources depending on the specific setup.
Note, this is something I’d only do in your situation and not recommended in any way in genearl (for others reading this):
Best regards,
Thomas
Do you already have a Commercial Support Subscription? — If not, Buy now and read the documentation
t.lamprecht
Proxmox Staff Member
Best regards,
Thomas
Do you already have a Commercial Support Subscription? — If not, Buy now and read the documentation
Bisser
New Member
t.lamprecht
Proxmox Staff Member
Best regards,
Thomas
Do you already have a Commercial Support Subscription? — If not, Buy now and read the documentation
Bisser
New Member
Glowsome
Active Member
Bisser
New Member
Ok this cluster thing doesn’t work. I did a clean install on 2 servers they are hosted at OVH. VPS Proxmox VE 5 (ZFS). Both servers have full access to each other — no firewall restrictions. What I did:
1. Opened the web interface on SVR1 and clicked Create Cluster on SVR1. The cluster was created.
2. Opened the web interface on SVR2 and clicked Join Cluster. I copied the join information from SVR1 and used its root pass.
3. I got the following on SVR2
Establishing API connection with host ‘51.89.21.201’
Login succeeded.
Request addition of this node
Join request OK, finishing setup locally
stopping pve-cluster service
Also in the background of SVR2 I can see a spinning wheel and it says: permission denied — invalid PVE ticket (401).
This froze like that and it has been staying like that for about 15 minutes already. I don’t think anything else will happen. This is what happened the last time I tried as well.
I rebooted both servers
And I can no longer enter the web interface of SVR2.
SVR1 shows 2 nodes but the second one is not active and SVR1 says it is a standalone node — not a cluster anymore.
Clean install and doesn’t work. Strange. Any suggestions are welcome. I will not attempt to repair it I just want to make it work from clean install. If anyone can provide instruction of how can this be done it would be great. Thanks.
Источник
After the shutdown of the server PG was unable to start, the cluster (the instance of the database) was missing.
At the end I’ve been able to recover it. I had to correct something (see below) then I’ve executed :
sudo pg_createcluster 9.3 main
Then you should start it
sudo /etc/init.d/postgresql start
The system replied with :
Configuring already existing cluster ….
Things to do in those cases :
— check that all the configuration files and data files are in the correct folders
— check that the files postmaster.opts are pointing to the correct locations
If the primary cluster (usually ‘main’) is still not starting you can create a new cluster with :
pg_createcluster 9.3 cluster2
Then restore the database backup to the new cluster.
Commands to control PG clusters :
list clusters
pg_lsclusters
start/stop a cluster
pg_ctlcluster <pg version> <cluster name> <start|stop>
pg_ctlcluster 9.3 main start
pg_ctlcluster 9.3 clust2 stop
stop a cluster — drop active connections
pg_ctlcluster -m fast 9.3 clust2 stop
The reason of this error: "Error: cluster configuration already exists"
is that the name main
is already assigned to the cluster that gets initially created.
If you haven’t any data in it, you may drop it before creating your own with:
pg_dropcluster 9.3 main
This will also have the desirable effect that your new cluster will be assigned the port number 5432
instead of the non-default 5433
.
Whether you use a direct mount path or a symbolic link doesn’t really matter, but note that configuration files will be created in /etc/postgresql/<version>/<clustername>/
outside of the data directory.
According to its manpage, pg_createcluster
command expects the options before version and name, so the command would be:
pg_createcluster -d /mnt/pgdata/data -l /mnt/pgdata/log --start-conf auto 9.3 main
Also having the logfile in /mnt/pgdata
makes it unreachable to logrotate
, so it will grow endlessly. You may look at /etc/logrotate.d/postgresql-common
to see how it’s configured to process /var/log/postgresql/*.log
# make sure the data directory and contents have been initialized | |
postgresql-cluster-prepared: | |
cmd.run: | |
{% if postgres.initdb %} | |
— name: {{ postgres.commands.initdb }} {{ postgres.initdb_args }} -D {{ postgres.data_dir }} | |
{% elif grains.os_family == ‘Debian’ %} | |
— name: pg_createcluster {{ postgres.version }} main | |
{# else: TODO #} | |
{% endif %} | |
— cwd: / | |
— user: {{ postgres.initdb_user }} | |
— unless: | |
— test -f {{ postgres.data_dir }}/PG_VERSION | |
— require: | |
— pkg: postgresql-installed | |
— env: | |
LC_ALL: C.UTF-8 |
Binary package hint: postgresql-common
# Linux <DELETED> 2.6.32-25-server #44-Ubuntu SMP Fri Sep 17 21:13:39 UTC 2010 x86_64 GNU/Linux
# ii postgresql-common 106 PostgreSQL database-cluster manager
When running pg_createcluster on an already existing cluster, the END handler completely deletes the existing cluster
without any warnings or notices, if the existing cluster is not running. This is highly dangerous and IMO a major bug.
To reproduce:
l# pg_lsclusters
Version Cluster Port Status Owner Data directory Log file
8.4 main 5432 down postgres /var/lib/postgresql/8.4/main /var/log/postgresql/postgresql-8.4-main.log
# pg_createcluster 8.4 main
Error: cluster configuration already exists
# pg_lsclusters
Version Cluster Port Status Owner Data directory Log file
# pg_createcluster 8.4 main
Creating new cluster (configuration: /etc/postgresql/8.4/main, data: /var/lib/postgresql/8.4/main)…
Moving configuration file /var/lib/postgresql/8.4/main/postgresql.conf to /etc/postgresql/8.4/main…
Moving configuration file /var/lib/postgresql/8.4/main/pg_hba.conf to /etc/postgresql/8.4/main…
Moving configuration file /var/lib/postgresql/8.4/main/pg_ident.conf to /etc/postgresql/8.4/main…
The culprit:
nl /usr/bin/pg_createcluster
378 END {
379 # clean up cruft if something went wrong
380 if (!$createsuccess && defined $version && defined $cluster) {
381 system «pg_dropcluster $version $cluster 2>/dev/null»;
382 exit 1;
383 }
384 }
Possible solution:
See attached patch
У меня возникли проблемы с postgresql 9.3, запущенным на ubuntu 14.04.5
У меня было веб-приложение django, работающее с использованием NGINX/Gunicorn, в течение нескольких недель, и однажды я пошел использовать его, и я получил OperationalError:
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5432?
После исследования выяснилось, что сервер postgresql не работает. Затем я попытался запустить его и получил следующую ошибку:
* No PostgreSQL clusters exist; see "man pg_createcluster"
Тревожный, но мои данные подкреплены очень хорошо, поэтому я сделал:
pg_createcluster 9.3 main --start
и тогда я получил:
Error: cluster configuration already exists
Нет проблем. Я брошу его и создаю новый, я подумал:
pg_dropcluster 9.3 main --stop
это нормально, и я побежал:
pg_createcluster 9.3 main --start
опять же, и теперь он создал кластер, по-видимому, но не начал:
Creating new cluster 9.3/main ...
config /etc/postgresql/9.3/main
data /var/lib/postgresql/9.3/main
locale en_US.UTF-8
port 5432
Error: cluster_port_ready: could not find psql binary
есть ли у кого-нибудь какие-либо рекомендации относительно того, как решить эту проблему? Я сделал apt-get удалять и устанавливать для postgresql и все те же результаты.
Заранее спасибо!
ОБНОВИТЬ:
Итак, я попробовал следующее предложение:
/usr/lib/postgresql/9.3/bin/initdb -D /var/lib/postgresql/data -W -A md5
который вернулся:
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.
The database cluster will be initialized with locale "C".
The default database encoding has accordingly been set to "SQL_ASCII".
The default text search configuration will be set to "english".
Data page checksums are disabled.
fixing permissions on existing directory /var/lib/postgresql/data ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
creating configuration files ... ok
creating template1 database in /var/lib/postgresql/data/base/1 ... ok
initializing pg_authid ... ok
Enter new superuser password:
Enter it again:
setting password ... ok
initializing dependencies ... ok
creating system views ... ok
loading system objects' descriptions ... ok
creating collations ... ok
creating conversions ... ok
creating dictionaries ... ok
setting privileges on built-in objects ... ok
creating information schema ... ok
loading PL/pgSQL server-side language ... ok
vacuuming database template1 ... ok
copying template1 to template0 ... ok
copying template1 to postgres ... ok
syncing data to disk ... ok
Success. You can now start the database server using:
/usr/lib/postgresql/9.3/bin/postgres -D /var/lib/postgresql/data
or
/usr/lib/postgresql/9.3/bin/pg_ctl -D /var/lib/postgresql/data -l logfile start
Поэтому я побежал:
user$ /usr/lib/postgresql/9.3/bin/postgres -D /var/lib/postgres
ql/data
и получил:
LOG: could not bind IPv6 socket: Address already in use
HINT: Is another postmaster already running on port 5432? If not, wait a few seconds and retry.
LOG: could not bind IPv4 socket: Address already in use
HINT: Is another postmaster already running on port 5432? If not, wait a few seconds and retry.
WARNING: could not create listen socket for "localhost"
FATAL: could not create any TCP/IP sockets