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

一、安裝PostgreSQLhtml

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

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

 

二、安裝pgAgentsql

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

yum search pgagent

 

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

yum install pgagent_96.x86_64 

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

軟件包安裝完成後在須要進行做業調度的數據庫執行如下腳本完成做業調度相關數據庫對象的建立工做postgresql

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

啓動pgAgent,不然做業建立成功不會執行code

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

 接下來就是用pgAdmin建立一個做業,查看執行狀況server

 

參考:htm

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

相關文章
相關標籤/搜索