diff --git a/.gitignore b/.gitignore index d5a5ba1..9839ee2 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,13 @@ docker/postgres-stage docker/postgres-oracle docker/newpg docker/benchmark -docker/pgbackrest-old \ No newline at end of file +docker/pgbackrest-old + +#FerretDB +docker/ferretdb +ferretdb +launcher/ferretdb + +#Exporter_v2 +docker/exporter_v2 +launcher/exporter_v2 \ No newline at end of file diff --git a/scripts/configure_spilo.py b/scripts/configure_spilo.py index 3dd76ed..ea35fe0 100755 --- a/scripts/configure_spilo.py +++ b/scripts/configure_spilo.py @@ -209,7 +209,6 @@ def deep_update(a, b): max_connections: {{postgresql.parameters.max_connections}} max_replication_slots: 10 hot_standby: 'on' - password_encryption: 'scram-sha-256' tcp_keepalives_idle: 900 tcp_keepalives_interval: 100 log_line_prefix: '%t [%p]: [%l-1] %c %x %d %u %a %h ' @@ -258,6 +257,8 @@ def deep_update(a, b): - encoding: UTF8 - locale: {{INITDB_LOCALE}}.UTF-8 - data-checksums + - locale-provider: icu + - icu-locale: {{INITDB_LOCALE}} {{#USE_ADMIN}} users: {{PGUSER_ADMIN}}: @@ -588,6 +589,7 @@ def get_placeholders(provider): placeholders.setdefault('CLONE_TARGET_TIME', '') placeholders.setdefault('CLONE_TARGET_INCLUSIVE', True) + placeholders.setdefault('LOG_GROUP_BY_DATE', False) placeholders.setdefault('LOG_SHIP_SCHEDULE', '1 0 * * *') placeholders.setdefault('LOG_S3_BUCKET', '') placeholders.setdefault('LOG_S3_ENDPOINT', '') @@ -766,6 +768,8 @@ def write_log_environment(placeholders): log_env['LOG_AWS_REGION'] = aws_region log_s3_key = 'spilo/{LOG_BUCKET_SCOPE_PREFIX}{SCOPE}{LOG_BUCKET_SCOPE_SUFFIX}/log/'.format(**log_env) + if os.getenv('LOG_GROUP_BY_DATE'): + log_s3_key += '{DATE}/' log_s3_key += placeholders['instance_data']['id'] log_env['LOG_S3_KEY'] = log_s3_key diff --git a/scripts/post_init.sh b/scripts/post_init.sh index cef0d23..cd6b782 100755 --- a/scripts/post_init.sh +++ b/scripts/post_init.sh @@ -55,26 +55,6 @@ ALTER EXTENSION set_user UPDATE; # GRANT EXECUTE ON FUNCTION public.set_user(text) TO admin; # GRANT EXECUTE ON FUNCTION public.pg_stat_statements_reset($RESET_ARGS) TO admin;" - -# CPO-Monitoring -echo "GRANT pg_monitor TO cpo_exporter; -GRANT SELECT ON TABLE pg_authid TO cpo_exporter;"; - -# Structure - -echo "CREATE SCHEMA IF NOT EXISTS exporter; -ALTER SCHEMA exporter OWNER TO cpo_exporter; -CREATE EXTENSION IF NOT EXISTS pgnodemx with SCHEMA exporter; -alter extension pgnodemx UPDATE; - -CREATE TABLE exporter.pgbackrestbackupinfo ( - name text NOT NULL, - data jsonb NOT NULL, - data_time timestamp with time zone DEFAULT now() NOT NULL -) -WITH (autovacuum_analyze_scale_factor='0', autovacuum_vacuum_scale_factor='0', autovacuum_vacuum_threshold='2', autovacuum_analyze_threshold='2'); -ALTER TABLE exporter.pgbackrestbackupinfo OWNER TO cpo_exporter;"; - done < <(psql -d "$2" -tAc 'select pg_catalog.quote_ident(datname) from pg_catalog.pg_database where datallowconn') ) | PGOPTIONS="-c synchronous_commit=local" psql -Xd "$2"