sorintlab / stolon

PostgreSQL cloud native High Availability and more.
https://talk.stolon.io
Apache License 2.0
4.63k stars 444 forks source link

failed to get postgres binary version: error: exec: "postgres": executable file not found in $PATH, output: #620

Open willzhang opened 5 years ago

willzhang commented 5 years ago

what i want do i want install stolon in centos7.6 use tar.gz

install etcd

yum install -y etcd
wget https://github.com/sorintlab/stolon/releases/download/v0.13.0/stolon-v0.13.0-linux-amd64.tar.gz
cd stolon-v0.13.0-linux-amd64

Simple Cluster commands

[root@localhost stolon-v0.13.0-linux-amd64]# ./bin/stolonctl --cluster-name stolon-cluster --store-backend=etcdv3 init
WARNING: The databases managed by the keepers will be overwritten depending on the provided cluster spec.
Are you sure you want to continue? [yes/no] yes
[root@localhost stolon-v0.13.0-linux-amd64]#
[root@localhost stolon-v0.13.0-linux-amd64]# ./bin/stolon-sentinel --cluster-name stolon-cluster --store-backend=etcdv3
2019-03-08T12:02:08.154+0800    INFO    cmd/sentinel.go:1962    sentinel uid    {"uid": "ee0b14ab"}
2019-03-08T12:02:08.155+0800    INFO    cmd/sentinel.go:80      Trying to acquire sentinels leadership
2019-03-08T12:02:08.164+0800    INFO    cmd/sentinel.go:87      sentinel leadership acquired
2019-03-08T12:02:08.167+0800    INFO    cmd/sentinel.go:766     trying to find initial master
2019-03-08T12:02:08.167+0800    ERROR   cmd/sentinel.go:1903    failed to update cluster data   {"error": "cannot choose initial master: no keepers registered"}
2019-03-08T12:02:13.177+0800    INFO    cmd/sentinel.go:766     trying to find initial master
2019-03-08T12:02:13.177+0800    ERROR   cmd/sentinel.go:1903    failed to update cluster data   {"error": "cannot choose initial master: no keepers registered"}
^C2019-03-08T12:02:18.059+0800  INFO    cmd/sentinel.go:1788    stopping stolon sentinel
[root@localhost stolon-v0.13.0-linux-amd64]# 
[root@localhost stolon-v0.13.0-linux-amd64]# ./bin/stolon-keeper --cluster-name stolon-cluster --store-backend=etcdv3 --uid postgres0 --data-dir data/postgres0 --pg-su-password=supassword --pg-repl-username=repluser --pg-repl-password=replpassword --pg-listen-address=127.0.0.1
2019-03-08T12:04:52.126+0800    WARN    cmd/keeper.go:1806      provided --pgListenAddress "127.0.0.1" is a loopback ip. This will be advertized to the other components and communication will fail if they are on different hosts
2019-03-08T12:04:52.126+0800    INFO    cmd/keeper.go:1911      exclusive lock on data dir taken
2019-03-08T12:04:52.126+0800    INFO    cmd/keeper.go:492       keeper uid      {"uid": "postgres0"}
2019-03-08T12:04:52.128+0800    WARN    cmd/keeper.go:524       failed to get postgres binary version: error: exec: "postgres": executable file not found in $PATH, output: 
2019-03-08T12:04:52.132+0800    INFO    cmd/keeper.go:976       our keeper data is not available, waiting for it to appear
2019-03-08T12:04:57.134+0800    WARN    cmd/keeper.go:524       failed to get postgres binary version: error: exec: "postgres": executable file not found in $PATH, output: 
2019-03-08T12:04:57.135+0800    INFO    cmd/keeper.go:976       our keeper data is not available, waiting for it to appear
2019-03-08T12:05:02.138+0800    INFO    cmd/keeper.go:976       our keeper data is not available, waiting for it to appear
2019-03-08T12:05:02.142+0800    WARN    cmd/keeper.go:524       failed to get postgres binary version: error: exec: "postgres": executable file not found in $PATH, output: 
2019-03-08T12:05:07.141+0800    INFO    cmd/keeper.go:976       our keeper data is not available, waiting for it to appear
2019-03-08T12:05:07.150+0800    WARN    cmd/keeper.go:524       failed to get postgres binary version: error: exec: "postgres": executable file not found in $PATH, output: 
2019-03-08T12:05:12.145+0800    INFO    cmd/keeper.go:976       our keeper data is not available, waiting for it to appear
2019-03-08T12:05:12.157+0800    WARN    cmd/keeper.go:524       failed to get postgres binary version: error: exec: "postgres": executable file not found in $PATH, output: 
^C2019-03-08T12:05:12.650+0800  ERROR   cmd/keeper.go:750       failed to stop pg instance      {"error": "cannot get instance state: exec: \"pg_ctl\": executable file not found in $PATH"}
[root@localhost stolon-v0.13.0-linux-amd64]# 

what's wrong with it ,is there someting i haven't do?

cieloxlg commented 5 years ago

Note: under ubuntu the initdb command is not provided in the path. You should updated the exported PATH env variable or provide the --pg-bin-path command line option to the stolon-keeper command.

try: add --pg-bin-path /you/postgresql/bin/path to the command ./stolon-keeper

willzhang commented 5 years ago

i config --pg-bin-path /usr/pgsql-11/bin,but here still have problem

[root@localhost ~]# stolon-keeper --cluster-name stolon-cluster --store-backend=etcdv3 --uid postgres0 --pg-bin-path /usr/pgsql-11/bin --data-dir data/postgres0 --pg-su-password=supassword --pg-repl-username=repluser --pg-repl-password=replpassword --pg-listen-address=127.0.0.1
2019-03-08T16:37:54.484+0800    WARN    cmd/keeper.go:1806      provided --pgListenAddress "127.0.0.1" is a loopback ip. This will be advertized to the other components and communication will fail if they are on different hosts
2019-03-08T16:37:54.484+0800    INFO    cmd/keeper.go:1911      exclusive lock on data dir taken
2019-03-08T16:37:54.484+0800    INFO    cmd/keeper.go:492       keeper uid      {"uid": "postgres0"}
2019-03-08T16:37:54.496+0800    INFO    cmd/keeper.go:976       our keeper data is not available, waiting for it to appear
2019-03-08T16:37:59.514+0800    INFO    cmd/keeper.go:976       our keeper data is not available, waiting for it to appear
2019-03-08T16:38:04.516+0800    INFO    cmd/keeper.go:976       our keeper data is not available, waiting for it to appear
2019-03-08T16:38:09.517+0800    INFO    cmd/keeper.go:976       our keeper data is not available, waiting for it to appear
2019-03-08T16:38:14.518+0800    INFO    cmd/keeper.go:976       our keeper data is not available, waiting for it to appear
2019-03-08T16:38:19.521+0800    INFO    cmd/keeper.go:976       our keeper data is not available, waiting for it to appear
2019-03-08T16:38:24.526+0800    INFO    cmd/keeper.go:976       our keeper data is not available, waiting for it to appear
2019-03-08T16:38:29.530+0800    INFO    cmd/keeper.go:976       our keeper data is not available, waiting for it to appear
2019-03-08T16:38:34.531+0800    INFO    cmd/keeper.go:976       our keeper data is not available, waiting for it to appear
2019-03-08T16:38:39.533+0800    INFO    cmd/keeper.go:976       our keeper data is not available, waiting for it to appear
2019-03-08T16:38:44.536+0800    INFO    cmd/keeper.go:976       our keeper data is not available, waiting for it to appear
2019-03-08T16:38:49.539+0800    INFO    cmd/keeper.go:976       our keeper data is not available, waiting for it to appear
2019-03-08T16:38:54.541+0800    INFO    cmd/keeper.go:976       our keeper data is not available, waiting for it to appear
2019-03-08T16:38:59.543+0800    INFO    cmd/keeper.go:976       our keeper data is not available, waiting for it to appear
2019-03-08T16:39:04.547+0800    INFO    cmd/keeper.go:976       our keeper data is not available, waiting for it to appear
2019-03-08T16:39:09.551+0800    INFO    cmd/keeper.go:976       our keeper data is not available, waiting for it to appear
2019-03-08T16:39:14.553+0800    INFO    cmd/keeper.go:976       our keeper data is not available, waiting for it to appear
2019-03-08T16:39:19.557+0800    INFO    cmd/keeper.go:976       our keeper data is not available, waiting for it to appear
2019-03-08T16:39:24.560+0800    INFO    cmd/keeper.go:976       our keeper data is not available, waiting for it to appear
2019-03-08T16:39:29.564+0800    INFO    cmd/keeper.go:976       our keeper data is not available, waiting for it to appear
2019-03-08T16:39:34.566+0800    INFO    cmd/keeper.go:976       our keeper data is not available, waiting for it to appear
2019-03-08T16:39:39.571+0800    INFO    cmd/keeper.go:976       our keeper data is not available, waiting for it to appear
dineshba commented 5 years ago

From the above log, It looks you stopped the Sentinel. Do you have it running ?

viggy28 commented 5 years ago

@dineshba that helps.

Perhaps the documentation here can be improved. https://github.com/sorintlab/stolon/blob/master/doc/simplecluster.md

When you try to start sentinel first time, it complains that there is no keepers registered (makes sense)

Then you start the keeper, it errors our keeper data is not available, waiting for it to appear. At that point, start the sentinel.

dineshba commented 5 years ago

Hi @viggy28, no keepers registered in sentinel is more of a warning. Once we start the keeper, sentinel will be able to discover the keeper.

Note: There is no particular order for starting the proxy,sentinel,keeper

@willzhang and @viggy28 Can we close this issue?

viggy28 commented 5 years ago

Hi @dineshba , thanks for the response. No issues from my side in closing this issue.

ps: I am not the creator of this issue.