【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 即可

经验总结

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

相关文章
|
4月前
|
存储 关系型数据库 数据库
附部署代码|云数据库RDS 全托管 Supabase服务:小白轻松搞定开发AI应用
本文通过一个 Agentic RAG 应用的完整构建流程,展示了如何借助 RDS Supabase 快速搭建具备知识处理与智能决策能力的 AI 应用,展示从数据准备到应用部署的全流程,相较于传统开发模式效率大幅提升。
附部署代码|云数据库RDS 全托管 Supabase服务:小白轻松搞定开发AI应用
|
7月前
|
SQL 测试技术 数据库
【YashanDB知识库】IMP跨网络导入慢问题
问题现象:290M数据,本地导入2分钟,跨机导入耗时显著增加(最高30分钟)。 原因分析:`imp`逐条SQL通过网络传输至yashanDB执行,交互频繁导致性能下降。 影响版本:客户测试环境22.2.8.3。 解决方法:将导入文件上传至与yashanDB同机后使用`imp`,减少网络延迟。 经验总结:优化`imp`工具,支持直接上传文件至服务器端执行,降低网络依赖。
|
7月前
|
监控 数据库
【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)。
|
7月前
|
监控 网络安全 数据库
YashanDB 知识库:ycm 纳管主机安装 YCM-AGENT 时报错 “任务提交失败,无法连接主机”
在安装 ycm-agent 纳管主机时,可能出现因端口未开放导致的报错问题。此问题会阻止 YCM 对主机和数据库的监控功能,影响版本为 `yashandb-cloud-manager-23.2.1.100-linux-aarch64.tar`。原因是目标主机(如 10.149.223.121)未开放 9070 或 9071 端口。解决方法包括关闭防火墙、添加白名单或开放指定端口,需与管理员确认操作。处理过程涉及网络检查、端口测试等步骤。端口问题解决后,若再次安装报唯一键错误,需先移除失败主机再重试。
|
2月前
|
缓存 关系型数据库 BI
使用MYSQL Report分析数据库性能(下)
使用MYSQL Report分析数据库性能
97 3
|
2月前
|
关系型数据库 MySQL 数据库
自建数据库如何迁移至RDS MySQL实例
数据库迁移是一项复杂且耗时的工程,需考虑数据安全、完整性及业务中断影响。使用阿里云数据传输服务DTS,可快速、平滑完成迁移任务,将应用停机时间降至分钟级。您还可通过全量备份自建数据库并恢复至RDS MySQL实例,实现间接迁移上云。
|
3月前
|
存储 运维 关系型数据库
从MySQL到云数据库,数据库迁移真的有必要吗?
本文探讨了企业在业务增长背景下,是否应从 MySQL 迁移至云数据库的决策问题。分析了 MySQL 的优势与瓶颈,对比了云数据库在存储计算分离、自动化运维、多负载支持等方面的优势,并提出判断迁移必要性的五个关键问题及实施路径,帮助企业理性决策并落地迁移方案。
|
2月前
|
关系型数据库 MySQL 分布式数据库
阿里云PolarDB云原生数据库收费价格:MySQL和PostgreSQL详细介绍
阿里云PolarDB兼容MySQL、PostgreSQL及Oracle语法,支持集中式与分布式架构。标准版2核4G年费1116元起,企业版最高性能达4核16G,支持HTAP与多级高可用,广泛应用于金融、政务、互联网等领域,TCO成本降低50%。
|
2月前
|
关系型数据库 MySQL 数据库
阿里云数据库RDS费用价格:MySQL、SQL Server、PostgreSQL和MariaDB引擎收费标准
阿里云RDS数据库支持MySQL、SQL Server、PostgreSQL、MariaDB,多种引擎优惠上线!MySQL倚天版88元/年,SQL Server 2核4G仅299元/年,PostgreSQL 227元/年起。高可用、可弹性伸缩,安全稳定。详情见官网活动页。