could not access file “pg_cron”: No such file or directory
[postgres@xxoo144032 pg_data]$ cat logfile
2023-06-06 08:33:54 CST::@:[124949]:FATAL: could not access file "pg_cron": No such file or directory
2023-06-06 08:33:54 CST::@:[124949]:LOG: database system is shut down
[postgres@xxoo144032 pg_data]$ ll sspuat/postgresql.conf
-rw-r----- 1 postgres postgres 1883 Jun 6 08:23 sspuat/postgresql.conf
[postgres@xxoo144032 pg_data]$
[postgres@xxoo144032 pg_data]$
[postgres@xxoo144032 pg_data]$ grep pg_cron sspuat/postgresql.conf
shared_preload_libraries='pg_cron'
[postgres@xxoo144032 pg_data]$
# 解决办法 需要安装pg_cron 下面是pg_cron-1.3.0安装办法 需要解决依赖包
pg_cron-1.3.0安装
# 参考 https://blog.csdn.net/weixin_39540651/article/details/108389215
[root@xxoo144032 palog]# cd pg_cron-1.3.0/
[root@xxoo144032 pg_cron-1.3.0]# ll
total 52
-rw-rw-r-- 1 root root 2043 Oct 7 2020 CHANGELOG.md
drwxrwxr-x 2 root root 30 Oct 7 2020 expected
-rw-rw-r-- 1 root root 4139 Oct 7 2020 github-banner.png
drwxrwxr-x 2 root root 136 Oct 7 2020 include
-rw-rw-r-- 1 root root 918 Oct 7 2020 LICENSE
-rw-rw-r-- 1 root root 812 Oct 7 2020 Makefile
-rw-rw-r-- 1 root root 1335 Oct 7 2020 META.json
-rw-rw-r-- 1 root root 101 Oct 7 2020 pg_cron--1.0--1.1.sql
-rw-rw-r-- 1 root root 155 Oct 7 2020 pg_cron--1.1--1.2.sql
-rw-rw-r-- 1 root root 1407 Oct 7 2020 pg_cron--1.2--1.3.sql
-rw-rw-r-- 1 root root 121 Oct 7 2020 pg_cron.control
-rw-rw-r-- 1 root root 2034 Oct 7 2020 pg_cron.sql
-rw-rw-r-- 1 root root 5944 Oct 7 2020 README.md
drwxrwxr-x 2 root root 30 Oct 7 2020 sql
drwxrwxr-x 2 root root 95 Oct 7 2020 src
[root@xxoo144032 pg_cron-1.3.0]#
[root@xxoo144032 pg_cron-1.3.0]# make
make: pg_config: Command not found
cat pg_cron.sql > pg_cron--1.0.sql
[root@xxoo144032 pg_cron-1.3.0]#
[root@xxoo144032 pg_cron-1.3.0]# yum install postgresql-devel
Last metadata expiration check: 0:38:40 ago on Tue 06 Jun 2023 08:28:33 AM CST.
Dependencies resolved.
===================================================================================================================================================================================================
Package Architecture Version Repository Size
===================================================================================================================================================================================================
Installing:
libpq-devel x86_64 12.4-1.ky10.ky10 os 94 k
Transaction Summary
===================================================================================================================================================================================================
Install 1 Package
Total download size: 94 k
Installed size: 333 k
Is this ok [y/N]: y
Downloading Packages:
libpq-devel-12.4-1.ky10.ky10.x86_64.rpm 1.4 MB/s | 94 kB 00:00
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 1.3 MB/s | 94 kB 00:00
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : libpq-devel-12.4-1.ky10.ky10.x86_64 1/1
Running scriptlet: libpq-devel-12.4-1.ky10.ky10.x86_64 1/1
Verifying : libpq-devel-12.4-1.ky10.ky10.x86_64 1/1
Installed:
libpq-devel-12.4-1.ky10.ky10.x86_64
Complete!
[root@xxoo144032 pg_cron-1.3.0]# make
Makefile:23: /usr/lib64/pgsql/pgxs/src/makefiles/pgxs.mk: No such file or directory
make: *** No rule to make target '/usr/lib64/pgsql/pgxs/src/makefiles/pgxs.mk'. Stop.
# 参考 https://blog.51cto.com/u_15101587/2624367
[root@xxoo144032 yum.repos.d]# ll /usr/bin/pg_config
-rwxr-xr-x 1 root root 47328 Feb 23 2021 /usr/bin/pg_config
[root@xxoo144032 yum.repos.d]# ll /usr/local/pgsql/bin/pg_config
ls: cannot access '/usr/local/pgsql/bin/pg_config': No such file or directory
[root@xxoo144032 yum.repos.d]#
[root@xxoo144032 yum.repos.d]# find / -name pg_config
/usr/bin/pg_config
/xxoo/postgres/base/1.4/bin/pg_config
[root@xxoo144032 yum.repos.d]#
[root@xxoo144032 yum.repos.d]# mv /usr/bin/pg_config /usr/bin/pg_config_bak
[root@xxoo144032 yum.repos.d]# ln -s /xxoo/postgres/base/1.4/bin/pg_config /usr/bin/pg_config
[root@xxoo144032 yum.repos.d]#
[root@xxoo144032 yum.repos.d]# cd /palog/pg_cron-1.3.0/
[root@xxoo144032 pg_cron-1.3.0]#
[root@xxoo144032 pg_cron-1.3.0]# make
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -g -O2 -fPIC -std=c99 -Wall -Wextra -Werror -Wno-unused-parameter -Wno-implicit-fallthrough -Iinclude -I/xxoo/postgres/base/1.4/include -I. -I./ -I/xxoo/postgres/base/1.4/include/postgresql/server -I/xxoo/postgres/base/1.4/include/postgresql/internal -D_GNU_SOURCE -I/usr/include/libxml2 -c -o src/pg_cron.o src/pg_cron.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -g -O2 -fPIC -std=c99 -Wall -Wextra -Werror -Wno-unused-parameter -Wno-implicit-fallthrough -Iinclude -I/xxoo/postgres/base/1.4/include -I. -I./ -I/xxoo/postgres/base/1.4/include/postgresql/server -I/xxoo/postgres/base/1.4/include/postgresql/internal -D_GNU_SOURCE -I/usr/include/libxml2 -c -o src/job_metadata.o src/job_metadata.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -g -O2 -fPIC -std=c99 -Wall -Wextra -Werror -Wno-unused-parameter -Wno-implicit-fallthrough -Iinclude -I/xxoo/postgres/base/1.4/include -I. -I./ -I/xxoo/postgres/base/1.4/include/postgresql/server -I/xxoo/postgres/base/1.4/include/postgresql/internal -D_GNU_SOURCE -I/usr/include/libxml2 -c -o src/misc.o src/misc.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -g -O2 -fPIC -std=c99 -Wall -Wextra -Werror -Wno-unused-parameter -Wno-implicit-fallthrough -Iinclude -I/xxoo/postgres/base/1.4/include -I. -I./ -I/xxoo/postgres/base/1.4/include/postgresql/server -I/xxoo/postgres/base/1.4/include/postgresql/internal -D_GNU_SOURCE -I/usr/include/libxml2 -c -o src/task_states.o src/task_states.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -g -O2 -fPIC -std=c99 -Wall -Wextra -Werror -Wno-unused-parameter -Wno-implicit-fallthrough -Iinclude -I/xxoo/postgres/base/1.4/include -I. -I./ -I/xxoo/postgres/base/1.4/include/postgresql/server -I/xxoo/postgres/base/1.4/include/postgresql/internal -D_GNU_SOURCE -I/usr/include/libxml2 -c -o src/entry.o src/entry.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -g -O2 -fPIC -shared -o pg_cron.so src/pg_cron.o src/job_metadata.o src/misc.o src/task_states.o src/entry.o -L/xxoo/postgres/base/1.4/lib -Wl,--as-needed -Wl,-rpath,'/xxoo/postgres/base/1.4/lib',--enable-new-dtags -L/xxoo/postgres/base/1.4/lib -lpq
[root@xxoo144032 pg_cron-1.3.0]#
[root@xxoo144032 pg_cron-1.3.0]# make install
/usr/bin/mkdir -p '/xxoo/postgres/base/1.4/lib/postgresql'
/usr/bin/mkdir -p '/xxoo/postgres/base/1.4/share/postgresql/extension'
/usr/bin/mkdir -p '/xxoo/postgres/base/1.4/share/postgresql/extension'
/usr/bin/install -c -m 755 pg_cron.so '/xxoo/postgres/base/1.4/lib/postgresql/pg_cron.so'
/usr/bin/install -c -m 644 .//pg_cron.control '/xxoo/postgres/base/1.4/share/postgresql/extension/'
/usr/bin/install -c -m 644 .//pg_cron--1.2--1.3.sql .//pg_cron--1.0--1.1.sql .//pg_cron--1.1--1.2.sql pg_cron--1.0.sql '/xxoo/postgres/base/1.4/share/postgresql/extension/'
[root@xxoo144032 pg_cron-1.3.0]#
[root@xxoo144032 pg_cron-1.3.0]#
[root@xxoo144032 pg_cron-1.3.0]#
[root@xxoo144032 pg_cron-1.3.0]#
[root@xxoo144032 pg_cron-1.3.0]#
[root@xxoo144032 pg_cron-1.3.0]#
[root@xxoo144032 pg_cron-1.3.0]#
[root@xxoo144032 pg_cron-1.3.0]# rase_ctl -D /xxoo/pg_data/sspuat -l logfile start
-bash: rase_ctl: command not found
[root@xxoo144032 pg_cron-1.3.0]# su - postgres
Last login: Mon Jun 5 20:28:26 CST 2023 on pts/1
[postgres@xxoo144032 ~]$ rase_ctl -D /xxoo/pg_data/sspuat -l logfile start
waiting for server to start...... done
server started
最后修改时间:2023-06-06 09:35:24
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




