Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question]: observer安装目录和运行目录不在同一目录导致Diagnostic执行报错 #325

Open
vzong opened this issue Jul 12, 2024 · 6 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request
Milestone

Comments

@vzong
Copy link

vzong commented Jul 12, 2024

Description

OceanBase Diagnostic Tool: 2.2.0

systemctl observer config:
[Unit]
Description=observer

[Service]
Type=forking
WorkingDirectory=/data/observer
ExecStart=/home/op1/oceanbase/bin/observer

Restart=on-failure
RestartSec=5
StartLimitInterval=0
User=op1
Group=op1
Environment="LD_LIBRARY_PATH=/home/op1/oceanbase/lib"
[Install]
WantedBy=multi-user.target

Due to WorkingDirectory=/data/observer, the pid file path is /data/observer/run/observer.pid
When i set home_path: /home/op1/oceanbase, running obdiag throw exception: 'cat: /home/op1/oceanbase/run/observer.pid: No such file or directory'.
When i set home_path: /data/observer, running obdiag throw exception: '/data/observer/bin/observer: No such file or directory'.

@Teingi
Copy link
Contributor

Teingi commented Jul 12, 2024

~/.obdiag/config.yml 中observer 的home_path应该是WorkingDirectory

@vzong
Copy link
Author

vzong commented Jul 12, 2024

~/.obdiag/config.yml 中observer 的home_path应该是WorkingDirectory

When i set home_path: /data/observer, running obdiag throw exception: '/data/observer/bin/observer: No such file or directory'.

@Teingi
Copy link
Contributor

Teingi commented Jul 12, 2024

这个部署方式是你们自己写的部署方式吗,非官方文档标准的部署方式

@vzong
Copy link
Author

vzong commented Jul 12, 2024

安装目录和运行目录,不在同一个磁盘目录是一个常规需求,不应该绑定pid在ob_install_dir目录。能否home_path拆分成两个变量,install_dir、work_dir,默认这两个变量都是一样,但是允许用户指定。

官方文档:
# observer的安装目录,例如observer的可执行程序为/root/observer/bin/observer
# 则需要填写的home_path为/root/observer
home_path: /root/observer

pid源码:

def get_observer_pid(ssh_client, ob_install_dir, stdio=None):
"""
get observer pid
:return:
"""
try:
cmd = "cat {ob_install_dir}/run/observer.pid".format(ob_install_dir=ob_install_dir)
pids = ssh_client.exec_cmd(cmd)
pid_list = pids.split()
stdio.verbose("get observer pid, run cmd = [{0}], result:{1} ".format(cmd, pid_list))
except:
stdio.verbose("get observer pid failed")
return []
return pid_list

@Teingi
Copy link
Contributor

Teingi commented Jul 12, 2024

good idea

@Teingi
Copy link
Contributor

Teingi commented Jul 12, 2024

纳入2.4.0 迭代

@Teingi Teingi self-assigned this Jul 12, 2024
@Teingi Teingi added the bug Something isn't working label Jul 12, 2024
@Teingi Teingi added this to the v2.3.0 milestone Jul 12, 2024
@Teingi Teingi added the enhancement New feature or request label Jul 12, 2024
@Teingi Teingi modified the milestones: v2.3.0, v2.4.0 Jul 22, 2024
@Teingi Teingi modified the milestones: v2.4.0, v2.5.0 Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants