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

相关文章
相关标签/搜索