centos7.4+postgresql11.6+timescaledb1.7
一、 系统环境 centos7.4
二、 软件下载地址 cmake:下载地址:https://cmake.org/download/
三、 安装步骤
- 安装postgresql11.6
1)安装依赖包
[root@lineqi opt]# yum install zlib*
[root@lineqi opt]# yum install readline*
2)创建软件安装目录
[root@lineqi ~]# mkdir -p /usr/local/pgsql/
[root@lineqi ~]# chown -R postgres:postgres /usr/local/pgsql
[root@lineqi ~]# chmod -R 775 /usr/local/pgsql
3)编译安装
[postgres@lineqi postgresql-11.6]$ ./configure --prefix=/usr/local/pgsql --with-perl --with-readline --with-zlib
[postgres@lineqi postgresql-11.6]$ make && make install
4)配置环境变量
export PGHOME=/usr/local/pgsql
export PATH= P G H O M E / b i n : PGHOME/bin: PGHOME/bin:PATH:.
export MANPATH= P G H O M E / s h a r e / m a n : PGHOME/share/man: PGHOME/share/man:MANPATH
export PGPORT=1921
export PGDATA=https://www.it610.com/data/pg11.6
export LANG=en_US.utf8
export LD_LIBRARY_PATH= P G H O M E / l i b : / l i b 64 : / u s r / l i b 64 : / u s r / l o c a l / l i b 64 : / l i b : / u s r / l i b : / u s r / l o c a l / l i b : PGHOME/lib:/lib64:/usr/lib64:/usr/local/lib64:/lib:/usr/lib:/usr/local/lib: PGHOME/lib:/lib64:/usr/lib64:/usr/local/lib64:/lib:/usr/lib:/usr/local/lib:LD_LIBRARY_PATH
5)初始化数据库
[postgres@lineqi ~]$ initdb -D /data/pg11.6/ - 安装cmake3.4以上版本
[root@lineqi opt]# tar -xvf cmake-3.13.4.tar.gz
[root@lineqi opt]# cd cmake-3.13.4/
[root@lineqi cmake-3.13.4]# ./bootstrap && make && make install - 安装timescaledb1.7
[root@lineqi opt]# unzip timescaledb-master.zip
[root@lineqi opt]# chown -R postgres:postgres timescaledb-master
[root@lineqi opt]# chmod -R 775 timescaledb-master
[postgres@lineqi timescaledb-master]$ ./bootstrap -DUSE_OPENSSL=0 -DREGRESS_CHECKS=OFF
[root@lineqi cmake-3.13.4]#cd ./build && make
[postgres@lineqi build]$ make install
shared_preload_libraries = ‘timescaledb’ # (change requires restart)
创建业务用户
create user lineqi createdb superuser login replication password ‘lineqi#123’;
grant all ON DATABASE timedb to lineqi;
create extension timescaledb;
[postgres@lineqi build]$ psql -U lineqi -d timedb
psql (11.6)
Type “help” for help.
timedb=# create extension timescaledb;
五、 常见错误
- cmake编译错误
使用cmake-3.16.4版本在centos7.4编译时报如下错误
CMake Error at test/CMakeLists.txt:81 (message):
Program ‘pg_isolation_regress’ not found, but regressions checks were
required. - timescaledb编译错误
Skip regression checks using -DREGRESS_CHECKS=OFF
– Compiling against PostgreSQL version 11.6
CMake Warning at CMakeLists.txt:293 (message):
clang-format is disabled (can’t find clang-format or docker)
CMake Error at CMakeLists.txt:322 (message):
PostgreSQL was built without OpenSSL support, which TimescaleDB needs for
full compatibility. Please rebuild PostgreSQL using--with-openssl
or if
you want to continue without OpenSSL, re-run bootstrap with
-DUSE_OPENSSL=0