2024年3月10日发(作者:)

Freebsd下pgcluster的安装及配置测试

Pgcluster的安装过程

Pgcluster介绍

文件名称:

大小:17.4MB

文件下载地址:/frs/?group_id=1000072

配置的参考地址:/1_3/

服务器安装

必须已安装postgresql数据库:数据库版本为8.3.6

Postgresql安装步骤:

拷贝 2 到/usr/src;

tar zxvf 2

cd postgresql-8.3.6

./configure --prefix=/usr/local/pgsql # [指定postgresql 安装目录]

gmake # [时间较长,视服务器状况]

gmake install # [很快]

pw useradd -n amichinauser -m -s /bin/csh # (创建postgres管理用户)

配置环境变量(非必需):

set PGDATA=/usr/local/pgsql

export PGDATA

set LD_LIBRARY_PATH=/usr/local/pgsql/lib

export LD_LIBRARY_PATH

安装的命令

cd /usr/src/

tar –zxvf

cd pgcluster-1.9.0rc.7 #pgcluster源文件所在的目录

./configure

make

make install

注:安装此版本的pgcluster后,将会是postgresql数据升级到8.3.8版本。

在/usr/local/pgsql/share下生成Pgcluster的配置文件。

在每个clusterDB上初始化postgresql数据库

mkdir /usr/local/pgsql/data # (创建数据目录)

chown amichinauser /usr/local/pgsql/data # (目录权限赋给管理用户)

su -l amichinauser # (转换到postgres权限)

/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data #(安装初始化数据

库)

卸载命令

cd /usr/src/pgcluster-1.9.0rc.7 #pgcluster源文件所在的目录

make uninstall

Pgcluster安装过程错误信息

参考的网址:/en/news/8/

(1)在freebsd7.1 amd64或freebsd7.1 i386执行make命令时报:/usr/lib/ : not found –lc_r

解决方法:修改pgcluster解压文件中/src/makefiles/d文件的第32行,注

释掉LIBS += -lc_r ,增加一行LIBS += -lpthread。如下

#LIBS += -lc_r

LIBS += -lpthread

(2)在freebsd7.1 amd64或freebsd7.1 i386执行make命令时报:

libpq/SUBSYS.o(.text+0xdcb5): In function `set_recovery_packet':: undefined reference to

`cuserid'