暂无图片
暂无图片
1
暂无图片
暂无图片
暂无图片

「YashanDB个人版体验」使用yasboot工具的部分设置记录

原创 H 2023-11-08
1086

使用yasboot工具启动数据库,报错找不到环境变量

[yp@Host-TOM stage]$ yasboot cluster start -c yashandb
file name: /home/yp/.yasboot/yashandb.env, environment file is not exist, is command 'package install' already executed?

无标题.png

说明,yasboot在当前系统中找不到 yashandb 的数据库配置。根据以上的错误提示,可以执行以下命令:
(路径根据报错信息对应修改)

无标题.png

从图片中,可以看到当前只存在 yasdb 这个数据库的配置。所以,我们需要启动的数据库其实是 yasdb,命令为:

yasboot cluster start -c yasdb

使用yasboot工具启动数据库,报错连接失败

[yp@Host-TOM stage]$ yasboot cluster start -c yasdb
dial tcp 192.168.23.58:1975: connect: connection refused

无标题.png

说明,此时yasboot管理工具连接不上om和agent,需要启动om和agent。需要提前启动。对应的命令为:

# 启动yasom进程
yasboot process yasom start -c yasdb
# 启动yasagent进程
yasboot process yasagent start -c yasdb

之后再执行启动命令,就可以正常启动了。

使用yasboot工具设置数据库自动拉起

守护进程的作用是,在数据库被手动kill掉或者其他情形,导致数据库退出时,自动拉起数据库。
启动守护进程

yasboot monit start --cluster yasdb

查看守护进程的监控状态

yasboot monit summary -c yasdb

从结果可以看到monit正在监控数据库以及om,agent的运行状态。
此时执行ps -ef|grep monit可以看到monit进程正在运行,如果手动kill掉数据库进程,om或者agent,会被monit自动拉起

如果需要配置服务器启动后,崖山数据库自动启动。可以在 系统文件中增加配置

vi /etc/rc.local
# 以yashan用户启动monit进程,而后monit进程会拉起其他进程。

sudo -u yashan /home/yp/home/yashandb/23.1.1.100/ext/monit/monit -c /home/yp/home/yashandb/23.1.1.100/ext/monit/monitrc
最后修改时间:2023-11-13 09:25:24
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论