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

[复制链接]
发表于 2024-5-19 20:31:29 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
问题现象
ps -ef | grep yas 查看无yasom和yasagent历程,且在{数据库安装目录}/om/{数据库名称}的目录下没有conf、data、log等目录,确定数据库不是用yasboot安装,是用脚本安装的
问题的风险及影响
非yasboot安装,ycm无法完成托管,无法监控监控
问题影响的版本
不涉及ycm的版本问题
问题发生原因
数据库版本太旧或安装数据库的人没有按照规范利用yasboot安装
办理方法及规避方式
将数据库先托管到yasom中,再托管到ycm中
问题分析和处理过程
点击查看代码
  1. (1)生成配置文件
  2. -- ip必须是本机ip,install-path不能和安装的数据库path重重复
  3. ./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
  4.   
  5. [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
  6. 192.168.39.70
  7.   192.168.39.70:1688 is already used
  8. hostid   | group | node_type | node_name | listen_addr        | din_addr           | replication_addr   | data_path                                 
  9. --------------------------------------------------------------------------------------------------------------------------------------------------------
  10. 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
  11. ----------+-------+-----------+-----------+--------------------+--------------------+--------------------+----------------------------------------------
  12.   
  13. Generate config success
  14.   
  15.   
  16. (2)安装yasom和yasagent
  17. ./bin/yasboot package install -i yashandb-22.2.3.0-linux-aarch64.tar.gz -t hosts.toml
  18.   
  19.   
  20. [yashan@KylinV10 yasdb_yasom]$ ./bin/yasboot package install -i yashandb-22.2.3.0-linux-aarch64.tar.gz -t hosts.toml
  21. checking install profile.toml...
  22. install version: yashandb 22.2.3.0
  23. update host to yasom...
  24. [yashan@KylinV10 yasdb_yasom]$ ps -ef | grep yas
  25. yashan   3945392       1  0 15:04 ?        00:00:25 yasdb open -D /home/yashan/yashandb/yasdb_data
  26. root     3950422 3950243  0 15:37 pts/1    00:00:00 su - yashan
  27. yashan   3950423 3950422  0 15:37 pts/1    00:00:00 -bash
  28. root     3953443 3952376  0 15:49 pts/2    00:00:00 su - yashan
  29. yashan   3953444 3953443  0 15:49 pts/2    00:00:00 -bash
  30. 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
  31. 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
  32. yashan   3955542 3950423  0 16:06 pts/1    00:00:00 ps -ef
  33. yashan   3955543 3950423  0 16:06 pts/1    00:00:00 grep yas
  34.   
  35. (3)生成托管配置模版
  36. ./bin/yasboot package config join-demo -t SE
  37.   
  38. [yashan@KylinV10 yasdb_yasom]$ ./bin/yasboot package config join-demo -t SE
  39. [yashan@KylinV10 yasdb_yasom]$ ll
  40. 总用量 221716
  41. drwxrwxr-x 6 yashan yashan        70  5月  4  2023 admin
  42. drwxrwxr-x 3 yashan yashan       220  5月  4  2023 bin
  43. drwxrwxr-x 2 yashan yashan        30  4月 17 16:05 client
  44. drwxrwxr-x 3 yashan yashan       126  4月 17 16:06 conf
  45. -rw-rw-r-- 1 yashan yashan     10974  5月  4  2023 gitmoduleversion.dat
  46. -rw------- 1 yashan yashan       386  4月 17 16:05 hosts.toml
  47. drwxrwxr-x 2 yashan yashan        65  5月  4  2023 include
  48. drwxrwxr-x 3 yashan yashan        17  5月  4  2023 java
  49. -rw-r--r-- 1 yashan yashan       527  4月 17 16:15 join_demo.toml
  50. drwxr-xr-x 2 yashan yashan      4096  5月  4  2023 lib
  51. drwxrwxr-x 2 yashan yashan         6  4月 17 16:06 log
  52. drwxrwxr-x 3 yashan yashan        38  4月 17 15:50 om
  53. drwxrwxr-x 2 yashan yashan       115  5月  4  2023 scripts
  54. -rw------- 1 yashan yashan       549  4月 17 16:05 yasdb.toml
  55. drwxrwxr-x 3 yashan yashan        22  4月 17 15:48 yashandb
  56. -rw-r--r-- 1 yashan yashan 227004643  4月 17 15:46 yashandb-22.2.3.0-linux-aarch64.tar.gz
  57.   
  58. (4)修改托管配置模版
  59. [yashan@KylinV10 yasdb_yasom]$ cat join_demo.toml
  60. cluster = "tt"
  61. sys_password = "yasdb_123"
  62. yas_type = "SE"
  63.   
  64. [primary_config]
  65.   manage_ip = "127.0.0.1"
  66.   yasdb_home = "/opt/yasom/yashandb/tt"
  67.   node_path = "/opt/yasom/yashandb/data/tt/db-1-1"
  68.   node_id = "1-1:1"
  69.   
  70. [[standby_config]]
  71.   manage_ip = "127.0.0.1"
  72.   yasdb_home = "/opt/yasom/yashandb/tt"
  73.   node_path = "/opt/yasom/yashandb/data/tt/db-1-2"
  74.   node_id = "1-2:1"
  75.   
  76. [[standby_config]]
  77.   manage_ip = "127.0.0.1"
  78.   yasdb_home = "/opt/yasom/yashandb/tt"
  79.   node_path = "/opt/yasom/yashandb/data/tt/db-1-3"
  80.   node_id = "1-3:1"
  81.   
  82. 修改后:
  83.   
  84. [yashan@KylinV10 yasdb_yasom]$ cat join_demo.toml
  85. cluster = "yasdb"
  86. sys_password = "yasdb_123"
  87. yas_type = "SE"
  88.   
  89. [primary_config]
  90.   manage_ip = "192.168.39.70"
  91.   yasdb_home = "/home/yashan/yashandb/yasdb_home"
  92.   node_path = "/home/yashan/yashandb/yasdb_data"
  93.   node_id = "1-1:1"
  94.   
  95.   
  96. (5)执行托管
  97. ./bin/yasboot cluster join -t SE --config join_demo.toml
  98.   
  99. [yashan@KylinV10 yasdb_yasom]$ ./bin/yasboot cluster join -t SE --config join_demo.toml
  100. the cluster status is as follow:
  101. |key         |value
  102. |------------+------
  103. |clusterName |yasdb
  104. |version     |22.2.3.0
  105.   
  106. the cluster status is as follow:
  107. hostid   | node_type | nodeid | pid     | instance_status | database_status | database_role | listen_address | data_path                     
  108. -------------------------------------------------------------------------------------------------------------------------------------------------
  109. host0001 | db        | 1-1:1  | 3945392 | open            | normal          | primary       | 0.0.0.0:1688   | /home/yashan/yashandb/yasdb_data
  110. ----------+-----------+--------+---------+-----------------+-----------------+---------------+----------------+----------------------------------
  111. Check success
  112. Are you sure you to add yasdb yasdb to yasom[yes/no]: yes
  113. type | uuid             | name             | hostid | index | status  | return_code | progress | cost
  114. -------------------------------------------------------------------------------------------------------
  115. task | eb0ecf155a0db5e6 | JoinYasdbCluster | -      | yasdb | SUCCESS | 0           | 100      | -  
  116. ------+------------------+------------------+--------+-------+---------+-------------+----------+------
  117. task completed, status: SUCCESS
  118.   
  119. (6)查看状态
  120. yashan@KylinV10 ~]$ yasboot cluster status -c yasdb -d
  121. hostid   | node_type | nodeid | pid     | instance_status | database_status | database_role | listen_address | data_path                             
  122. --------------------------------------------------------------------------------------------------------------------------------------------------------
  123. host0001 | db        | 1-1:1  | 3945392 | open            | normal          | primary       | 0.0.0.0:1688   | /home/yashan/yashandb/data/yasdb/db-1-1
  124. ----------+-----------+--------+---------+-----------------+-----------------+---------------+----------------+-----------------------------------------
复制代码
托管至yasom完成后,再按照流程托管至ycm即可
经验总结
安装数据库要按照规范安装,非规范安装会导致一系列问题
回复

使用道具 举报

登录后关闭弹窗

登录参与点评抽奖  加入IT实名职场社区
去登录
快速回复 返回顶部 返回列表