CentOS7下載配置PostgreSQL的pgAgent運行代理作業


1、安裝PostgreSQL

參考官方文檔https://www.postgresql.org/download/linux/redhat/,運行如下命令

yum install https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm  

yum install postgresql96

yum install postgresql96-server


/usr/pgsql-9.6/bin/postgresql96-setup initdb
systemctl enable postgresql-9.6
systemctl start postgresql-9.6

 

2、安裝pgAgent

運行下列命令搜索pgAgent相關安裝包

yum search pgagent

 

 選取對應版本進行安裝,本次安裝的是9.6

yum install pgagent_96.x86_64 

默認pgAgent會被安裝在/usr/share/pgagent_96-4.0.0目錄下,可執行文件位於/usr/bin/pgagent_96

軟件包安裝完成后在需要進行作業調度的數據庫執行以下腳本完成作業調度相關數據庫對象的創建工作

psql -U postgres -d postgres -f /usr/share/pgagent_96-4.0.0/pgagent.sql

啟動pgAgent,否則作業創建成功不會執行

/usr/bin/pgagent_96 -s /PostgreSQL/96/data/pgagent.log hostaddr=127.0.0.1 port=5432 dbname=postgres user=postgres password=123456

 接下來就是用pgAdmin創建一個作業,查看執行情況

 

參考:

https://www.cnblogs.com/aegis1019/p/9085133.html

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM