集群依赖sshd端口或sys_securecmdd(老版本为es_server)端口,由repmgr.conf配置文件中的use_scmd(老版本为use_es_server)控制,为on表示使用sys_securecmdd,为off表示使用sshd。
sshd 进程默认运行在 22 端口,在使用 deploy 工具部署集群时,对应的端口必须与 sshd 运行端口一致,端口信息在配置完成后,也会写入 repmgr.conf 文件。如果后续需要修改 sshd 运行端口,需同时修改 repmgr.conf 配置。
集群修改sshd端口步骤( 以下步骤,每个节点都需要执行一次 ):
#1. 修改/etc/ssh/sshd_config文件,修改Port参数为指定端口 Port 22 #2. 重启sshd服务 systemctl restart sshd #3. 修改 ${集群}/etc/repmgr.conf文件,修改参数 # 参数名称分多个版本,按最新版本->老版本,参数名称为: # scmd_options es_options ssh_options scmd_options='-q -o ConnectTimeout=10 -o StrictHostKeyChecking=no -o ServerAliveInterval=2 -o ServerAliveCountMax=5 -p 22' #4. 杀掉kbha和repmgrd进程,等待重启 kill -9 `pidof kbha repmgrd` #5. 查看集群状态(关注守护进程repmgrd是否为running) repmgr service status
集群修改sys_securecmdd端口步骤( 以下步骤,每个节点都需要执行一次 ):
#1. 修改/etc/.kes/securecmdd_config文件,修改Port参数为指定端口 Port 8890 #2. 重启sys_securecmdd服务 systemctl restart securecmdd #ps: 如果为专用机,直接ps -ef查询sys_securecmdd进程并kill,等待其重启 #3. 修改 ${集群}/etc/repmgr.conf文件,修改参数 # 参数名称分多个版本,按最新版本->老版本,参数名称为: # scmd_options es_options ssh_options scmd_options='-q -o ConnectTimeout=10 -o StrictHostKeyChecking=no -o ServerAliveInterval=2 -o ServerAliveCountMax=5 -p 8890' #4. 杀掉kbha和repmgrd进程,等待重启 kill -9 `pidof kbha repmgrd` #5. 查看集群状态(关注守护进程repmgrd是否为running) repmgr service status