TimescaleDB-1 安装

前置条件:
1、操作系统ubuntu2204
2、已经通过apt的方式安装了pg14
当然其他的操作系统,官方文档中也有说明。

一、安装

https://docs.timescale.com/self-hosted/latest/install/installation-linux/

Installing self-hosted TimescaleDB on Debian-based systems

# 1、安装相关仓库
apt install gnupg postgresql-common apt-transport-https lsb-release wget
# 2、运行仓库安装脚本
/usr/share/postgresql-common/pgdg/apt.postgresql.org.sh
# 3、安装TimescaleDB 第三方仓库
echo "deb https://packagecloud.io/timescale/timescaledb/ubuntu/ $(lsb_release -c -s) main" | sudo tee /etc/apt/sources.list.d/timescaledb.list

# 4、安装TimescaleDB GPG key(Ubuntu21.10以后)
wget --quiet -O - https://packagecloud.io/timescale/timescaledb/gpgkey | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/timescaledb.gpg

# 5、更新仓库
apt update

# 6、安装TimescaleDB
apt install timescaledb-2-postgresql-14

# 7、Configure your database by running the timescaledb-tune script, which is included with the timescaledb-tools package. Run the timescaledb-tune script using the sudo timescaledb-tune command. For more information, see the configuration section.
这一段没看懂,我也啥也没做,不过后面的步骤就报错了
最后解决问题的方法也很简单:
修改postgresql配置文件:
root@odoo-pc:~# vi /etc/postgresql/14/main/postgresql.conf 
在文件底部增加一行
shared_preload_libraries = 'timescaledb'

保存文件,重启postgresql
root@odoo-pc:~# systemctl restart postgresql

Set up the TimescaleDB extension

# 升级psql
apt-get update
apt-get install postgresql-client

安装TimeScaleDB

# 修改postgres密码
sudo -u postgres psql
\password postgres
\q
psql -U postgres -h localhost
# 创建时序数据库
CREATE database tsdb;
# 连接到tsdb
\c tsdb
# 增加TimescaleDB扩展
CREATE EXTENSION IF NOT EXISTS timescaledb;
# 看看是否安装成功
\dx
                                                   已安装扩展列表
    名称     |  版本  |  架构模式  |                                         描述                                          
-------------+--------+------------+---------------------------------------------------------------------------------------
 plpgsql     | 1.0    | pg_catalog | PL/pgSQL procedural language
 timescaledb | 2.13.0 | public     | Enables scalable inserts and complex queries for time-series data (Community Edition)
(2 行记录)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值