openGauss、MogDB 3.0.3
Mogdb gaussdb.state文件异常导致Failed to read gaussdb.state: 2Failed to set gaussdb.state with UNKNOWN_STATE。
MogDB gaussdb.state文件异常,可能跟强制关闭Mogdb数据库等有关系。
关于gaussdb.state文件的描述资料很少,该文件是openGauss、MogDB数据库的数据文件,数据文件出现异常会导致数据库无法启动,可以通过rm该文件,重启MogDB、openGauss数据库会重新生成该文件;至于该文件为什么异常猜测更大可能跟强制断电、异常关闭数据库有关。
[omm@ora121c-node01 data]$ gs_ctl start
[2023-03-12 16:46:34.304][6561][][gs_ctl]: gs_ctl started,datadir is /data/mogdb/data
[2023-03-12 16:46:34.370][6561][][gs_ctl]: waiting for server to start...
.0 LOG: [Alarm Module]can not read GAUSS_WARNING_TYPE env.
0 LOG: [Alarm Module]Host Name: ora121c-node01
0 LOG: [Alarm Module]Host IP: 192.168.56.60
0 LOG: [Alarm Module]Cluster Name: mogdb_cluster1
0 WARNING: failed to open feature control file, please check whether it exists: FileName=gaussdb.version, Errno=2, Errmessage=No such file or directory.
0 WARNING: failed to parse feature control file: gaussdb.version.
0 WARNING: Failed to load the product control file, so gaussdb cannot distinguish product version.
2023-03-12 16:46:34.501 [unknown] [unknown] localhost 47030036713152 0[0:0#0] 0 [BACKEND] LOG: when starting as multi_standby mode, we couldn't support data replicaton.
Failed to read gaussdb.state: 2Failed to set gaussdb.state with UNKNOWN_STATE[2023-03-12 16:46:35.371][6561][][gs_ctl]: waitpid 6564 failed, exitstatus is 256, ret is 2
[2023-03-12 16:46:35.371][6561][][gs_ctl]: stopped waiting
[2023-03-12 16:46:35.371][6561][][gs_ctl]: could not start server
Examine the log output.
[omm@ora121c-node01 data]$ ls -lt /data/mogdb/log/pg_log/dn_6001|more
total 14124
-rw------- 1 omm omm 15975 Mar 8 00:51 postgresql-2023-03-08_005114.log
-rw------- 1 omm omm 15855 Mar 8 00:51 postgresql-2023-03-08_005112.log
-rw------- 1 omm omm 15623 Mar 8 00:51 postgresql-2023-03-08_005110.log
-rw------- 1 omm omm 15907 Mar 8 00:51 postgresql-2023-03-08_005108.log
-rw------- 1 omm omm 86016 Mar 8 00:50 postgresql-2023-03-08_000000.log
-rw------- 1 omm omm 446699 Mar 7 23:59 postgresql-2023-03-07_194519.log
-rw------- 1 omm omm 44364 Mar 7 19:45 postgresql-2023-03-07_193431.log
-rw------- 1 omm omm 203172 Mar 6 16:39 postgresql-2023-03-06_144859.log