一:前言相关

环境:Red Hat 8.3.1-5
安装程序:PostgreSQL 14.1,TimescaleDB 2.5.1,cmake3.22.1
PostgreSQL编译安装需要cmake3.4以上的版本
TimescaleDB目前只支持PostgreSQL 9.6.3+,10.9+或11.4+

  

二、postgresql11部署

1、安装cmake

下载Cmake
安装gcc++ 后,再安装cmake
[root@TimescaleDB apps]# yum install -y gcc*
[root@TimescaleDB apps]# wget https://cmake.org/files/v3.22/cmake-3.22.1.tar.gz
[root@TimescaleDB cmake]# tar -zxvf cmake-3.22.1.tar.gz
编译安装cmake
[root@TimescaleDB cmake]# ./bootstrap && make && makeinstal
建立软连接
[root@TimescaleDB cmake-v3.8.2]# ln -s/usr/local/bin/cmake /usr/bin/cmake 查看版本
[root@TimescaleDB cmake-3.22.1]# cmake --version

安装cmake

2、安装postgresql

[root@TimescaleDB apps]#  wget https://ftp.postgresql.org/pub/source/v14.1/postgresql-14.1.tar.gz
[root@TimescaleDB apps]# tar -zxvf postgresql-14.1.tar.gz
安装依赖包
[root@TimescaleDB postgresql]# yum install -y zlib
[root@TimescaleDB postgresql]# ./configure --prefix=/usr/local/postgresql --with-readline --with-zlib
[root@TimescaleDB postgresql]# make && make install

1.安装postgresql

问题:安装postgreSQL出现configure:error:readline library not found

转自:https://www.cnblogs.com/shuaixf/archive/2011/11/29/2268292.html

要安装 readline, readline-dev开发包,要么使用 --without-readline选项关闭 readline 功能。
#yum install readline;
#yum install readline-dev;
readline 也就是命令行编辑,关闭的话,你直接用psql 就不能编辑命令行,如果输错指令,不能回滚命令历史记录,只能手工重新输入
例如:[root@TimescaleDB postgresql]# yum -y install -y readline-devel

解决方法

在/etc/profile最后,添加以下内容
这一步很关键,如果不设置的话,postgresql的安装命令就不能使用
[root@TimescaleDB postgresql]#vi/etc/profile
exportPG_CONFIG=/usr/local/postgresql/bin/pg_config:$PG_CONFIG
exportPGDATA=/usr/local/postgresql/data:$PGDATA
export PATH=/usr/local/postgresql/bin:$PATH
exportLD_LIBRARY_PATH=/usr/local/postgresql/lib:$LD_LIBRARY_PATH [root@TimescaleDB postgresql]#source /etc/profile

2.设置环境变量并保存执行

[root@TimescaleDB postgresql]#  groupadd postgres
[root@TimescaleDB postgresql]# useradd -g postgres postgres
[root@TimescaleDB postgresql]# passwd postgres
[root@TimescaleDB postgresql]# mkdir /usr/local/postgresql/data
[root@TimescaleDB postgresql]# chown postgres /usr/local/postgresql/data
[root@TimescaleDB postgresql]# chgrp postgres /usr/local/postgresql/data

3.创建用户和用户组,创建数据库文件目录

4.初始化数据库并修改配置

切换用户,初始化数据库(如果不切换账户直接用root进行初始化,会报错)
[root@TimescaleDB postgresql]# su postgres
[postgres@TimescaleDB postgresql]$ /usr/local/postgresql/bin/initdb -D /usr/local/postgresql/data

4.1切换用户,初始化数据库

配置访问权限
[postgres@TimescaleDB postgresql]$ vi /usr/local/postgresql/data/pg_hba.conf
host all all 0.0.0.0/0 md5 配置监控地址,连接端口号
[postgres@TimescaleDB ~]$ vi /usr/local/postgresql/data/postgresql.conf
listen_addresses配置监听地址范围,改为*则为所有
listen_addresses = '*'
port = 5432 # (change requires restart)

4.2配置访问权限、监听地址及端口

5.启动数据库

postgres@TimescaleDB ~]$/usr/local/postgresql/bin/pg_ctl -D /usr/local/postgresql/data -l /usr/local/postgresql/data/logfile start

6.修改数据库密码

postgres@TimescaleDB ~]$ psql
postgres=# \password postgres

三、安装timescaledb(把postgres 改成 timescaledb时序库)

软件包链接https://codeload.github.com/timescale/timescaledb/zip/master

从源安装自托管 TimescaleDB(官网https://docs.timescale.com/install/latest/self-hosted/installation-source/#configuring-postgresql-after-installing-from-source)
git clone https://github.com/timescale/timescaledb.git
cd timescaledb
查看最新版本。您可以在我们的发布页面上找到最新的发布标签:https://github.com/timescale/timescaledb/releases
git checkout 2.5.1
引导构建系统:
./bootstrap -DUSE_OPENSSL=0 -DREGRESS_CHECKS=OFF
构建扩展:
cd build && make
安装 TimescaleDB:
make install

1、安装timescaledb

编辑postgresql.conf文件,添加timescaledb库
[root@TimescaleDB postgresql]# su postgres
[postgres@TimescaleDB postgresql]$ vim /usr/local/postgresql/data/postgresql.conf
shared_preload_libraries = 'timescaledb' # (change requires restart)

2、配置timescaledb

3.重启postgresql数据库
postgres@TimescaleDB ~]$/usr/local/postgresql/bin/pg_ctl -D /usr/local/postgresql/data -l /usr/local/postgresql/data/logfile restart

4.添加timescaledb扩展

postgres@TimescaleDB ~]$ psql
postgres=# create extension timescaledb;

5、验证timescaleDB扩展安装完成
postgres@TimescaleDB ~]$ psql
postgres=# create database tutorial;
postgres=# \c tutorial
tutorial=# create extension if not exists timescaledb cascade; 验证完成,timescaleDB扩展安装成功

5、验证timescaleDB扩展安装完成

四、其他

1.查看版本号和系统类别:cat /etc/redhat-realease;
2.如果是redhat:(yum install)
a.yum 删除软件包:
rpm -qa | grep postgresql
yum remove postgresql*
b.删除相关目录文件:
rm -rf /var/lib/pgsql
rm -rf /usr/pgsql*
c.删除pg相关用户组/用户
userdel -r postgres groupdel postgres 如果是ubuntu /centos:(暂时没实践,做个笔记备用)(apt-get install)
如果在运行,默认的5432端口就能被监听到,请运行 sudo service postgresql stop 暂停服务。
在命令行输入sudo apt-get --purge remove postgresql
删除postgresql安装包,安装删除后还有删除对应的配置sudo rm -r /etc/postgresql/
sudo rm -r /etc/postgresql-common/
sudo rm -r /var/lib/postgresql/
sudo userdel -r postgres
sudo groupdel postgres
最后删除用户/用户组

1.完全删除postgres

2.远程连接方式

2.1 navicat(这里不做说明)

2.2 pgAdmin

下载地址:https://www.pgadmin.org/download/pgadmin-4-windows/

总结:

1、安装cmake

2、安装postgresql

3、安装timescaledb(把postgres 改成 timescaledb时序库)

启动命令:

postgres@TimescaleDB ~]$/usr/local/postgresql/bin/pg_ctl -D /usr/local/postgresql/data -l /usr/local/postgresql/data/logfile restart
postgres@TimescaleDB ~]$/usr/local/postgresql/bin/pg_ctl -D /usr/local/postgresql/data -l /usr/local/postgresql/data/logfile start
postgres@TimescaleDB ~]$/usr/local/postgresql/bin/pg_ctl stop -D /usr/local/postgresql/data

转自:

https://www.qedev.com/linux/180450.html

https://docs.timescale.com/install/latest/self-hosted/installation-source/#configure-postgresql-after-installing-from-source

https://blog.csdn.net/yang_z_1/article/details/113560107

https://blog.csdn.net/youngwxy/article/details/100163822

https://www.cnblogs.com/june-/articles/14276416.html

https://blog.csdn.net/weixin_29228203/article/details/116691715

时序数据库timescaleDB安装的更多相关文章

  1. 时序数据库InfluxDB安装及使用

    时序数据库InfluxDB安装及使用 1 安装配置 安装 wget https://dl.influxdata.com/influxdb/releases/influxdb-1.3.1.x86_64. ...

  2. Influxdb 时序数据库 windows 安装

    Influxdb 是一款比较火爆的时序数据库,本文介绍如何在 windows 平台下安装. 1.场景: windows 平台的 influxdb 似乎只支持单机非windows 服务的安装方式 适用于 ...

  3. 国产时序数据库IotDB安装、与SpringBoot集成

    一.简介: 本文将完成一个真实业务中的设备上报数据的一个例子,完整的展示后台服务接收到设备上报的数据后,将数据添加到时序数据库,并且将数据查询出来的一个例子.本文所有代码已经上传GitHub:http ...

  4. Influxdb 时序数据库 centos 安装

    Influxdb 环境搭建 操作系统:CentOS 7 X64 SSH工具:PuTTY 操作系统安装,请参照官网文档进行:https://www.centos.org/ 使用PuTTY 通过ssh连接 ...

  5. TimescaleDB比拼InfluxDB:如何选择合适的时序数据库?

    https://www.itcodemonkey.com/article/9339.html 时序数据已用于越来越多的应用中,包括物联网.DevOps.金融.零售.物流.石油天然气.制造业.汽车.太空 ...

  6. Influxdb时序数据库阅读笔记

    时序数据库 2017年2月Facebook开源了beringei时序数据库:到了4月基于PostgreSQL打造的时序数据库TimeScaleDB也开源了,而早在2016年7月,百度云在其天工物联网平 ...

  7. 0160 十分钟看懂时序数据库(I)-存储

    摘要:2017年时序数据库忽然火了起来.开年2月Facebook开源了beringei时序数据库:到了4月基于PostgreSQL打造的时序数据库TimeScaleDB也开源了,而早在2016年7月, ...

  8. [Go] 时序数据库influxdb的安装

    日志类的数据时候存储在时序数据库中,下面就是时序数据库influxdb的安装 curl -sL https://repos.influxdata.com/influxdb.key | apt-key ...

  9. 时序数据库TDengine 详细安装+集成流程+问题解决

    官方文档:https://docs.taosdata.com/get-started/package/ 点击进入 产品简介 TDengine 是一款高性能.分布式.支持 SQL 的时序数据库 (Dat ...

  10. 互联网级监控系统必备-时序数据库之Influxdb集群及踩过的坑

    上篇博文中,我们介绍了做互联网级监控系统的必备-Influxdb的关键特性.数据读写.应用场景: 互联网级监控系统必备-时序数据库之Influxdb 本文中,我们介绍Influxdb数据库集群的搭建, ...

随机推荐

  1. [转帖]我们为什么放弃 MongoDB 和 MySQL,选择 TiDB

    https://zhuanlan.zhihu.com/p/164706527 写在前面的话 技术选型是由技术方向和业务场景 trade-off 决定的,脱离业务场景来说技术选型是没有任何意义的,所以本 ...

  2. [转帖]自动化配置SSH免密登录和取消SSH免密配置脚本

    1. 前文 搭建了一套有多台主机的局域网环境,不完全考虑安全性的情况下,为方便管理局域网内主机,配置SSH免密登录,因主机较多,前阵子针对配置ssh免密和取消ssh免密功能单独写了脚本来自动化批量部署 ...

  3. [转帖]Jmeter之JDBC Request使用方法(oracle)

    https://zhuanlan.zhihu.com/p/121747788 JDBC Request: 这个sampler可以向数据库发送一个jdbc请求(sql语句),它经常需要和JDBC Con ...

  4. [转帖]DISK BUSY的理解误区

    前几天有个客户的系统存在性能问题,从AWR报告上我们看到是CPU使用率过高,同时GLOBAL CACHE方面的争用比较严重.系统中的烂SQL很多,数据库中很多几十GB的大表也没有分区,总之问题很多.不 ...

  5. 【转帖】Linux性能优化(十六)——中断绑定

    一.中断绑定简介 1.中断简介 计算机中,中断是一种电信号,由硬件产生并直接送到中断控制器上,再由中断控制器向CPU发送中断信号,CPU检测到信号后,中断当前工作转而处理中断信号.CPU会通知操作系统 ...

  6. Redis性能问题诊断以及scan命令耗时分析

    Redis性能问题诊断以及scan命令耗时分析 摘要 最近公司有项目反馈卡顿. 卡顿一小时后自己被拉入群聊. 同事已经基本上定位到问题原因. 我这边想使用朴素的性能观点进行一下性能问题的拆解 为了提高 ...

  7. [转帖]“炫技”还是“真硬核”,OpenPPL 实测阿里「倚天 710」芯片

    http://www.voycn.com/article/xuanjihaishizhenyingheopenppl-shicealiyitian-710-xinpian   本文将以深度学习模型推理 ...

  8. Python控制微信,实现聊天机器人

    自从微信禁止网页版登陆之后,itchat 库实现的功能也就都不能用了,那现在 Python 还能操作微信吗?答案是:可以! 在Github上有一个项目叫<WeChatPYAPI>可以使用 ...

  9. JavaScript一种新的数据结构类型Map

    什么是map 它类似于对象,是键值对的集合,但键的范围不局限在于字符串.各种类型的值(包含对象)都可以作为键. 如果同一个键被多次赋值,后面的值将会覆盖其那面的值.如果读取一个未知的键,返回的是und ...

  10. 1.2 w字+!Java IO 基础知识系统总结 | JavaGuide

    首发于:JavaGuide(「Java学习+面试指南」一份涵盖大部分 Java 程序员所需要掌握的核心知识.) 原文地址:https://javaguide.cn/java/io/io-basis.h ...