Postgres 使用 shared_preload_libraries 扩展不断重启。 https://postgresqlco.nf/doc/en/param/shared_preload_libraries/
我在 CentOS7-32 位架构中使用基于 python 的守护进程运行 postgres-15.1。如果我们不使用“shared_preload_libraries”扩展,它工作正常。但是在使用“ALTER SYSTEM SET shared_preload_libraries”命令启用此扩展后,postgres 每隔几秒就会重新启动一次。 最初它在 postgres-9.6.4 上运行良好。
Postgres 日志:
waiting for server to start....2023-02-15 07:13:45.676 GMT [28605] LOG: skipping missing configuration file "/home/runtime/pgsql/data/postgresql.auto.conf"
2023-02-15 07:13:45.825 GMT [28605] LOG: starting PostgreSQL 15.1 on i686-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44), 32-bit
2023-02-15 07:13:45.825 GMT [28605] LOG: listening on IPv4 address "127.0.0.1", port 5432
2023-02-15 07:13:45.933 GMT [28605] LOG: listening on Unix socket "/home/runtime/pgsql/.s.PGSQL.5432"
2023-02-15 07:13:45.969 GMT [28608] LOG: database system was shut down at 2023-02-15 07:13:35 GMT
2023-02-15 07:13:45.989 GMT [28605] LOG: database system is ready to accept connections
done
server started
ALTER SYSTEM
ALTER SYSTEM
ALTER SYSTEM
ALTER SYSTEM
2023-02-15 07:13:51.480 GMT [28605] LOG: received fast shutdown request
waiting for server to shut down....2023-02-15 07:13:51.512 GMT [28605] LOG: aborting any active transactions
2023-02-15 07:13:51.513 GMT [28605] LOG: background worker "logical replication launcher" (PID 28611) exited with exit code 1
2023-02-15 07:13:51.513 GMT [28606] LOG: shutting down
2023-02-15 07:13:51.536 GMT [28606] LOG: checkpoint starting: shutdown immediate
2023-02-15 07:13:51.908 GMT [28606] LOG: checkpoint complete: wrote 3 buffers (0.0%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.090 s, sync=0.028 s, total=0.395 s; sync files=2, longest=0.021 s, average=0.014 s; distance=0 kB, estimate=0 kB
2023-02-15 07:13:51.909 GMT [28605] LOG: database system is shut down
done
server stopped
我尝试使用 postgres-15.0 和 postgres-14.4,两者的行为相同。我找不到任何未解决的问题 w.r.t.
shared_preload_libraries
新版本 Postgres 的扩展。
PS:我使用 openssl-1.1.1i 从源代码构建了这个 Postgres。 我正在使用“citus”库。
ALTER SYSTEM SET shared_preload_libraries="citus";
我使用 postgres-15.1 从它的源代码生成了一个新的 citus.so 文件。 github.com/citusdata/citus
先决条件:
以下命令集在我的本地运行没有错误:
mkdir testdb
initdb -D testdb -U postgres
pg_ctl -D testdb -o "-p 3333" start
psql -p 3333 -U postgres -c "ALTER SYSTEM SET shared_preload_libraries='citus';"
pg_ctl -D testdb -o "-p 3333" restart
psql -p 3333 -U postgres -c "CREATE EXTENSION citus;"
在这里,我:
ALTER SYSTEM SET shared_preload_libraries='citus';
你
共享ALTER SYSTEM SET
的更改;或者在数据库中运行SELECT pg_reload_conf();
)一切都很好!
你能分享你在尝试启动数据库时看到的错误吗?