centos 7.4 + pgsql 10.1 + pg_amqp
来源:互联网 发布:js 继承 阮一峰 编辑:程序博客网 时间:2024/05/18 02:29
上传 pg_amqp 到 /tmp 目录下
[root@tpg-1 tmp]# yum install lrzsz
[root@tpg-1 tmp]# rz
[root@tpg-1 tmp]# ls -l
-rw-r–r–. 1 root root 48444 Dec 13 11:34 pg_amqp-0.3.0.zip
[root@tpg-1 tmp]# unzip pg_amqp-0.3.0.zip
[root@tpg-1 tmp]# ls -l
drwxr-xr-x. 5 root root 109 May 20 2011 pg_amqp-0.3.0
-rw-r–r–. 1 root root 48444 Dec 13 11:34 pg_amqp-0.3.0.zip
[root@tpg-1 tmp]# cd pg_amqp-0.3.0
[root@tpg-1 tmp]# env LDFLAGS=”-lpthread” gmake
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong –param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -fPIC -I. -I./ -I/usr/pgsql-10/include/server -I/usr/pgsql-10/include/internal -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include -c -o src/pg_amqp.o src/pg_amqp.c
src/pg_amqp.c: In function ‘amqp_local_phase2’:
src/pg_amqp.c:99:3: warning: enumeration value ‘XACT_EVENT_PARALLEL_COMMIT’ not handled in switch [-Wswitch]
switch(event) {
^
src/pg_amqp.c:99:3: warning: enumeration value ‘XACT_EVENT_PARALLEL_ABORT’ not handled in switch [-Wswitch]
src/pg_amqp.c:99:3: warning: enumeration value ‘XACT_EVENT_PRE_COMMIT’ not handled in switch [-Wswitch]
src/pg_amqp.c:99:3: warning: enumeration value ‘XACT_EVENT_PARALLEL_PRE_COMMIT’ not handled in switch [-Wswitch]
src/pg_amqp.c:99:3: warning: enumeration value ‘XACT_EVENT_PRE_PREPARE’ not handled in switch [-Wswitch]
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong –param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -fPIC -I. -I./ -I/usr/pgsql-10/include/server -I/usr/pgsql-10/include/internal -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include -c -o src/librabbitmq/amqp_debug.o src/librabbitmq/amqp_debug.c
src/librabbitmq/amqp_debug.c:44:6: warning: no previous prototype for ‘amqp_dump’ [-Wmissing-prototypes]
void amqp_dump(void const *buffer, size_t len) {
存在一些警告,安装过程没有关注,貌似也没啥影响,pg_amqp.so可以正常使用
[root@tpg-1 tmp]# env LDFLAGS=”-lpthread” gmake install
修改参数
-bash-4.2$ cat postgresql.conf |grep -i preload
shared_preload_libraries = ‘pg_amqp.so’ # (change requires restart)
postgresql.conf 的其它参数值依据数据库的作用和机器配置设置
[root@tpg-1 ~]# systemctl status postgresql-10.service
[root@tpg-1 ~]# systemctl start postgresql-10.service
-bash-4.2$ psql
create database testdb;
\l
\c testdb
select name,default_version,installed_version
from pg_available_extensions
where 1=1
order by name;
create extension amqp;
select *
from pg_extension;
参考:
https://pgxn.org/dist/pg_amqp/
http://blog.163.com/digoal@126/blog/static/16387704020120182524830
备注:
在 centos 7.4 + pgsql9.1 环境编译pg_amqp时,启动pgsql时报下错误,第一个通过德哥的文章解决了,第二步不知道什么原因导致的,先记录下
FATAL: could not load library “/usr/lib/postgresql/9.1/lib/src/pg_amqp.so”: /usr/lib/postgresql/9.1/lib/src/pg_amqp.so: undefined symbol: pthread_key_create
FATAL: could not load library “/usr/lib/postgresql/9.1/lib/src/pg_amqp.so”: /usr/lib/postgresql/9.1/lib/src/pg_amqp.so: undefined symbol: pthread_getspecific
- centos 7.4 + pgsql 10.1 + pg_amqp
- centos 7.4 + yum + pgsql 10.1
- CentOS php pgsql 扩展
- centos php添加pgsql扩展
- centos php添加pgsql扩展
- centos 6.8 + pgsql 9.6 + dblink
- centos 6.8 + pgsql 9.6 + file_fdw
- centos 6.8 + pgsql 9.6 + pg_stat_statements
- centos 6.8 + pgsql 9.6 + pgagent
- centos 6.8 + pgsql 9.6 + mysql_fdw
- centos 6.8 + pgsql 9.6 + pg_buffercache
- centos 6.8 + pgsql 9.6 + pg_hint_plan
- centos 6.8 + pgsql 9.6 + adminpack
- centos 6.8 + pgsql 9.6 + pldebugger/pldbgapi
- pgsql
- centos环境+pgsql+postgis+apache+php等插件的安装
- centos 6.8 + yum + pgsql 9.6 的一些路径
- pgsql 10.1 分区表之 range 分区
- Linux创建普通用户
- 朴素贝叶斯及其多项式
- springcloud实战之10 分布式配置中心(config)
- 狼人杀手游:一场有关技术、流量和资本的全面战争
- SHA-256 和SHA-512 加密算法
- centos 7.4 + pgsql 10.1 + pg_amqp
- 阿里数据库内核月报:2017年11月
- Android java.lang.RuntimeException: Parcelable encountered IOException writing serializable object 解
- Spring单独使用 (一)同类不同质
- IAR-AVR-C编译器的使用A
- Linux最常用的20条命令
- pyspark之MLlib学习【数据统计】(2)
- nodejs的express框架登陆注册退出代码记录
- jQuery小记