初始化完数据库提示缺少server文件的处理方法
文章目录
- 文档用途
- 详细信息
文档用途
本文档适用于解决数据库启动过程中提示缺少server文件。
详细信息
1.问题描述:
部分数据库安装包在安装后不会自动初始化数据库,需手动进行初始化数据库,初始化完成后按照提示启动数据库时会提示报错:
waiting for server to start....2020-12-23 15:07:11.690 CST [17303] FATAL: could not load server certificate file "server.crt": No such file or directory
2020-12-23 15:07:11.690 CST [17303] LOG: database system is shut down
2.解决方案:
将安装目录下etc目录下的server.key及server.crt文件拷贝至data目录下并将server.key赋权为0600
具体步骤(以4.5.2为例):
2.1 拷贝server文件至data目录
[root@hgdw3 etc]# cp /opt/HighGo4.5.2-see/etc/server.* /opt/HighGo4.5.2-see/data
2.2 对server.key赋权
[root@hgdw3 etc]# chmod 0600 /opt/HighGo4.5.2-see/data/server.key
2.3 启动数据库
[root@hgdw3 etc]# pg_ctl startwaiting for server to start....2020-12-23 16:33:22.091 CST [22309] LOG: starting HighGo Security Enterprise Edition Database System 4.5.2 on CentOS7 x86_64,build on 20201009
2020-12-23 16:33:22.093 CST [22309] LOG: listening on IPv6 address "::1", port 5866
2020-12-23 16:33:22.093 CST [22309] LOG: listening on IPv4 address "127.0.0.1", port 5866
2020-12-23 16:33:22.100 CST [22309] LOG: listening on Unix socket "/tmp/.s.PGSQL.5866"
2020-12-23 16:33:22.132 CST [22309] LOG: This is a trial edition, validate until 2021-01-22 15:06:15.
2020-12-23 16:33:22.137 CST [22312] LOG: database system was shut down at 2020-12-23 15:06:19 CST
2020-12-23 16:33:22.138 CST [22312] LOG: Switchover the SSHA Role. Current is NONE
2020-12-23 16:33:22.146 CST [22309] LOG: database system is ready to accept connectionsdone
server started
至此,数据库启动过程中提示缺少server文件问题即解决。