Closed ssfdust closed 4 years ago
看起来是没有配置shared_preload_libraries的关系。之前的有这个问题,不过后来修复了。所以需要先确定两个问题。1.不用docker的版本有没有问题。2.做成docker镜像的版本是不是最新的代码。
和pg版本没有关系。pg11应该是支持的
谢谢回复
Docker的版本是
docker --version
Docker version 19.03.2-ce, build 6a30dfca03
代码是最新的代码,直接从github上拉取的,现在即时我在本地测试pg11.5也不能使用pg_jieba 插件。 CREATE EXTENSTION pg_jieba的时候报错。
Edit: 测试环境:Archlinux pg版本: 11.5 错误信息
postgres=# CREATE EXTENSION pg_jieba;
server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
The connection to the server was lost. Attempting reset: Failed.
!>
使用 postgres commit 0baa55655e0549cf19fcfdb007c3250f7d4761a9 (HEAD -> REL_11_STABLE) pg_jieba commit 8995a41872415b489969ef9970517a613040ce28 (HEAD -> master) 测试了一下。
本地测试了。。并没有发现问题。。你看下pg_jieba的commit 版本。
pg_jieba的commit 8995a41872415b489969ef9970517a613040ce28 (HEAD -> master, origin/master, origin/HEAD) README update 这个版本的,我前天刚刚拉的应该没问题把
日志
2019-09-30 09:10:37.561 CST [4139466] LOG: pg_jieba Extension is not loaded by shared_preload_libraries, Variables can't be configured
2019-09-30 09:10:37.561 CST [4139466] STATEMENT: CREATE EXTENSION pg_jieba;
2019-09-30 09:10:40.117 CST [4137296] LOG: server process (PID 4139466) was terminated by signal 11: Segmentation fault
2019-09-30 09:10:40.117 CST [4137296] DETAIL: Failed process was running: CREATE EXTENSION pg_jieba;
2019-09-30 09:10:40.117 CST [4137296] LOG: terminating any other active server processes
2019-09-30 09:10:40.117 CST [4137302] WARNING: terminating connection because of crash of another server process
2019-09-30 09:10:40.117 CST [4137302] DETAIL: The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory.
2
有没有手动修复的方法?
设了preload
之后,
shared_preload_libraries = 'pg_jieba' # (change requires restart)
还是不行:
2019-10-03 09:33:12.790 GMT [1] LOG: database system is ready to accept connections
2019-10-03 09:33:53.411 GMT [1] LOG: server process (PID 165) was terminated by signal 11: Segmentation fault
2019-10-03 09:33:53.411 GMT [1] DETAIL: Failed process was running: create extension pg_jieba;
2019-10-03 09:33:53.411 GMT [1] LOG: terminating any other active server processes
2019-10-03 09:33:53.411 GMT [153] WARNING: terminating connection because of crash of another server process
Docker, Debian stretch:
$ uname -a
Linux 1509fad48310 4.15.0-62-generic #69-Ubuntu SMP Wed Sep 4 20:55:53 UTC 2019
x86_64 GNU/Linux
$ postgres --version
postgres (PostgreSQL) 11.5
如果能有个可以成功的 Dockerfile
就好了。
fixed。 commit 2eb7cfe please update to new commit then try again Thanks for your reporting issue
@jaiminpan 谢谢。已确认可以正常工作,pg 12也测试通过。 @oirontro 我发布了下面这个docker,我这边测试是可以用的。 地址在这里: https://cloud.docker.com/repository/docker/ssfdust/psql_jieba_swsc/general 测试指令:
docker run --name testjieba -e POSTGRES_PASSWORD=passwd -e POSTGRES_USER=test -e POSTGRES_DB=testdb -d ssfdust/psql_jieba_swsc
docker exec -ti testjieba psql -U test testdb
截图:
@ssfdust 我把 你的docker file 放在 readme 里了。感谢
根据这篇文章 http://mysql.taobao.org/monthly/2018/04/10/ 做成了docker镜像, 镜像地址 https://github.com/ssfdust/psql_jieba_swsc。
运行日志
看起来是服务端在处理pg_jieba的时候直接挂掉了,有什么解决方案吗?或者我下一步应该怎么做?