CentOS7 download configuration pgAgent Agent job to run the PostgreSQL

1, install PostgreSQL

Refer to the official documentation https://www.postgresql.org/download/linux/redhat/, run the following command

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, installation pgAgent

Run the following command to search pgAgent related to the installation package

yum search pgagent

 

 Select the corresponding version installed, this installation is 9.6

yum install pgagent_96.x86_64 

PgAgent will be installed by default in /usr/share/pgagent_96-4.0.0 directory, the executable file is located in / usr / bin / pgagent_96

Execute the following script after the database software package is installed on the need for job scheduling of work-related database objects to complete the creation of job scheduling

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

Start pgAgent, otherwise the job will not be executed successfully created

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

 The next step is to create a job with pgAdmin, see the implementation of the

 

Guess you like

Origin www.cnblogs.com/weiweictgu/p/11441472.html