Created
April 1, 2020 03:41
-
-
Save patsevanton/848d666395ff70ef7a1f77ea66a11d4b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| systemd: [/etc/systemd/system/patroni.service:14] Not an absolute path, ignoring: ~ | |
| systemd: [/etc/systemd/system/patroni.service:14] Not an absolute path, ignoring: ~ | |
| systemd: [/etc/systemd/system/patroni.service:14] Not an absolute path, ignoring: ~ | |
| systemd: Started Runners to orchestrate a high-availability PostgreSQL - patroni. | |
| patroni: 2020-04-01 03:30:01,661 INFO: Selected new etcd server http://172.26.9.198:2379 | |
| patroni: 2020-04-01 03:30:01,669 INFO: No PostgreSQL configuration items changed, nothing to reload. | |
| patroni: 2020-04-01 03:30:01,685 INFO: Lock owner: None; I am pgnode01 | |
| patroni: 2020-04-01 03:30:01,715 INFO: trying to bootstrap a new cluster | |
| patroni: 2020-04-01 03:30:01,716 INFO: Running custom bootstrap script: wal-g backup-fetch /var/lib/pgsql/11/data LATEST | |
| patroni: Error: unknown flag: --scope | |
| patroni: Usage: | |
| patroni: wal-g backup-fetch destination_directory backup_name [flags] | |
| patroni: Flags: | |
| patroni: -h, --help help for backup-fetch | |
| patroni: --mask string Fetches only files which path relative to destination_directory | |
| patroni: matches given shell file pattern. | |
| patroni: For information about pattern syntax view: https://golang.org/pkg/path/filepath/#Match | |
| patroni: --restore-spec string Path to file containing tablespace restore specification | |
| patroni: Global Flags: | |
| patroni: --config string config file (default is $HOME/.walg.json) | |
| patroni: unknown flag: --scope | |
| patroni: 2020-04-01 03:30:01,745 INFO: removing initialize key after failed attempt to bootstrap the cluster | |
| patroni: 2020-04-01 03:30:01,755 INFO: renaming data directory to /var/lib/pgsql/11/data_2020-04-01-03-30-01 | |
| patroni: 2020-04-01 03:30:01,775 INFO: Lock owner: None; I am pgnode01 | |
| patroni: Traceback (most recent call last): | |
| patroni: File "/usr/local/bin/patroni", line 11, in <module> | |
| patroni: sys.exit(main()) | |
| patroni: File "/usr/local/lib/python3.6/site-packages/patroni/__init__.py", line 224, in main | |
| patroni: return patroni_main() | |
| patroni: File "/usr/local/lib/python3.6/site-packages/patroni/__init__.py", line 188, in patroni_main | |
| patroni: patroni.run() | |
| patroni: File "/usr/local/lib/python3.6/site-packages/patroni/__init__.py", line 134, in run | |
| patroni: logger.info(self.ha.run_cycle()) | |
| patroni: File "/usr/local/lib/python3.6/site-packages/patroni/ha.py", line 1359, in run_cycle | |
| patroni: info = self._run_cycle() | |
| patroni: File "/usr/local/lib/python3.6/site-packages/patroni/ha.py", line 1266, in _run_cycle | |
| patroni: return self.post_bootstrap() | |
| patroni: File "/usr/local/lib/python3.6/site-packages/patroni/ha.py", line 1163, in post_bootstrap | |
| patroni: self.cancel_initialization() | |
| patroni: File "/usr/local/lib/python3.6/site-packages/patroni/ha.py", line 1158, in cancel_initialization | |
| patroni: raise PatroniException('Failed to bootstrap cluster') | |
| patroni: patroni.exceptions.PatroniException: 'Failed to bootstrap cluster' | |
| systemd: patroni.service: main process exited, code=exited, status=1/FAILURE | |
| systemd: Unit patroni.service entered failed state. | |
| systemd: patroni.service failed. | |
| patroni --version | |
| patroni 1.6.4 | |
| cat /etc/patroni/patroni.yml | |
| scope: postgres-cluster | |
| name: pgnode01 | |
| namespace: /service/ | |
| restapi: | |
| listen: 172.26.9.20:8008 | |
| connect_address: 172.26.9.20:8008 | |
| # certfile: /etc/ssl/certs/ssl-cert-snakeoil.pem | |
| # keyfile: /etc/ssl/private/ssl-cert-snakeoil.key | |
| # authentication: | |
| # username: username | |
| # password: password | |
| etcd: | |
| hosts: 172.26.9.20:2379,172.26.9.199:2379,172.26.9.198:2379 | |
| 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` | |
| method: wal_g | |
| wal_g: | |
| command: wal-g backup-fetch /var/lib/pgsql/11/data LATEST | |
| no_params: True | |
| recovery_conf: | |
| recovery_target_action: promote | |
| recovery_target_timeline: latest | |
| restore_command: wal-g wal-fetch %f %p | |
| dcs: | |
| ttl: 30 | |
| loop_wait: 10 | |
| retry_timeout: 10 | |
| maximum_lag_on_failover: 1048576 | |
| master_start_timeout: 300 | |
| synchronous_mode: false | |
| synchronous_mode_strict: false | |
| #standby_cluster: | |
| #host: 127.0.0.1 | |
| #port: 1111 | |
| #primary_slot_name: patroni | |
| postgresql: | |
| use_pg_rewind: true | |
| use_slots: true | |
| parameters: | |
| max_connections: 100 | |
| superuser_reserved_connections: 5 | |
| max_locks_per_transaction: 64 | |
| max_prepared_transactions: 0 | |
| huge_pages: try | |
| shared_buffers: 512MB | |
| work_mem: 128MB | |
| maintenance_work_mem: 256MB | |
| effective_cache_size: 4GB | |
| checkpoint_timeout: 15min | |
| checkpoint_completion_target: 0.9 | |
| min_wal_size: 2GB | |
| max_wal_size: 4GB | |
| wal_buffers: 32MB | |
| default_statistics_target: 1000 | |
| seq_page_cost: 1 | |
| random_page_cost: 4 | |
| effective_io_concurrency: 2 | |
| synchronous_commit: on | |
| autovacuum: on | |
| autovacuum_max_workers: 5 | |
| autovacuum_vacuum_scale_factor: 0.01 | |
| autovacuum_analyze_scale_factor: 0.02 | |
| autovacuum_vacuum_cost_limit: 200 | |
| autovacuum_vacuum_cost_delay: 20 | |
| autovacuum_naptime: 1s | |
| max_files_per_process: 4096 | |
| archive_mode: on | |
| archive_timeout: 1800s | |
| archive_command: cd . | |
| wal_level: replica | |
| wal_keep_segments: 130 | |
| max_wal_senders: 10 | |
| max_replication_slots: 10 | |
| hot_standby: on | |
| wal_log_hints: on | |
| shared_preload_libraries: pg_stat_statements,auto_explain | |
| pg_stat_statements.max: 10000 | |
| pg_stat_statements.track: all | |
| pg_stat_statements.save: off | |
| auto_explain.log_min_duration: 10s | |
| auto_explain.log_analyze: true | |
| auto_explain.log_buffers: true | |
| auto_explain.log_timing: false | |
| auto_explain.log_triggers: true | |
| auto_explain.log_verbose: true | |
| auto_explain.log_nested_statements: true | |
| track_io_timing: on | |
| log_lock_waits: on | |
| log_temp_files: 0 | |
| track_activities: on | |
| track_counts: on | |
| track_functions: all | |
| log_checkpoints: on | |
| logging_collector: on | |
| log_truncate_on_rotation: on | |
| log_rotation_age: 1d | |
| log_rotation_size: 0 | |
| log_line_prefix: '%t [%p-%l] %r %q%u@%d ' | |
| log_filename: 'postgresql-%a.log' | |
| log_directory: /var/log/postgresql | |
| # recovery_conf: | |
| # restore_command: cp ../wal_archive/%f %p #If you use wal-g, than use: wal-g wal-fetch %f %p | |
| # some desired options for 'initdb' | |
| initdb: # Note: It needs to be a list (some options need values, others are switches) | |
| - encoding: UTF8 | |
| - locale: en_US.UTF-8 | |
| - data-checksums | |
| pg_hba: # Add following lines to pg_hba.conf after running 'initdb' | |
| - host replication replicator 127.0.0.1/32 md5 | |
| - host all all 0.0.0.0/0 md5 | |
| # Additional script to be launched after initial cluster creation (will be passed the connection URL as parameter) | |
| # post_init: /usr/local/bin/setup_cluster.sh | |
| # Some additional users which needs to be created after initializing new cluster | |
| # users: | |
| # admin: | |
| # password: admin-pass | |
| # options: | |
| # - createrole | |
| # - createdb | |
| postgresql: | |
| listen: 172.26.9.20,127.0.0.1:5432 | |
| connect_address: 172.26.9.20:5432 | |
| use_unix_socket: true | |
| data_dir: /var/lib/pgsql/11/data | |
| bin_dir: /usr/pgsql-11/bin | |
| config_dir: /var/lib/pgsql/11/data | |
| pgpass: /var/lib/pgsql/.pgpass | |
| authentication: | |
| replication: | |
| username: replicator | |
| password: replicator-pass | |
| superuser: | |
| username: postgres | |
| password: postgres-pass | |
| # rewind: # Has no effect on postgres 10 and lower | |
| # username: rewind_user | |
| # password: rewind_password | |
| parameters: | |
| unix_socket_directories: /var/run/postgresql | |
| stats_temp_directory: /var/lib/pgsql_stats_tmp | |
| remove_data_directory_on_rewind_failure: false | |
| remove_data_directory_on_diverged_timelines: false | |
| # callbacks: | |
| # on_start: | |
| # on_stop: | |
| # on_restart: | |
| # on_reload: | |
| # on_role_change: | |
| create_replica_methods: | |
| - wal_g | |
| - basebackup | |
| wal_g: | |
| command: wal-g backup-fetch /var/lib/pgsql/11/data LATEST | |
| no_params: True | |
| basebackup: | |
| max-rate: '100M' | |
| checkpoint: 'fast' | |
| #watchdog: | |
| # mode: automatic # Allowed values: off, automatic, required | |
| # device: /dev/watchdog | |
| # safety_margin: 5 | |
| tags: | |
| nofailover: false | |
| noloadbalance: false | |
| clonefrom: false | |
| nosync: false | |
| # specify a node to replicate from. This can be used to implement a cascading replication. | |
| # replicatefrom: (node name) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment