【YashanDB 知识库】ycm 托管数据库时,数据库非 OM 安装无法托管

简介: 本文主要介绍了因数据库未按规范使用 yasboot 安装导致的问题及解决方法。问题表现为无 yasom 和 yasagent 进程,且目录结构缺失,致使 ycm 无法托管与监控。分析发现可能是数据库版本旧或安装不规范引起。解决方法为先生成配置文件,安装 yasom 和 yasagent,再生成并修改托管配置模板,最终通过命令完成托管至 yasom 和 ycm。总结强调了按规范安装数据库的重要性以避免类似问题。

问题现象

ps -ef | grep yas 查看无 yasom 和 yasagent 进程,且在 {数据库安装目录}/om/{数据库名称} 的目录下没有 conf、data、log 等目录,确定数据库不是用 yasboot 安装,是用脚本安装的

问题的风险及影响

非 yasboot 安装,ycm 无法完成托管,无法监控

问题影响的版本

不涉及 ycm 的版本问题

问题发生原因

数据库版本太旧或安装数据库的人没有按照规范使用 yasboot 安装

解决方法及规避方式

将数据库先托管到 yasom 中,再托管到 ycm 中

问题分析和处理过程

(1)生成配置文件

-- ip必须是本机ip,install-path不能和安装的数据库path重重复

./bin/yasboot package config gen --cluster yasdb -u yashan -p Cod-2024 --ip 192.168.39.70 --install-path /home/yashan/yashandb/yasdb_yasom -t se

[yashan@KylinV10 yasdb_yasom]$ ./bin/yasboot package config gen --cluster yasdb -u yashan -p Cod-2024 --ip 192.168.39.70 --install-path /home/yashan/yashandb/yasdb_yasom -t se

192.168.39.70

192.168.39.70:1688 is already used

hostid | group | node_type | node_name | listen_addr | din_addr | replication_addr | data_path

--------------------------------------------------------------------------------------------------------------------------------------------------------

host0001 | dbg1 | db | 1-1 | 192.168.39.70:1688 | 192.168.39.70:1689 | 192.168.39.70:1690 | /home/yashan/yashandb/yasdb_yasom/data/yasdb

----------+-------+-----------+-----------+--------------------+--------------------+--------------------+----------------------------------------------

Generate config success

(2)安装yasom和yasagent

./bin/yasboot package install -i yashandb-22.2.3.0-linux-aarch64.tar.gz -t hosts.toml

[yashan@KylinV10 yasdb_yasom]$ ./bin/yasboot package install -i yashandb-22.2.3.0-linux-aarch64.tar.gz -t hosts.toml

checking install profile.toml...

install version: yashandb 22.2.3.0

update host to yasom...

[yashan@KylinV10 yasdb_yasom]$ ps -ef | grep yas

yashan 3945392 1 0 15:04 ? 00:00:25 yasdb open -D /home/yashan/yashandb/yasdb_data

root 3950422 3950243 0 15:37 pts/1 00:00:00 su - yashan

yashan 3950423 3950422 0 15:37 pts/1 00:00:00 -bash

root 3953443 3952376 0 15:49 pts/2 00:00:00 su - yashan

yashan 3953444 3953443 0 15:49 pts/2 00:00:00 -bash

yashan 3955488 1 0 16:05 ? 00:00:00 /home/yashan/yashandb/yasdb_yasom/bin/yasagent --init -c yasdb -l 192.168.39.70:1676 --host-id host0001 -k 564e9e581348c9ae -d

yashan 3955503 1 0 16:06 ? 00:00:00 /home/yashan/yashandb/yasdb_yasom/bin/yasom --init -c yasdb -l 192.168.39.70:1675 -k 564e9e581348c9ae -d

yashan 3955542 3950423 0 16:06 pts/1 00:00:00 ps -ef

yashan 3955543 3950423 0 16:06 pts/1 00:00:00 grep yas

(3)生成托管配置模版

./bin/yasboot package config join-demo -t SE

[yashan@KylinV10 yasdb_yasom]$ ./bin/yasboot package config join-demo -t SE

[yashan@KylinV10 yasdb_yasom]$ ll

总用量 221716

drwxrwxr-x 6 yashan yashan 70 5月 4 2023 admin

drwxrwxr-x 3 yashan yashan 220 5月 4 2023 bin

drwxrwxr-x 2 yashan yashan 30 4月 17 16:05 client

drwxrwxr-x 3 yashan yashan 126 4月 17 16:06 conf

-rw-rw-r-- 1 yashan yashan 10974 5月 4 2023 gitmoduleversion.dat

-rw------- 1 yashan yashan 386 4月 17 16:05 hosts.toml

drwxrwxr-x 2 yashan yashan 65 5月 4 2023 include

drwxrwxr-x 3 yashan yashan 17 5月 4 2023 java

-rw-r--r-- 1 yashan yashan 527 4月 17 16:15 join_demo.toml

drwxr-xr-x 2 yashan yashan 4096 5月 4 2023 lib

drwxrwxr-x 2 yashan yashan 6 4月 17 16:06 log

drwxrwxr-x 3 yashan yashan 38 4月 17 15:50 om

drwxrwxr-x 2 yashan yashan 115 5月 4 2023 scripts

-rw------- 1 yashan yashan 549 4月 17 16:05 yasdb.toml

drwxrwxr-x 3 yashan yashan 22 4月 17 15:48 yashandb

-rw-r--r-- 1 yashan yashan 227004643 4月 17 15:46 yashandb-22.2.3.0-linux-aarch64.tar.gz

(4)修改托管配置模版

[yashan@KylinV10 yasdb_yasom]$ cat join_demo.toml

cluster = "tt"

sys_password = "yasdb_123"

yas_type = "SE"

[primary_config]

manage_ip = "127.0.0.1"

yasdb_home = "/opt/yasom/yashandb/tt"

node_path = "/opt/yasom/yashandb/data/tt/db-1-1"

node_id = "1-1:1"

[[standby_config]]

manage_ip = "127.0.0.1"

yasdb_home = "/opt/yasom/yashandb/tt"

node_path = "/opt/yasom/yashandb/data/tt/db-1-2"

node_id = "1-2:1"

[[standby_config]]

manage_ip = "127.0.0.1"

yasdb_home = "/opt/yasom/yashandb/tt"

node_path = "/opt/yasom/yashandb/data/tt/db-1-3"

node_id = "1-3:1"

修改后:

[yashan@KylinV10 yasdb_yasom]$ cat join_demo.toml

cluster = "yasdb"

sys_password = "yasdb_123"

yas_type = "SE"

[primary_config]

manage_ip = "192.168.39.70"

yasdb_home = "/home/yashan/yashandb/yasdb_home"

node_path = "/home/yashan/yashandb/yasdb_data"

node_id = "1-1:1"

(5)执行托管

./bin/yasboot cluster join -t SE --config join_demo.toml

[yashan@KylinV10 yasdb_yasom]$ ./bin/yasboot cluster join -t SE --config join_demo.toml

the cluster status is as follow:

|key |value

|------------+------

|clusterName |yasdb

|version |22.2.3.0

the cluster status is as follow:

hostid | node_type | nodeid | pid | instance_status | database_status | database_role | listen_address | data_path

-------------------------------------------------------------------------------------------------------------------------------------------------

host0001 | db | 1-1:1 | 3945392 | open | normal | primary | 0.0.0.0:1688 | /home/yashan/yashandb/yasdb_data

----------+-----------+--------+---------+-----------------+-----------------+---------------+----------------+----------------------------------

Check success

Are you sure you to add yasdb yasdb to yasom[yes/no]: yes

type | uuid | name | hostid | index | status | return_code | progress | cost

-------------------------------------------------------------------------------------------------------

task | eb0ecf155a0db5e6 | JoinYasdbCluster | - | yasdb | SUCCESS | 0 | 100 | -

------+------------------+------------------+--------+-------+---------+-------------+----------+------

task completed, status: SUCCESS

(6)查看状态

yashan@KylinV10 ~]$ yasboot cluster status -c yasdb -d

hostid | node_type | nodeid | pid | instance_status | database_status | database_role | listen_address | data_path

--------------------------------------------------------------------------------------------------------------------------------------------------------

host0001 | db | 1-1:1 | 3945392 | open | normal | primary | 0.0.0.0:1688 | /home/yashan/yashandb/data/yasdb/db-1-1

----------+-----------+--------+---------+-----------------+-----------------+---------------+----------------+-------------------------------

托管至 yasom 完成后,再按照流程托管至 ycm 即可

经验总结

安装数据库要按照规范安装,非规范安装会导致一系列问题

相关文章
|
12天前
|
SQL 关系型数据库 MySQL
MySQL下载安装全攻略!小白也能轻松上手,从此数据库不再难搞!
这是一份详细的MySQL安装与配置教程,适合初学者快速上手。内容涵盖从下载到安装的每一步操作,包括选择版本、设置路径、配置端口及密码等。同时提供基础操作指南,如数据库管理、数据表增删改查、用户权限设置等。还介绍了备份恢复、图形化工具使用和性能优化技巧,帮助用户全面掌握MySQL的使用方法。附带常见问题解决方法,保姆级教学让你无忧入门!
MySQL下载安装全攻略!小白也能轻松上手,从此数据库不再难搞!
|
26天前
|
Ubuntu 关系型数据库 Linux
Linux数据库安装
本文介绍了在CentOS 8.0和Ubuntu 22.04系统上安装、配置和启动MariaDB数据库服务器的详细步骤。包括通过`yum`和`apt`包管理器安装MariaDB服务,启动并检查服务运行状态,设置root用户密码以及连接数据库的基本操作。此外,还展示了如何在Ubuntu上更新软件包列表、安装依赖项,并验证MariaDB的版本和运行状态。通过这些步骤,用户可以成功部署并初始化MariaDB环境,为后续数据库管理与应用开发奠定基础。
41 4
|
1月前
|
监控 数据库
【YashanDB 知识库】ycm 托管数据库时报错 OM host ip:127.0.0.1 is not support join to YCM
在托管数据库时,若 OM 的 IP 被设置为 127.0.0.1,将导致无法托管至 YCM,并使数据库失去监控。此问题源于安装时修改了 OM 的监听 IP。解决方法包括:将 OM 的 IP 修改为本机实际 IP 或 0.0.0.0,同时更新 env 文件及 yasom 后台数据库中的相关配置。经验总结指出,应避免非必要的后台 IP 修改,且数据库安装需遵循规范,不使用仅限本机访问的 IP(如 127.0.0.1)。
|
1月前
|
存储 安全 数据库
风险防不胜防?看 YashanDB 如何守护你的数据库安全(上篇)
数据库作为信息系统核心,其安全性至关重要。本文聚焦数据库安全机制中的访问管理,涵盖身份认证、访问控制与反入侵措施。YashanDB通过口令认证、操作系统认证及双因素认证确保用户身份安全;实施基于角色(RBAC)和标签(LBAC)的访问控制,实现权限精细化管理;同时利用黑白名单与连接监听机制防范未授权访问和恶意攻击。这些措施共同保障数据的机密性、完整性和可用性,助力企业满足国家合规要求。下期将探讨威胁检测与数据保护内容,敬请期待!
|
1月前
|
存储 SQL 安全
风险防不胜防?看 YashanDB 如何守护你的数据库安全(下篇)
本文深入探讨数据库安全机制中的威胁监测与数据保护。在威胁监测方面,YashanDB 提供权限、行为和角色审计功能,支持异步审计降低性能影响,并通过安全漏洞扫描和硬件防护减少漏洞危害。数据保护部分涵盖通信加密(支持国密标准)、存储加密(表空间透明加密TDE)、备份加密及密钥管理等关键技术。此外,YashanDB 支持热备、增量备份和按时间点恢复,并实现安全销毁防止信息泄露,全面保障数据的机密性、完整性和可用性。
|
1月前
|
监控 网络安全 数据库
YashanDB 知识库:ycm 纳管主机安装 YCM-AGENT 时报错 “任务提交失败,无法连接主机”
在安装 ycm-agent 纳管主机时,可能出现因端口未开放导致的报错问题。此问题会阻止 YCM 对主机和数据库的监控功能,影响版本为 `yashandb-cloud-manager-23.2.1.100-linux-aarch64.tar`。原因是目标主机(如 10.149.223.121)未开放 9070 或 9071 端口。解决方法包括关闭防火墙、添加白名单或开放指定端口,需与管理员确认操作。处理过程涉及网络检查、端口测试等步骤。端口问题解决后,若再次安装报唯一键错误,需先移除失败主机再重试。
|
2月前
|
SQL 存储 关系型数据库
【YashanDB知识库】共享从 MySQL异常处理CONTINUE HANDLER的改写方法
【YashanDB知识库】共享从 MySQL异常处理CONTINUE HANDLER的改写方法
|
1月前
|
SQL 测试技术 数据库
【YashanDB知识库】IMP跨网络导入慢问题
问题现象:290M数据,本地导入2分钟,跨机导入耗时显著增加(最高30分钟)。 原因分析:`imp`逐条SQL通过网络传输至yashanDB执行,交互频繁导致性能下降。 影响版本:客户测试环境22.2.8.3。 解决方法:将导入文件上传至与yashanDB同机后使用`imp`,减少网络延迟。 经验总结:优化`imp`工具,支持直接上传文件至服务器端执行,降低网络依赖。
|
2月前
|
SQL 关系型数据库 MySQL
【YashanDB知识库】MySQL field 函数的改写方法
【YashanDB知识库】MySQL field 函数的改写方法
|
2月前
|
数据库
【YashanDB知识库】服务器重启后启动yasom和yasagent进程时有告警
【YashanDB知识库】服务器重启后启动yasom和yasagent进程时有告警

热门文章

最新文章