• postgresql13 安装postgis timescaledb


    结合上面一篇完整。

    常用命令

    # 安装 PostgreSQL 13 软件包
    sudo yum install postgresql13-server postgresql13-contrib

    # 初始化数据库
    sudo /usr/pgsql-13/bin/postgresql-13-setup initdb

    # 启动 PostgreSQL 服务
    sudo systemctl start postgresql-13

    # 设置开机自启动
    sudo systemctl enable postgresql-13
    alter user postgres with encrypted password '***password';

    安装不要签名
    sudo yum install timescaledb-postgresql-11 --nogpgcheck

    yum list installed | grep postgresql

    # 安装 PostgreSQL 11 软件包
    sudo yum install postgresql11-server postgresql11-contrib

    # 初始化数据库
    sudo /usr/pgsql-11/bin/postgresql-11-setup initdb

    # 启动 PostgreSQL 服务
    sudo systemctl start postgresql-11

    # 设置开机自启动
    sudo systemctl enable postgresql-11
    sudo yum install postgis30_11

    /usr/pgsql-12/bin/postgresql-12-setup initdb
    /usr/pgsql-13/bin/postgresql-13-setup initdb
    yum install timescaledb-2-loader-postgresql-13-2.3.1-0.el7.x86_64 timescaledb-2-postgresql-13-2.3.1-0.el7.x86_64 --nogpgcheck

    使用 TimescaleDB 和 PostGIS 安装 PostgreSQL 版本 13

    可以在同一主机上安装 PostgreSQL 13。首先,您必须确保数据库端口等内容是唯一的。换句话说,它必须与同一主机上安装的当前 PostgreSQL 11 不同。

    对于 CentOS/RHEL/Oracle Linux

    运行以下命令安装 PostgreSQL 13 及其依赖包: 

    yum install postgresql13.x86_64 postgresql13-server.x86_64 postgresql13-contrib.x86_64 postgresql13-libs.x86_64  

    然后通过运行以下命令初始化数据库集群及其所需的数据库集合:

    $ /usr/pgsql-13/bin/postgresql-13-setup initdb

    # 初始化数据库 sudo /usr/pgsql-13/bin/postgresql-13-setup initdb # 启动 PostgreSQL 服务 sudo systemctl start postgresql-13 # 设置开机自启动 sudo systemctl enable postgresql-13

    1、修改/var/lib/pgsql/12/data/postgresql.conf文件,取消 listen_addresses 的注释,将参数值改为“*”


    2、修改/var/lib/pgsql/12/data/pg_hba.conf文件,增加下图红框部分内容

    1. [root@pupnode28 ~]# ls -alth /var/lib/pgsql/* -d
    2. drwx------. 4 postgres postgres 51 Sep 22 14:19 /var/lib/pgsql/13
    3. drwx------. 4 postgres postgres 33 Sep 21 18:53 /var/lib/pgsql/11

    现在我们已经熟悉了 PostgreSQL 13,让我们安装 TimescaleDB。我们需要确保要安装的插件与 PostreSQL 11 上的版本相同。 

    请注意,为了确保pg_upgrade 顺利运行,源插件和主要版本目标的插件应该是相同的版本。这是因为 pg_upgrade 将查找链接到旧版本或源数据库版本的 PostgreSQL 已加载或使用的插件或扩展的指定库。您可以在企业 Linux 中通过运行 showduplicates 或使用 dnf 或 yum 验证信息(如下所示)来验证这一点:

    1. $ yum --showduplicates list timescaledb_13.x86_64 timescaledb-2-postgresql-13.x86_64 timescaledb-2-oss-postgresql-13.x86_64 timescaledb-2-loader-postgresql-13.x86_64|grep '2.3.1'
    2. Repository pgdg-common is listed more than once in the configuration
    3. timescaledb-2-loader-postgresql-13.x86_64 2.3.1-0.el7 timescale_timescaledb
    4. timescaledb-2-oss-postgresql-13.x86_64 2.3.1-0.el7 timescale_timescaledb
    5. timescaledb-2-postgresql-13.x86_64 2.3.1-0.el7 timescale_timescaledb

    或者使用info 选项验证它:

    $ yum info timescaledb-2-loader-postgresql-13-2.3.1-0.el7.x86_64 timescaledb-2-postgresql-13-2.3.1-0.el7.x86_64

    现在,我们准备安装 PG 13 版本的 TimescaleDB 包。

    $ yum install timescaledb-2-loader-postgresql-13-2.3.1-0.el7.x86_64 timescaledb-2-postgresql-13-2.3.1-0.el7.x86_64

    安装后,您可以尝试运行timescaledb-tune 工具来调整 postgresql.conf 配置文件。只需运行以下命令:

    $  timescaledb-tune --pg-config=/usr/pgsql-13/bin/pg_config

    现在,让我们也安装 PG 13 版本的 PostGIS 包。

    $ yum install -y postgis31_13.x86_64 

    参考这个链接Upgrading PostgreSQL 11 to PostgreSQL 13 with TimescaleDB and PostGIS in Linux using pg_upgrade | Severalnines

  • 相关阅读:
    MySQL数据库备份与还原批处理脚本
    React.useCallback(function,array)使用,React中的函数组件和类组件的取值(快照or最新值)
    面向对象编程(四)
    Vue.js之MVVM设计模式
    python3 批量更新包,解决Specify --upgrade to force replacement
    47个Docker常见故障的原因和解决方式
    【指针数组】【数组指针】【函数指针】【函数指针数组】【回调函数】你都会吗
    linux安装mysql8.0
    RTSP/Onvif安防平台EasyNVR接入EasyNVS,出现报错“Login error, i/o deadline reached”的解决方法
    树莓派(六)树莓派交叉编译
  • 原文地址:https://blog.csdn.net/jsboy123/article/details/133355650