helm启动postgre-stolon

1. 安装文件准备

  • chart包
    旧的url: https://github.com/helm/charts ,下载 charts-master,里边包含stolon目录。
    新的url:https://artifacthub.io/
  • 安装文档
    找到stolon目录,下边有安装文档和所有可以覆盖的变量。

2. 设置

根据条件修改values.yaml文件

  • 存储大小
.........
persistence:
  enabled: true
  storageClassName: ""
  accessModes:
    - ReadWriteOnce
  # 修改存储大小
  size: 30Gi
 ..........
  • 账号密码
superuserUsername: "stolon"
## password for the superuser (REQUIRED if superuserSecret is not set)
superuserPassword: "1Wxxx"

replicationUsername: "repluser"
## password for the replication user (REQUIRED if replicationSecret is not set)
replicationPassword: "1Wxxx"
  • 最大连接数
 pgParameters:
  #修改最大连接数
  max_connections: "1000"
 ..........
  • poxy对外提供服务
proxy:
  replicaCount: 2
  annotations: {}
  resources: {}
  priorityClassName: ""
  service:
#    type: ClusterIP
    type: NodePort
#    loadBalancerIP: ""
    annotations: {}
    ports:
      proxy:
        port: 5432
        targetPort: 5432
        nodePort: 31013
        protocol: TCP

3. 安装

# kubectl create namespace stolon
# cd charts-master/stable/stolon
# helm install  -n stolon   ./

4. 查看

查看启动的pod如下

# kubectl get pod -n stolon
NAME                               READY   STATUS      RESTARTS   AGE
stolon-create-cluster-rc4lq        0/1     Completed   0          15m
stolon-keeper-0                    1/1     Running     0          15m
stolon-keeper-1                    1/1     Running     0          10m
stolon-proxy-8956f45f9-p58kw       1/1     Running     0          15m
stolon-proxy-8956f45f9-x2dlw       1/1     Running     0          15m
stolon-sentinel-5885bf6c65-2gj7w   1/1     Running     0          15m
stolon-sentinel-5885bf6c65-64jn9   1/1     Running     0          15m

说明:

  • keeper:他负责管理PostgreSQL的实例汇聚到由sentinel(s)提供的clusterview。实际的postgresql实例也在这个pod里。
  • sentinel:负责发现并且监控keeper,并且计算最理想的clusterview。
  • proxy:客户端的接入点。它强制连接到右边PostgreSQL的master并且强制关闭连接到由非选举产生的master。

【FAQ】

1)修改最大连接数

1)修改chart中values.yaml中变量为合适值
2)helm upgrade
3)删除stolon-keeper-0 和 stolon-keeper-1 ,等待自动重启后即可
4)查看最大连接数命令:

> show max_connections;

在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

玄德公笔记

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值