为什么按照官方文档在部署后无法启动

【 使用环境 】生产环境 or 测试环境
【 OB or 其他组件 】
【 使用版本 】oceanbsae 4.3.0
【问题描述】无法启动 通过systemctl status oceanbase 显示 daemon PID file not found。
【复现路径】完全按照官方文档进行。使用EXSI虚机部署,虚机使用镜像是Anolis8.6版本。
【附件及日志】
[admin@localhost oceanbase]$ sudo systemctl status oceanbase
● oceanbase.service - oceanbase
Loaded: loaded (/etc/systemd/system/oceanbase.service; disabled; vendor preset: disabled)
Active: failed (Result: protocol) since Tue 2024-05-21 00:35:13 CST; 1min 12s ago
Process: 19603 ExecStart=/bin/bash /home/admin/oceanbase/profile/oceanbase-service.sh start (code=exited, status=0/SUCCESS)
Main PID: 19603 (code=exited, status=0/SUCCESS)

5月 21 00:35:11 localhost.localdomain systemd[1]: Starting oceanbase…
5月 21 00:35:11 localhost.localdomain bash[19603]: oceanbase service started at 2024-05-21 00:35:11
5月 21 00:35:13 localhost.localdomain bash[19603]: daemon PID file not found.
5月 21 00:35:13 localhost.localdomain bash[19603]: start ob_agent failed
5月 21 00:35:13 localhost.localdomain systemd[1]: oceanbase.service: Failed with result ‘protocol’.
5月 21 00:35:13 localhost.localdomain systemd[1]: Failed to start oceanbase.

###############################################################
[admin@localhost oceanbase]$ sudo systemctl start oceanbase
Job for oceanbase.service failed because the service did not take the steps required by its unit configuration.
See “systemctl status oceanbase.service” and “journalctl -xe” for details.

###############################################################

5月 21 00:31:19 localhost.localdomain sudo[19029]: pam_unix(sudo:session): session closed for user root
5月 21 00:35:05 localhost.localdomain sudo[19594]: admin : TTY=pts/0 ; PWD=/home/admin/oceanbase ; USER=root ; COMMAND=/bin/systemct>
5月 21 00:35:05 localhost.localdomain sudo[19594]: pam_systemd(sudo:session): Cannot create session: Already running in a session or us>
5月 21 00:35:05 localhost.localdomain sudo[19594]: pam_unix(sudo:session): session opened for user root by root(uid=0)
5月 21 00:35:05 localhost.localdomain sudo[19594]: pam_unix(sudo:session): session closed for user root
5月 21 00:35:07 localhost.localdomain sudo[19597]: admin : TTY=pts/0 ; PWD=/home/admin/oceanbase ; USER=root ; COMMAND=/bin/systemct>
5月 21 00:35:07 localhost.localdomain sudo[19597]: pam_systemd(sudo:session): Cannot create session: Already running in a session or us>
5月 21 00:35:07 localhost.localdomain sudo[19597]: pam_unix(sudo:session): session opened for user root by root(uid=0)
5月 21 00:35:07 localhost.localdomain sudo[19597]: pam_unix(sudo:session): session closed for user root
5月 21 00:35:11 localhost.localdomain sudo[19600]: admin : TTY=pts/0 ; PWD=/home/admin/oceanbase ; USER=root ; COMMAND=/bin/systemct>
5月 21 00:35:11 localhost.localdomain sudo[19600]: pam_systemd(sudo:session): Cannot create session: Already running in a session or us>
5月 21 00:35:11 localhost.localdomain sudo[19600]: pam_unix(sudo:session): session opened for user root by root(uid=0)
5月 21 00:35:11 localhost.localdomain systemd[1]: Starting oceanbase…
5月 21 00:35:11 localhost.localdomain bash[19603]: oceanbase service started at 2024-05-21 00:35:11
5月 21 00:35:13 localhost.localdomain bash[19603]: daemon PID file not found.
5月 21 00:35:13 localhost.localdomain bash[19603]: start ob_agent failed
5月 21 00:35:13 localhost.localdomain systemd[1]: oceanbase.service: Failed with result ‘protocol’.
5月 21 00:35:13 localhost.localdomain systemd[1]: Failed to start oceanbase.
5月 21 00:35:13 localhost.localdomain sudo[19600]: pam_unix(sudo:session): session closed for user root
5月 21 00:36:26 localhost.localdomain sudo[20157]: admin : TTY=pts/0 ; PWD=/home/admin/oceanbase ; USER=root ; COMMAND=/bin/systemct>
5月 21 00:36:26 localhost.localdomain sudo[20157]: pam_systemd(sudo:session): Cannot create session: Already running in a session or us>
5月 21 00:36:26 localhost.localdomain sudo[20157]: pam_unix(sudo:session): session opened for user root by root(uid=0)
5月 21 00:36:26 localhost.localdomain sudo[20157]: pam_unix(sudo:session): session closed for user root
5月 21 00:42:00 localhost.localdomain su[17870]: pam_unix(su:session): session closed for user admin
5月 21 00:46:29 localhost.localdomain systemd[1]: Reloading.
5月 21 00:46:34 localhost.localdomain su[20187]: (to admin) root on pts/0
5月 21 00:46:34 localhost.localdomain su[20187]: pam_systemd(su:session): Cannot create session: Already running in a session or user s>
5月 21 00:46:34 localhost.localdomain su[20187]: pam_unix(su:session): session opened for user admin by root(uid=0)
5月 21 00:46:46 localhost.localdomain sudo[20211]: admin : TTY=pts/0 ; PWD=/root ; USER=root ; COMMAND=/bin/systemctl restart oceanb>
5月 21 00:46:46 localhost.localdomain sudo[20211]: pam_systemd(sudo:session): Cannot create session: Already running in a session or us>
5月 21 00:46:46 localhost.localdomain sudo[20211]: pam_unix(sudo:session): session opened for user root by root(uid=0)
5月 21 00:46:46 localhost.localdomain systemd[1]: Starting oceanbase…
5月 21 00:46:46 localhost.localdomain bash[20214]: oceanbase service started at 2024-05-21 00:46:46
5月 21 00:46:48 localhost.localdomain bash[20214]: daemon PID file not found.
5月 21 00:46:48 localhost.localdomain bash[20214]: start ob_agent failed
5月 21 00:46:48 localhost.localdomain systemd[1]: oceanbase.service: Failed with result ‘protocol’.
5月 21 00:46:48 localhost.localdomain systemd[1]: Failed to start oceanbase.
5月 21 00:46:48 localhost.localdomain sudo[20211]: pam_unix(sudo:session): session closed for user root
5月 21 00:47:20 localhost.localdomain su[20187]: pam_unix(su:session): session closed for user admin
lines 1866-1914/1914 (END)
5月 21 00:27:06 localhost.localdomain sudo[18460]: pam_systemd(sudo:session): Cannot create session: Already running in a session or user slice
5月 21 00:27:06 localhost.localdomain sudo[18460]: pam_unix(sudo:session): session opened for user root by root(uid=0)
5月 21 00:27:20 localhost.localdomain sudo[18460]: pam_unix(sudo:session): session closed for user root
5月 21 00:30:32 localhost.localdomain sudo[19029]: admin : TTY=pts/0 ; PWD=/home/admin/oceanbase/profile ; USER=root ; COMMAND=/bin/vi /etc/oceanbase.cnf
5月 21 00:30:32 localhost.localdomain sudo[19029]: pam_systemd(sudo:session): Cannot create session: Already running in a session or user slice
5月 21 00:30:32 localhost.localdomain sudo[19029]: pam_unix(sudo:session): session opened for user root by root(uid=0)
5月 21 00:31:01 localhost.localdomain anacron[16298]: Job cron.daily' started 5月 21 00:31:01 localhost.localdomain run-parts[19034]: (/etc/cron.daily) starting logrotate 5月 21 00:31:01 localhost.localdomain run-parts[19039]: (/etc/cron.daily) finished logrotate 5月 21 00:31:01 localhost.localdomain anacron[16298]: Job cron.daily’ terminated
5月 21 00:31:19 localhost.localdomain sudo[19029]: pam_unix(sudo:session): session closed for user root
5月 21 00:35:05 localhost.localdomain sudo[19594]: admin : TTY=pts/0 ; PWD=/home/admin/oceanbase ; USER=root ; COMMAND=/bin/systemctl start oceandata
5月 21 00:35:05 localhost.localdomain sudo[19594]: pam_systemd(sudo:session): Cannot create session: Already running in a session or user slice
5月 21 00:35:05 localhost.localdomain sudo[19594]: pam_unix(sudo:session): session opened for user root by root(uid=0)
5月 21 00:35:05 localhost.localdomain sudo[19594]: pam_unix(sudo:session): session closed for user root
5月 21 00:35:07 localhost.localdomain sudo[19597]: admin : TTY=pts/0 ; PWD=/home/admin/oceanbase ; USER=root ; COMMAND=/bin/systemctl start oceandate
5月 21 00:35:07 localhost.localdomain sudo[19597]: pam_systemd(sudo:session): Cannot create session: Already running in a session or user slice
5月 21 00:35:07 localhost.localdomain sudo[19597]: pam_unix(sudo:session): session opened for user root by root(uid=0)
5月 21 00:35:07 localhost.localdomain sudo[19597]: pam_unix(sudo:session): session closed for user root
5月 21 00:35:11 localhost.localdomain sudo[19600]: admin : TTY=pts/0 ; PWD=/home/admin/oceanbase ; USER=root ; COMMAND=/bin/systemctl start oceanbase
5月 21 00:35:11 localhost.localdomain sudo[19600]: pam_systemd(sudo:session): Cannot create session: Already running in a session or user slice
5月 21 00:35:11 localhost.localdomain sudo[19600]: pam_unix(sudo:session): session opened for user root by root(uid=0)
5月 21 00:35:11 localhost.localdomain systemd[1]: Starting oceanbase…
5月 21 00:35:11 localhost.localdomain bash[19603]: oceanbase service started at 2024-05-21 00:35:11
5月 21 00:35:13 localhost.localdomain bash[19603]: daemon PID file not found.
5月 21 00:35:13 localhost.localdomain bash[19603]: start ob_agent failed
5月 21 00:35:13 localhost.localdomain systemd[1]: oceanbase.service: Failed with result ‘protocol’.
5月 21 00:35:13 localhost.localdomain systemd[1]: Failed to start oceanbase.
5月 21 00:35:13 localhost.localdomain sudo[19600]: pam_unix(sudo:session): session closed for user root

【SOP系列 22 】——故障诊断第一步(自助诊断和诊断信息收集)

提供以下:
1、参考的文档链接
2、ps -ef | grep observer | grep -v grep 确认一下observer进程是否存在
3、提供一下observer.log 日志附件

https://www.oceanbase.com/docs/common-oceanbase-database-cn-1000000000640297
使用的是“ 使用 systemd 部署 OceanBase 数据库”进行的安装。没有任何日志信息,甚至他都不能够创建run文件夹存放pid文件。
这是我的oceanbase.cnf文件内容 mysql_port=2881
rpc_port=2882
obshell_port=2886
root_pwd=""
redo_dir=/redo
data_dir=/data
datafile_size=2G
datafile_next=2G
datafile_maxsize=20G
cpu_count=16
memory_limit=10G
system_memory=5G
log_disk_size=13G
enable_syslog_wf=true
enable_syslog_recycle=true
max_syslog_file_count=4
__min_full_resource_pool_memory=1073741824

datafile_size=2G
datafile_next=2G
datafile_maxsize=20G
cpu_count=16
memory_limit=10G
system_memory=5G
log_disk_size=13G
默认配置得嘛?

oceanbase.cnf文件默认创建路径在/etc/下么

memory_limit=6G
system_memory=1G 只修改了这两部分 这个是默认参数

是的

调整调整参数值 试试。

这样找一下日志看看:find / -name “observer.log”,找到后将日志压缩上传一下。

另外确认一下部署启动后observer进程是否存在?

memory_limit调大点试试

文档中使用systemd 确实没有进程和日志。目前不知道原因,日志后续再看看上传。不过使用 文档中的命令行方式可以部署成功。

应该不是内存问题 ,我做过多次部署 ,调整过最大10G

obd得形式嘛?

是的 obd方式部署的可以。

如果还是失败,请提供一下 observer.log 日志看看。


可能是这两个参数问题,我也遇到同样情况,改了这两个参数就好了

检查一下在/etc/security/limits.d目录下是否有nofile.conf和nproc .conf文件,如果没有的话执行下面的语句
echo -e “* soft nofile 20000\n* hadr nofile 20000”>>/etc/security/limits.d/nofile.conf
echo -e “* soft nproc 120000\n* hadr nproc 120000”>>/etc/security/limits.d/nproc .conf
注意执行完上面的语句之后要退出当前会话才会生效,重新连接再执行相关的部署启动命令。