pgagent 作为postgresql的一个任务调度代理,在postgresql 9.0 以前 是附带在pgadmin 包下面的,只是默认不安装,9.0之后作为了一个单独是的安装包。所以要使用pgagent定时任务调度的话还得单独安装。

在安装pgagent之前还需要安装另外的2个依赖包,cmake 以及wxGTK.

这里我选择的软件版本分别是

postgresql 9.5.1

pgagent-3.4.0下载地址:https://www.pgadmin.org/download/pgagent.php

cmake-2.8.5 下载地址:http://cmake.org/download/

wxGTK-2.8.12 下载地址:http://www.wxwidgets.org/downloads/

一、postgresql 的安装

(略)

二、cmake的安装

将安装包上传至服务器并解压,解压后进入解压后生成的cmake-2.8.5目录,执行以下命令。

[root@lsrac97 ~]# tar zxvf pgagent-3.4.0.tar.gz

[root@lsrac97 ~]# cd cmake-2.8.5

[root@lsrac97 cmake-2.8.5]# ./bootstrap && make && make install

三、wxGTK-2.8.12 的安装

首先配置.bash_profile参数文件

[root@lsrac97 ~]#vi .bash_profile

#加入以下内容:

PATH=$PATH:$HOME/bin:/usr/local/wxGTK-2.8.12/bin

export LD_LIBRARY_PATH=/usr/local/wxGTK-2.8.12/lib:$LD_LIBRARY_PATH

#并生效参数文件,命令如下:

[root@lsrac97 ~]#source .bash_profile

接着解压该安装包并进入其目录,然后编译和安装

[root@lsrac97 wxGTK-2.8.12 ]# ./configure --enable-shared=no --enable-unicode=yes --prefix=/usr/local/wxGTK-2.8.12

[root@lsrac97 wxGTK-2.8.12 ]# make && make install

四、pgagent的安装

上传安装包至服务器并解压,进入目录执行如下命令:

[root@lsrac97 pgAgent-3.4.0-Source]# cmake ./

提示报错:没有安装postgresql

CMake Error at cmake/FindPG.cmake:131 (MESSAGE):

No PostgreSQL installation could be found.

Call Stack (most recent call first):

CMakeLists.txt:107 (FIND_PACKAGE)

这里需要先指定postgresql环境变量

[root@lsrac97 pgAgent-3.4.0-Source]# source /home/postgres/.bash_profile

[root@lsrac97 pgAgent-3.4.0-Source]# cmake ./

--
-- ================================================================================
-- Configuration summary:
--
-- Project : pgagent
-- Description : pgAgent is a job scheduling engine for PostgreSQL
-- Version : 3.4.0
--
-- PostgreSQL version string : PostgreSQL 9.5.1
-- PostgreSQL version parts : 9.5.1
-- PostgreSQL path : /app/postgresql/pg951
-- PostgreSQL config binary : /app/postgresql/pg951/bin/pg_config
-- PostgreSQL include path : /app/postgresql/pg951/include
-- PostgreSQL library path : /app/postgresql/pg951/lib
-- PostgreSQL share path : /app/postgresql/pg951/share
--
-- wxWidgets version : 2.8.12
-- wxWidgets path : /usr/local/wxGTK-2.8.12
-- wxWidgets config binary : /usr/local/wxGTK-2.8.12/bin/wx-config
-- wxWidgets Static linking : YES
-- wxWidgets Debug? : NO
-- ================================================================================
--
-- Configuring done
-- Generating done
-- Build files have been written to: /app/pgAgent-3.4.0-Source

然后编译安装 make && make install 即可

[root@lsrac97 pgAgent-3.4.0-Source]# make && make install
--
-- ================================================================================
-- Configuration summary:
--
-- Project : pgagent
-- Description : pgAgent is a job scheduling engine for PostgreSQL
-- Version : 3.4.0
--
-- PostgreSQL version string : PostgreSQL 9.5.1
-- PostgreSQL version parts : 9.5.1
-- PostgreSQL path : /app/postgresql/pg951
-- PostgreSQL config binary : /app/postgresql/pg951/bin/pg_config
-- PostgreSQL include path : /app/postgresql/pg951/include
-- PostgreSQL library path : /app/postgresql/pg951/lib
-- PostgreSQL share path : /app/postgresql/pg951/share
--
-- wxWidgets version : 2.8.12
-- wxWidgets path : /usr/local/wxGTK-2.8.12
-- wxWidgets config binary : /usr/local/wxGTK-2.8.12/bin/wx-config
-- wxWidgets Static linking : YES
-- wxWidgets Debug? : NO
-- ================================================================================
--
-- Configuring done
-- Generating done
-- Build files have been written to: /app/pgAgent-3.4.0-Source
Scanning dependencies of target pgagent
[ 12%] Building CXX object CMakeFiles/pgagent.dir/job.cpp.o
[ 25%] Building CXX object CMakeFiles/pgagent.dir/win32.cpp.o
[ 37%] Building CXX object CMakeFiles/pgagent.dir/precomp.cpp.o
[ 50%] Building CXX object CMakeFiles/pgagent.dir/misc.cpp.o
[ 62%] Building CXX object CMakeFiles/pgagent.dir/unix.cpp.o
[ 75%] Building CXX object CMakeFiles/pgagent.dir/pgAgent.cpp.o
[ 87%] Building CXX object CMakeFiles/pgagent.dir/connection.cpp.o
Linking CXX executable pgagent
[ 87%] Built target pgagent
Scanning dependencies of target run
[ 87%] Generating pgagent--3.4.sql, pgagent.control
[100%] Built target run
[root@lsrac97 pgAgent-3.4.0-Source]# make install
[ 87%] Built target pgagent
[100%] Built target run
Install the project...
-- Install configuration: ""
-- Installing: /usr/local/bin/pgagent
-- Removed runtime path from "/usr/local/bin/pgagent"
-- Installing: /usr/local/share/pgagent.sql
-- Installing: /usr/local/share/pgagent_upgrade.sql
-- Installing: /usr/local/./README
-- Installing: /usr/local/./LICENSE
-- Installing: /app/postgresql/pg951/share/extension/pgagent--3.4.sql
-- Installing: /app/postgresql/pg951/share/extension/pgagent.control
-- Installing: /app/postgresql/pg951/share/extension/pgagent--unpackaged--3.4.sql

编译安装完之后切换postgres用户

进入数据库中,执行create extension pgagent;即可。

postgres=# create extension pgagent ;
CREATE EXTENSION

如此pgagent扩展安装完成。

下面是其中遇到的问题:

安装wxWidGets报错:

checking for GTK+ version...
checking for pkg-config... /usr/bin/pkg-config
checking for GTK+ - version >= 2.6.0... no
*** Could not run GTK+ test program, checking why...
*** The test program failed to compile or link. See the file config.log for the
*** exact error that occurred. This usually means GTK+ is incorrectly installed.
checking for pkg-config... (cached) /usr/bin/pkg-config
checking for GTK+ - version >= 3.0.0... no
*** Could not run GTK+ test program, checking why...
*** The test program failed to compile or link. See the file config.log for the
*** exact error that occured. This usually means GTK+ is incorrectly installed.
checking for gtk-config... no
checking for GTK - version >= 1.2.7... no
*** The gtk-config script installed by GTK could not be found
*** If GTK was installed in PREFIX, make sure PREFIX/bin is in
*** your path, or set the GTK_CONFIG environment variable to the
*** full path to gtk-config.
checking for gtk-config... (cached) no
checking for GTK - version >= 1.2.3... no
*** The gtk-config script installed by GTK could not be found
*** If GTK was installed in PREFIX, make sure PREFIX/bin is in
*** your path, or set the GTK_CONFIG environment variable to the
*** full path to gtk-config.
configure: error:
The development files for GTK+ were not found. For GTK+ 2, please
ensure that pkg-config is in the path and that gtk+-2.0.pc is
installed. For GTK+ 1.2 please check that gtk-config is in the path,
and that the version is 1.2.3 or above. Also check that the
libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config
--libs' are in the LD_LIBRARY_PATH or equivalent.

解决:

需要安装gtk2-devel和binutils

yum -y install gtk2-devel binutils-devel

然后wxWidGets继续安装即可。

参考:

postgresql pgagent 的安装及使用(linux 5.8)

CentOS7安装wxWidgets错误解决

postgresql pgagent 的安装及使用的更多相关文章

  1. 与你相遇好幸运,Postgresql和postgis安装

    笔者开发环境: windows 7 x86_64 一开始安装的是官网最新版 PostgreSQL 9.6 ,安装成功 之后安装PostGIS Bundle 2.2 for PostgreSQL x64 ...

  2. PostgreSQL(一) 编译安装运行

    原创,如转发需注明出处. 多年没写博客,一直用的个人笔记软件,最近准备阅读PostgreSQL源码,故记录.(这两年PostgreSQL数据库在某些环境下是比较火的,原因想必大家都清楚.) Postg ...

  3. PostgreSQL系列一:PostgreSQL简介与安装

    一.PostgreSQL简介     1.1 PostgreSQL概述             PostgreSQL数据库是目前功能最强大的开源数据库,支持丰富的数据类型(如JSON和JSONB类型. ...

  4. PostGreSQL最简安装

    A.先用yum安装服务器和客户端 yum install postgresql yum install postgresql-server B.初始化数据库并启动服务 service postgres ...

  5. PostgreSQL&PostGIS完全安装

    检查PostGIS.PostgreSQL.GEOS.GDAL.PROJ等各软件的版本依赖关系 http://trac.osgeo.org/postgis/wiki/UsersWikiPostgreSQ ...

  6. PostgreSQL的下载安装

    下载地址:http://www.postgres.cn/download 下载地址:http://www.filehorse.com/download-postgresql-64/ 下载地址2:htt ...

  7. PostgreSQL 之 yum安装 postgis 插件

    版本说明: CentOS7.5 + PostgreSQL 10.5 参考资源: https://www.postgresql.org/download/linux/redhat/ http://dow ...

  8. PostgreSQL之oracle_fdw安装与使用

    目的介绍 现在项目开发遇到一个问题,就是需要从PostgreSQL中访问Oracle数据库 身为渣渣猿一脸懵逼.于是乎请教了公司的数据库方面的大牛韩工.告诉我用oracle_fdw 可以实现,但是在实 ...

  9. postgresql+postgis+pgrouting安装步骤图解

    1.在此(https://www.bigsql.org/postgresql/installers.jsp/)下载postgresql(开源数据库,gis行业推荐使用); 2.在此(http://wi ...

随机推荐

  1. (C#)代理模式

    1.代理模式 为其他对象提供代理以控制对这个对象的访问. 远程代理:为一个对象在不同的地址空间提供举报代表.这样可以隐藏一个对象在不同地址空间的事实. 虚拟代理:是依据需要创建开销很大的对象.通过它来 ...

  2. [CF106C]Buns

    面包师Lavrenty打算用馅料做几个面包,然后把它们卖掉. Lavrenty有\(n\)克面团和\(m\)种不同的馅料.馅料种类的下标从\(1到m\),他知道他的第\(i\)种馅料剩下\(a_i\) ...

  3. linux系统简单命令

    # uname -a # 查看内核/操作系统/CPU信息 # head -n 1 /etc/issue # 查看操作系统版本 # cat /proc/cpuinfo # 查看CPU信息 # hostn ...

  4. leetcode-零钱兑换—int溢出

     零钱兑换 给定不同面额的硬币 coins 和一个总金额 amount.编写一个函数来计算可以凑成总金额所需的最少的硬币个数.如果没有任何一种硬币组合能组成总金额,返回 -1. 示例 1: 输入: c ...

  5. 怎么给kibana加上权限?

    更新:2016-05-20 09:36 通过向Elastic了解,他们目前开发的5.0版本支持更好的权限定制,粒度达到字段级别.他们预计今年就可以上线,如果你不是有一个旧版本的kibanba非要维护不 ...

  6. leetcode个人题解——#5 Container with most water

    class Solution { public: string longestPalindrome(string s) { int length = s.length(); ) return s; ; ...

  7. Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again YUM报错

        1.挂盘 ----- 2.# mount /dev/sr0 /media/ mount: block device /dev/sr0 is write-protected, mounting ...

  8. 《剑指offer》---把数组排成最小的数

    本文算法使用python3实现 1 题目描述:   输入一个正整数数组,把数组里所有数字拼接起来排成一个数,打印能拼接出的所有数字中最小的一个.例如输入数组 $ [3,32,321] $ ,则打印出这 ...

  9. 《学习OpenCV》课后习题解答2

    题目:(P104) 创建一个拥有三个通道的二维字节类型矩阵,大小为100*100,并将所有值赋为0.通过函数cvPtr2D将指针指向中间的通道("绿色").以(20,5)与(40, ...

  10. IIS7,IIS7.5 URL重写模块工具

    URL 重写模块 2.0 提供基于规则的重写机制,可在 Web 服务器处理请求的 URL 之前对其进行更改,以及在向 HTTP 客户端提供响应内容之前修改响应内容. 注意:使用环境为IIS7.0(x6 ...