#yasom常见故障处理
在实际使用过程中,yasom进程可能会因网络、服务器等原因造成异常场景,可参考以下解决方案:
# 主yasom进程故障
故障现象
执行主yasom特有功能报错connection refused。
解决方案
方案一:在一台没有yasom的服务器上恢复出一个主yasom,执行yasboot process yasom recover -c yashandb -l 192.168.1.3:1675 --role primary。
方案二:在一台已有备yasom的服务器上进行升主,执行yasboot process yasom recover -c yashandb --role primary。
# yasom出现多主
故障现象
执行任何操作都会报错"primary yasom is inconsistent"。
可能原因
发生网络通信异常后手动恢复出新的primary yasom,待网络恢复时原primary yasom与新primary yasom共存,出现多主现象。
问题定位
$ yasboot process yasom status -c yashandb
+-------------------------------------------------------------------------------------------------------------------+
| hostid | pid | ipaddr | primary | secondary | local_yasom_addr | role | backup_num | max_seq |
+-------------------------------------------------------------------------------------------------------------------+
| host0001 | 16806 | 192.168.1.2 | 192.168.1.2:1675 | [] | 192.168.1.2:1675 | primary | 4 | 41 |
+----------+-------+-------------+------------------+-----------+------------------+---------+------------+---------+
| host0002 | 25832 | 192.168.1.3 | 192.168.1.3:1675 | [] | 192.168.1.3:1675 | primary | 5 | 43 |
+----------+-------+-------------+------------------+-----------+------------------+---------+------------+---------+
| host0003 | - | 192.168.1.4 | 192.168.1.3:1675 | [] | - | - | 5 | 43 |
+----------+-------+-------------+------------------+-----------+------------------+---------+------------+---------+
若出现上述类似返回结果,表示当前数据库集群中存在2个primary yasom进程。
解决方案
方案一:自动修复
在未开启yasom仲裁的环境中可以开启yasom自修复。
开启自修复功能后,出现多主异常时会尝试保留1个主yasom并将其余的yasom自动降备。被降备的yasom会将自身的元数据备份至$YASDB_HOME/om/{集群名称}/data/repair/。
若仍未解决问题,可尝试使用手动修复。
方案二:手动修复
# 主备配置不同步
故障现象
执行yasboot process yasom status,可以看到服务器间的primary和secondary信息不一致。
$ yasboot process yasom status -c yashandb
+------------------------------------------------------------------------------------------------------------------------------+
| hostid | pid | ipaddr | primary | secondary | local_yasom_addr | role | backup_num | max_seq |
+------------------------------------------------------------------------------------------------------------------------------+
| host0001 | 28550 | 192.168.1.2 | 192.168.1.3:1675 | [192.168.1.2:1675] | 192.168.1.2:1675 | secondary | 5 | 43 |
+----------+-------+-------------+------------------+--------------------+---------------------+-----------+------------+------+
| host0002 | 25832 | 192.168.1.3 | 192.168.1.3:1675 | [192.168.1.2:1675] | 192.168.1.3:1675 | primary | 5 | 43 |
+----------+-------+-------------+------------------+--------------------+------------------+-----------+------------+---------+
| host0003 | - | 192.168.1.4 | 192.168.1.3:1675 | [] | - | - | 5 | 43 |
+----------+-------+--------------+-----------------+--------------------+------------------+-----------+------------+---------+
可能原因
执行recover或clean操作时,有yasagent出现宕机或超时,导致新的yasom的信息没有同步到该服务器。
解决方案
以安装用户登录任意一台服务器,并执行yasboot process yasom sync进行数据同步。

