安装pgagent,并配置job

环境:

Centos 7


1.查找相关介质
yum search pgagent
[root@localhost yum.repos.d]# yum -y install pgagent_11.x86_64


2..在数据库上配置pgAgent
找到pgagent.sql和pgagent_upgrade.sql文件路径,并在需要job功能的数据库上执行
将会在数据库中创建一个pgagent模式,并创建相应的功能表和函数
[root@localhost pgagent_11-4.0.0]# su - postgres
psql -U postgres
postgres=# \i /usr/share/pgagent_11-4.0.0/pgagent.sql
postgres=# \q

或是使用简易安装模式
可使用简易安装模式:
[root@localhost pgagent_95-3.4.0]# psql -U postgres
psql (9.5.9)
Type "help" for help.
postgres=# CREATE EXTENSION pgagent;


3.启动pgAgent守护程序
pgagent_11 hostaddr=192.168.1.130 dbname=postgres user=postgres password=postgres

4.在另外的数据库安装agent
需要以超级管理员的账号登陆执行,指定具体的数据库
psql -h localhost -U postgres -d hxl
hxl=# \i /usr/share/pgagent_11-4.0.0/pgagent.sql

启动
pgagent_11 hostaddr=192.168.1.130 dbname=hxl user=postgres password=postgres

猜你喜欢

转载自www.cnblogs.com/hxlasky/p/12200431.html
job