当前位置:网站首页>HAC集群修改管理员用户密码
HAC集群修改管理员用户密码
2022-07-06 05:15:00 【瀚高PG实验室】
瀚高数据库
目录
环境
文档用途
详细信息
环境
系统平台:Linux x86-64 Red Hat Enterprise Linux 7
版本:4.5.6,4.5.7
文档用途
本文档用于指导HAC集群修改管理员用户密码
详细信息
1、检查集群状态,使用A、B两种方法进行判断
方法A:使用集群命令,确保TL时间线一致,Lag in MB数据同步延迟不能过高,最好延迟为0。
[[email protected] ~]# hghactl list
+ Cluster: ha (7072256965608815760) -------+---------+----+-----------+
| Member | Host | Role | State | TL | Lag in MB |
+----------+---------------------+---------+---------+----+-----------+
| hghac228 | 192.168.80.228:5866 | Leader | running | 6 | |
| hghac230 | 192.168.80.230:5866 | Replica | running | 6 | 0 |
+----------+---------------------+---------+---------+----+-----------+
方法B:各个节点查询进程,有sender节点的是主库,有receiver节点的是备库
ps -ef | grep sender
root 26418 3233 0 6月11 ? 00:00:22 postgres: c: walsender sysdba 192.168.80.228(45186) streaming 0/16000000
ps -ef | grep receiver
root 3372 3348 0 6月11 ? 00:13:54 postgres: c: walreceiver streaming 0/16000000
2、暂停集群
(任意节点执行即可,暂停集群只是停止集群主备切换,不影响数据库使用)
hghactl pause
3、修改密码(只能在主库执行)
highgo=# alter user sysdba with password '[email protected]!';
4、主备库修改密码文件
vim ~/.pgpass
#hostname:port:database:username:password
localhost:5866:highgo:sysdba:[email protected]12345
localhost:5866:highgo:syssso:[email protected]12345
冒号为分隔符,倒数第二位用户名,最后一位数据库密码,将密码修改为修改之后的密码即可,保存退出。
5、主备库修改集群配置文件
vim /opt/HighGo/tools/hghac/hghac.yaml
authentication:
replication:
password: [email protected]123
username: sysdba
rewind:
password: [email protected]123
username: sysdba
sysdba:
password: [email protected]123
syssso:
password: [email protected]123
syssao:
password: [email protected]123
根据对应的用户名修改密码即可,保存退出。
6、备库修改data目录下的postgresql.auto.conf文件
vim $PGDATA/postgresql.auto.conf
primary_conninfo = 'user=sysdba password=''[email protected]'' host=192.168.80.228 port=5866 sslmode=prefer sslcompression=0 gssencmode=disable krbsrvname=postgres target_session_attrs=any'
注意:password前边的user为sysdba,即修改用户sysdba的密码
7、恢复集群(任意节点执行即可)
hghactl resume
8、重启集群生效(任意节点执行即可)
hghactl restart c
注意:
最后一个参数c是集群的名字,查看方法
ps -ef | grep -v grep |grep post |awk '{print $9}'|tail -1|awk '{sub(/.$/,"")}1'
9、查看集群状态
hghactl list
10、重新初始化所有节点的hgproxy
(如果没有使用hgproxy请跳过该步骤)
systemctl stop hgproxy-4.0.2.service --停掉hgproxy服务,hgproxy后边具体内容请使用tab健补齐(proxy版本迭代service不一样)
proxy_ctl init -h 192.168.1.54 -U sysdba -d highgo -p 5866 --初始化
systemctl start hgproxy-4.0.2.service --启动hgproxy服务
11、其他
执行hghactl等集群命令提示“未找到命令”,请配置环境变量,参考如下:
vim ~/.bash_profile
export PGPORT=5866
export PGUSER=sysdba
export PGDATABASE=highgo
export PGHOME=/opt/HighGo4.5.7-see
export PGDATA=/opt/HighGo4.5.7-see/data
export PATH=$PGHOME/bin:$PATH:$HOME/bin:/opt/HighGo/tools/hgproxy/bin:/opt/HighGo/tools/hghac:/opt/HighGo/tools/hghac/etcd
export LD_LIBRARY_PATH=$PGHOME/lib:/usr/lib64:$LD_LIBRARY_PATH
export ETCDCTL_ENDPOINTS=http://10.1.194.182:2379,http://10.1.194.191:2379,http://10.1.194.192:2379
export PATRONICTL_CONFIG_FILE=/opt/HighGo/tools/hghac/hghac-see.yaml
source ~/.bash_profile
注意:
1、需要根据实际情况修改环境变量实际路径,可以使用find命令查找文件路径
例:查找hghac find / -iname hghac -print
2、ETCDCTL_ENDPOINTS三个ip需要修改为配置etcd三节点的ip,可以参考/opt/HighGo/tools/hghac/hghac-see.yaml文件中的etcd:hosts
边栏推荐
- Talking about the type and function of lens filter
- Steady, 35K, byte business data analysis post
- The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
- 2021 robocom world robot developer competition - undergraduate group (semi-finals)
- MySQL if and ifnull use
- Acwing week 58
- flutter 实现一个有加载动画的按钮(loadingButton)
- Mongodb basic knowledge summary
- Rce code and Command Execution Vulnerability
- 趋势前沿 | 达摩院语音 AI 最新技术大全
猜你喜欢

Excel转换为Lua的配置文件
![[classic example] binary tree recursive structure classic topic collection @ binary tree](/img/39/0319c4be43716f927b9d98d89f7655.jpg)
[classic example] binary tree recursive structure classic topic collection @ binary tree

Vite configures the development environment and production environment

Nacos - TC Construction of High available seata (02)

Ad20 is set with through-hole direct connection copper sheet, and the bonding pad is cross connected

Postman管理测试用例

The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower

Postman断言
![[untitled]](/img/7e/d0724193f2f2c8681a68bda9e08289.jpg)
[untitled]

Principle and performance analysis of lepton lossless compression
随机推荐
Application of Flody
Some common skills on unity inspector are generally used for editor extension or others
浅谈镜头滤镜的类型及作用
The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
集合详解之 Map + 面试题
图数据库ONgDB Release v-1.0.3
Summary of redis AOF and RDB knowledge points
yolov5 tensorrt加速
从0到1建设智能灰度数据体系:以vivo游戏中心为例
Rce code and Command Execution Vulnerability
Why does MySQL need two-phase commit
Select knowledge points of structure
树莓派3.5寸屏幕白屏显示连接
Implementing fuzzy query with dataframe
Realize a binary read-write address book
L'introduction en bourse de MSK Electronics a pris fin: 800 millions de RMB d'actifs de Henan étaient des actionnaires
Postman pre script - global variables and environment variables
Mongodb basic knowledge summary
Nacos TC setup of highly available Seata (02)
Summary of redis basic knowledge points