1PG_AUTOCTL CREATE WORKER(1) pg_auto_failover PG_AUTOCTL CREATE WORKER(1)
2
3
4
6 pg_autoctl create worker - pg_autoctl create worker
7
8 pg_autoctl create worker - Initialize a pg_auto_failover worker node
9
11 The command pg_autoctl create worker initializes a pg_auto_failover
12 Worker node for a Citus formation. The worker is special in a Citus
13 formation: that's where the client application connects to either to
14 manage the formation and the sharding of the tables, or for its normal
15 SQL traffic.
16
17 The worker also has to register every worker in the formation.
18
19 usage: pg_autoctl create worker
20
21 --pgctl path to pg_ctl
22 --pgdata path to data director
23 --pghost PostgreSQL's hostname
24 --pgport PostgreSQL's port number
25 --hostname hostname by which postgres is reachable
26 --listen PostgreSQL's listen_addresses
27 --proxyport Proxy's port number
28 --username PostgreSQL's username
29 --dbname PostgreSQL's database name
30 --name pg_auto_failover node name
31 --formation pg_auto_failover formation
32 --group pg_auto_failover group Id
33 --monitor pg_auto_failover Monitor Postgres URL
34 --auth authentication method for connections from monitor
35 --skip-pg-hba skip editing pg_hba.conf rules
36 --citus-secondary when used, this worker node is a citus secondary
37 --citus-cluster name of the Citus Cluster for read-replicas
38 --ssl-self-signed setup network encryption using self signed certificates (does NOT protect against MITM)
39 --ssl-mode use that sslmode in connection strings
40 --ssl-ca-file set the Postgres ssl_ca_file to that file path
41 --ssl-crl-file set the Postgres ssl_crl_file to that file path
42 --no-ssl don't enable network encryption (NOT recommended, prefer --ssl-self-signed)
43 --server-key set the Postgres ssl_key_file to that file path
44 --server-cert set the Postgres ssl_cert_file to that file path
45
47 This commands works the same as the pg_autoctl create postgres command
48 and implements the following extra steps:
49
50 1. adds shared_preload_libraries = citus to the local PostgreSQL in‐
51 stance configuration.
52
53 2. creates the extension citus in the target database.
54
55 3. gets the coordinator node hostname from the pg_auto_failover mon‐
56 itor.
57
58 This operation is retried when it fails, as the coordinator might
59 appear later than some of the workers when the whole formation is
60 initialized at once, in parallel, on multiple nodes.
61
62 4. adds node to the coordinator
63
64 This is done in two steps. First, we call the SQL function mas‐
65 ter_add_inactive_node on the coordinator, and second, we call the
66 SQL function master_activate_node.
67
68 This way allows for easier diagnostics in case things go wrong.
69 In the first step, the network and authentication setup needs to
70 allow for nodes to connect to each other. In the second step, the
71 Citus reference tables are distributed to the new node, and this
72 operation has its own set of failure cases to handle.
73
74 IMPORTANT:
75 The default --dbname is the same as the current system user name,
76 which in many case is going to be postgres. Please make sure to use
77 the --dbname option with the actual database that you're going to
78 use with your application.
79
80 Citus does not support multiple databases, you have to use the data‐
81 base where Citus is created. When using Citus, that is essential to
82 the well behaving of worker failover.
83
85 See the manual page for pg_autoctl create postgres for the common op‐
86 tions. This section now lists the options that are specific to pg_au‐
87 toctl create worker:
88
89 --proxyport
90 The --proxyport option allows pg_auto_failover to register the
91 proxy port in the pg_dist_poolinfo entry for the worker node in
92 its Coordinator, rather than the --pgport entry as would usually
93 be done.
94
95 --citus-secondary
96 Use this option to create a worker dedicated to a Citus Sec‐
97 ondary cluster.
98
99 See Citus Secondaries and read-replica for more information.
100
101 --citus-cluster
102 Use this option to name the Citus Secondary cluster that this
103 worker node belongs to. Use the same cluster name again for the
104 worker nodes that are part of this cluster.
105
106 See Citus Secondaries and read-replica for more information.
107
109 Microsoft
110
112 Copyright (c) Microsoft Corporation. All rights reserved.
113
114
115
116
1172.0 Sep 13, 2023 PG_AUTOCTL CREATE WORKER(1)