Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- support@vrni-platform:~$ patronictl list -c /etc/patroni/patroni.yml postgresql0
- +-------------+-------------+-----------+--------+---------+-----------+
- | Cluster | Member | Host | Leader | State | Lag in MB |
- +-------------+-------------+-----------+--------+---------+-----------+
- | postgresql0 | postgresql0 | localhost | | running | 0.0 |
- +-------------+-------------+-----------+--------+---------+-----------+
- ubuntu@vrni-platform:/etc/init$ sudo pip install patroni --upgrade
- The directory '/home/ubuntu/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
- The directory '/home/ubuntu/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
- /usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
- InsecurePlatformWarning
- Collecting patroni
- Requirement already up-to-date: requests in /usr/local/lib/python2.7/dist-packages (from patroni)
- Collecting cdiff (from patroni)
- Requirement already up-to-date: six>=1.7 in /usr/local/lib/python2.7/dist-packages (from patroni)
- Collecting python-etcd<0.5,>=0.4.3 (from patroni)
- Requirement already up-to-date: prettytable>=0.7 in /usr/local/lib/python2.7/dist-packages (from patroni)
- Requirement already up-to-date: tzlocal in /usr/local/lib/python2.7/dist-packages (from patroni)
- Requirement already up-to-date: boto in /usr/local/lib/python2.7/dist-packages (from patroni)
- Collecting python-consul>=0.7.0 (from patroni)
- Downloading python_consul-0.7.2-py2.py3-none-any.whl
- Requirement already up-to-date: psycopg2>=2.6.1 in /usr/local/lib/python2.7/dist-packages (from patroni)
- Requirement already up-to-date: kazoo==2.2.1 in /usr/local/lib/python2.7/dist-packages (from patroni)
- Requirement already up-to-date: urllib3>=1.9 in /usr/local/lib/python2.7/dist-packages (from patroni)
- Requirement already up-to-date: click>=4.1 in /usr/local/lib/python2.7/dist-packages (from patroni)
- Requirement already up-to-date: python-dateutil in /usr/local/lib/python2.7/dist-packages (from patroni)
- Collecting psutil (from patroni)
- Requirement already up-to-date: PyYAML in /usr/local/lib/python2.7/dist-packages (from patroni)
- Requirement already up-to-date: certifi>=2017.4.17 in /usr/local/lib/python2.7/dist-packages (from requests->patroni)
- Requirement already up-to-date: chardet<3.1.0,>=3.0.2 in /usr/local/lib/python2.7/dist-packages (from requests->patroni)
- Requirement already up-to-date: idna<2.7,>=2.5 in /usr/local/lib/python2.7/dist-packages (from requests->patroni)
- Requirement already up-to-date: dnspython>=1.13.0 in /usr/local/lib/python2.7/dist-packages (from python-etcd<0.5,>=0.4.3->patroni)
- Requirement already up-to-date: pytz in /usr/local/lib/python2.7/dist-packages (from tzlocal->patroni)
- Installing collected packages: cdiff, python-etcd, python-consul, psutil, patroni
- Found existing installation: python-etcd 0.4.3
- Uninstalling python-etcd-0.4.3:
- Successfully uninstalled python-etcd-0.4.3
- Found existing installation: python-consul 0.6.0
- Uninstalling python-consul-0.6.0:
- Successfully uninstalled python-consul-0.6.0
- Found existing installation: patroni 1.0
- Uninstalling patroni-1.0:
- Successfully uninstalled patroni-1.0
- Successfully installed cdiff-1.0 patroni-1.3.6 psutil-5.4.1 python-consul-0.7.2 python-etcd-0.4.5
- You are using pip version 7.1.2, however version 9.0.1 is available.
- You should consider upgrading via the 'pip install --upgrade pip' command.
- patronictl -c /etc/patroni/patroni.yml list postgresql0
- +---------+--------+------+------+-------+-----------+
- | Cluster | Member | Host | Role | State | Lag in MB |
- +---------+--------+------+------+-------+-----------+
- +---------+--------+------+------+-------+-----------+
- 2017-11-17 19:11:24,385 INFO: Connecting to localhost:2181
- 2017-11-17 19:11:24,389 INFO: Zookeeper connection established, state: CONNECTED
- 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 text search configuration will be set to "english".
- Data page checksums are enabled.
- creating directory /var/lib/postgresql/data/postgresql0 ... ok
- creating subdirectories ... ok
- selecting default max_connections ... 100
- selecting default shared_buffers ... 128MB
- selecting dynamic shared memory implementation ... posix
- creating configuration files ... 2017-11-17 19:11:25,137 INFO: removing initialize key after failed attempt to initialize the cluster
- 2017-11-17 19:11:25,139 INFO: renaming data directory to /var/lib/postgresql/data/postgresql0_2017-11-17-19-11-25
- 2017-11-17 19:11:25,403 INFO: Closing connection to localhost:2181
- 2017-11-17 19:11:25,403 INFO: Zookeeper session lost, state: CLOSED
- 2017-11-17 19:11:25,407 INFO: Connecting to localhost:2181
- 2017-11-17 19:11:25,412 INFO: Zookeeper connection established, state: CONNECTED
- initdb: could not open file "/var/lib/postgresql/data/postgresql0/postgresql.conf" for writing: No such file or directory
- initdb: removing data directory "/var/lib/postgresql/data/postgresql0"
- could not open directory "/var/lib/postgresql/data/postgresql0": No such file or directory
- initdb: failed to remove data directory
- 2017-11-17 19:11:25,910 INFO: Connecting to localhost:2181
- 2017-11-17 19:11:25,915 INFO: Zookeeper connection established, state: CONNECTED
- 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 text search configuration will be set to "english".
- Data page checksums are enabled.
- creating directory /var/lib/postgresql/data/postgresql0 ... ok
- creating subdirectories ... ok
- selecting default max_connections ... 100
- selecting default shared_buffers ... 128MB
- selecting dynamic shared memory implementation ... posix
- creating configuration files ... ok
- creating template1 database in /var/lib/postgresql/data/postgresql0/base/1 ... ok
- initializing pg_authid ... ok
- 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
- WARNING: enabling "trust" authentication for local connections
- You can change this by editing pg_hba.conf or using the option -A, or
- --auth-local and --auth-host, the next time you run initdb.
- Success. You can now start the database server using:
- /usr/lib/postgresql/9.5/bin/pg_ctl -D /var/lib/postgresql/data/postgresql0 -l logfile start
- waiting for server to start....LOG: database system was shut down at 2017-11-17 19:11:27 UTC
- LOG: MultiXact member wraparound protections are now enabled
- LOG: autovacuum launcher started
- LOG: database system is ready to accept connections
- done
- server started
- 2017-11-17 19:11:29,233 INFO: establishing a new patroni connection to the postgres cluster
- 2017-11-17 19:11:29,267 INFO: initialized a new cluster
- 2017-11-17 19:11:35,923 INFO: Lock owner: postgresql0; I am postgresql0
- 2017-11-17 19:11:35,936 INFO: no action. i am the leader with the lock
- 2017-11-17 19:11:35,939 INFO: Lock owner: postgresql0; I am postgresql0
- 2017-11-17 19:11:35,941 INFO: no action. i am the leader with the lock
- 2017-11-17 19:11:45,941 INFO: Lock owner: postgresql0; I am postgresql0
- 2017-11-17 19:11:45,943 INFO: no action. i am the leader with the lock
- ttl: &ttl 30
- loop_wait: &loop_wait 10
- scope: &scope excape2
- #namespace: /service/
- name: postgresql0
- restapi:
- listen: 0.0.0.0:8008
- connect_address: 127.0.0.1:8008
- zookeeper:
- scope: *scope
- session_timeout: *ttl
- reconnect_timeout: *loop_wait
- hosts:
- - localhost:2181
- bootstrap:
- # this section will be written into Etcd:/<namespace>/<scope>/config after initializing new cluster
- # and all other cluster members will use it as a `global configuration`
- dcs:
- ttl: 30
- loop_wait: 10
- retry_timeout: 10
- maximum_lag_on_failover: 1048576
- postgresql:
- use_pg_rewind: true
- use_slots: true
- parameters:
- archive_mode: "off"
- wal_level: hot_standby
- max_wal_senders: 10
- wal_keep_segments: 100
- archive_timeout: 1800s
- max_replication_slots: 10
- hot_standby: "on"
- wal_log_hints: "on"
- unix_socket_directories: '/tmp'
- max_connections: ${pg_max_connections}
- shared_buffers: ${pg_shared_buffers}
- autovacuum_analyze_scale_factor: 0.05
- autovacuum_vacuum_scale_factor: 0.10
- log_autovacuum_min_duration: 0
- autovacuum_naptime: 15s
- autovacuum_max_workers: 6
- recovery_conf:
- restore_command: cp /var/lib/postgresql/wal_archive/%f %p
- # some desired options for 'initdb'
- initdb: # Note: It needs to be a list (some options need values, others are switches)
- - encoding: UTF8
- - data-checksums
- pg_hba: # Add following lines to pg_hba.conf after running 'initdb'
- - host postgres all 127.0.0.1/32 trust
- - host all all 0.0.0.0/0 md5
- - host replication all 0.0.0.0/0 trust
- # - hostssl all all 0.0.0.0/0 md5
- # Some additional users users which needs to be created after initializing new cluster
- users:
- admin:
- password: admin
- options:
- - createrole
- - createdb
- postgresql:
- listen: 0.0.0.0:5432
- connect_address: localhost:5432
- data_dir: /var/lib/postgresql/data/postgresql0
- maximum_lag_on_failover: 104857600 # 1 megabyte i
- pgpass: /tmp/pgpass211
- authentication:
- replication:
- username: replicator
- password: rep-pass
- network: 0.0.0.0/0
- superuser:
- username: postgres
- password: abcded
- parameters:
- unix_socket_directories: '.'
- create_replica_method:
- - basebackup
- tags:
- nofailover: false
- noloadbalance: false
- clonefrom: false
Add Comment
Please, Sign In to add comment