-
Notifications
You must be signed in to change notification settings - Fork 814
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Patroni not register service to consul ? #865
Comments
Hi, It is not doing that by default, in order to enable this functionality, you have to put Unfortunately we totally forgot to update the documentation as a part of #802. Please feel free to open a PR fixing it. |
BTW ...
|
Thankyou .... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Dear All.
I'm trying to setup patroni with consul.
First I write a very simple flask script to 'register' to consul, and do a dig just to make sure my consul is work.
dig @127.0.0.1 -p 8600 master.webapp.service.bino.inc. any +multiline +answer
; <<>> DiG 9.9.4-RedHat-9.9.4-61.el7_5.1 <<>> @127.0.0.1 -p 8600 master.webapp.service.bino.inc. any +multiline +answer
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 62221
;; flags: qr aa rd; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1
;; WARNING: recursion requested but not available
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;master.webapp.service.bino.inc. IN ANY
;; ANSWER SECTION:
master.webapp.service.bino.inc. 0 IN A 127.0.0.1
master.webapp.service.bino.inc. 0 IN TXT "consul-network-segment="
;; Query time: 2 msec
;; SERVER: 127.0.0.1#8600(127.0.0.1)
;; WHEN: Kam Nov 15 14:04:43 WIB 2018
;; MSG SIZE rcvd: 111
here is my consul configuration.
more /etc/consul.d/consul.json
{
"data_dir": "/opt/consul/data",
"server": true,
"bind_addr": "127.0.0.1",
"bootstrap_expect": 1,
"ui": true,
"domain": "bino.inc",
"client_addr": "127.0.0.1",
"node_name": "node01"
}
Below is my patroni config
$ more ./pg-1-consul.yml
scope: pgcluster
name: pg-1
restapi:
listen: 0.0.0.0:8008
connect_address: 127.0.0.1:8008
consul:
host: 127.0.0.1
port: 8500
bootstrap:
dcs:
ttl: 30
loop_wait: 10
retry_timeout: 10
maximum_lag_on_failover: 1048576
postgresql:
use_pg_rewind: true
use_slots: true
parameters:
wal_level: replica
hot_standby: "on"
wal_keep_segments: 8
max_wal_senders: 5
max_replication_slots: 5
checkpoint_timeout: 30
initdb:
pg_hba:
users:
dba:
password: secret
options:
- createrole
- createdb
repl:
password: secret
options:
- replication
postgresql:
listen: 0.0.0.0:5432
connect_address: 127.0.0.1:5432
data_dir: /home/patroni/patroni/psqldata/pg-1
config_dir: /home/patroni/patroni/psqldata/pg-1
bin_dir: /usr/pgsql-9.6/bin
authentication:
replication:
username: repl
password: secret
superuser:
username: dba
password: secret
parameters:
unix_socket_directories: '/tmp'
I tried to dig it
dig @127.0.0.1 -p 8600 pgcluster.service.bino.inc. any +multiline +answer
; <<>> DiG 9.9.4-RedHat-9.9.4-61.el7_5.1 <<>> @127.0.0.1 -p 8600 pgcluster.service.bino.inc. any +multiline +answer
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 30822
;; flags: qr aa rd; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1
;; WARNING: recursion requested but not available
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;pgcluster.service.bino.inc. IN ANY
;; AUTHORITY SECTION:
bino.inc. 0 IN SOA ns.bino.inc. hostmaster.bino.inc. (
1542266799 ; serial
3600 ; refresh (1 hour)
600 ; retry (10 minutes)
86400 ; expire (1 day)
0 ; minimum (0 seconds)
)
;; Query time: 2 msec
;; SERVER: 127.0.0.1#8600(127.0.0.1)
;; WHEN: Kam Nov 15 14:26:39 WIB 2018
;; MSG SIZE rcvd: 105
Is that right that patroni did not register it's service to consul, but just use consul for key/value store only ?
Sincerely
-bino-
The text was updated successfully, but these errors were encountered: