码农知识堂 - 1000bd
  •   Python
  •   PHP
  •   JS/TS
  •   JAVA
  •   C/C++
  •   C#
  •   GO
  •   Kotlin
  •   Swift
  • centos7 + citus12 + postgresql 14 安装



    1 安装及编译

    yum install -y centos-release-scl-rh epel-release

    yum update -y
    yum groupinstall -y 'Development Tools'

    yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm

    yum install -y postgresql14-devel postgresql14-server postgresql14-contrib   \
                          git libcurl-devel libxml2-devel libxslt-devel \
                          libzstd-devel llvm-toolset-7-clang llvm5.0 lz4-devel \
                          openssl-devel pam-devel readline-devel


                          
    git clone https://github.com/citusdata/citus.git
    cd citus
    PG_CONFIG=/usr/pgsql-14/bin/pg_config ./configure
    make
    make install
                          
    2 所有节点:postgresql配置修改

    pg_hba.conf
    # Allow unrestricted access to nodes in the local network. The following ranges
    # correspond to 24, 20, and 16-bit blocks in Private IPv4 address spaces.
    host    all             all             192.168.56.0/24              trust

    postgresql.conf:
    # Uncomment listen_addresses for the changes to take effect
    listen_addresses = '*'
    shared_preload_libraries = 'citus'

    3 重启postgresql:
    pg_ctl restart

    4 所有节点:创建扩展citus
    psql:

    CREATE EXTENSION citus;
    5 对应的节点上,修改hosts文件
      vi /etc/hosts:
       
      192.168.56.90 cn1
      192.168.56.91 wn1
      192.168.56.92 wn2
      
    6 配置 coordinator node
      
     # Register the hostname that future workers will use to connect
    # to the coordinator node.
    #
    # You'll need to change the example, 'coord.example.com',
    # to match the actual hostname

    psql:

    SELECT citus_set_coordinator_host('cn1', 5432);

    # Add the worker nodes.
    #
    # Similarly, you'll need to change 'worker-101' and 'worker-102' to the
    # actual hostnames

    SELECT * from citus_add_node('wn1', 5432);
    SELECT * from citus_add_node('wn2', 5432);

    -- rebalance the shards over the new worker nodes
    SELECT rebalance_table_shards();

    Verify that installation has succeeded:

    SELECT * FROM citus_get_active_worker_nodes();

  • 相关阅读:
    k8s强制删除pod、svc、namespace(Terminating)
    淘宝商品详情页接口,淘宝实时销量接口,淘宝商品列表接口,淘宝APP详情接口,H5商品详情接口
    杰理之涂鸦APP显示连接的设备【篇】
    【JVM技术专题】TLAB内存分配+锁的碰撞技术串烧「难点-核心-遗漏」
    L3-005 垃圾箱分布
    Elasticsearch下载
    【Java】微服务——微服务介绍和Eureka注册中心
    Java数据结构技巧
    艾伦脑科学研究所,脑图谱,小鼠不同的功能脑区,可视化展示
    【爬虫--必须要了解的请求头 user-agent】
  • 原文地址:https://blog.csdn.net/ynzhangyao/article/details/133615624
  • 最新文章
  • 【JVM】编译执行与解释执行的区别是什么?JVM 使用哪种方式?
    用 Hashids 优雅解决 C 端自增 ID 暴露问题
    V8引擎 精品漫游指南--Ignition篇(上) 指令 栈帧 槽位 调用约定 内存布局 基础内容
    LLVM Pass快速入门(四):代码插桩
    milkup:桌面端 markdown AI续写和即时渲染
    基于项目工程构建SBOM(软件物料清单)的研究
    鸿蒙应用开发UI基础第二节:鸿蒙应用程序框架核心解析与实操
    .NET 中如何快速实现 List 集合去重?
    扣子Coze实战:从0到1打造抖音+小红书热点监控智能体
    浅谈数据访问层
  • 热门文章
  • 十款代码表白小特效 一个比一个浪漫 赶紧收藏起来吧!!!
    奉劝各位学弟学妹们,该打造你的技术影响力了!
    五年了,我在 CSDN 的两个一百万。
    Java俄罗斯方块,老程序员花了一个周末,连接中学年代!
    面试官都震惊,你这网络基础可以啊!
    你真的会用百度吗?我不信 — 那些不为人知的搜索引擎语法
    心情不好的时候,用 Python 画棵樱花树送给自己吧
    通宵一晚做出来的一款类似CS的第一人称射击游戏Demo!原来做游戏也不是很难,连憨憨学妹都学会了!
    13 万字 C 语言从入门到精通保姆级教程2021 年版
    10行代码集2000张美女图,Python爬虫120例,再上征途
小工具 小游戏
Copyright © 2022 侵权请联系2656653265@qq.com    京ICP备2022015340号-1

京公网安备 11010502049817号