GreatSQL社区

搜索

reddey

oceanbase单机版部署我所踩的坑

reddey 已有 25 次阅读2025-4-20 10:22 |系统分类:运维实战


前不久从OB官网申请取得了OB单机机安装数据包,在进行自动化部署时,一切都很顺利,自动化部署是不要做参数调整的。在进行交互时部署,却踩到一个坑,自己搞了好几天才解决掉。我看其它大佬的文章部署交互式部署,都是一帆风顺的,但到我这里却一波三折,心情极度失落,这可能是对我的考验吧。本文分别介绍一下自动部署和交互式部署过程,请注意文章中标红的文字。先介绍一下我的系统环境,如下所示

[root@localhost ~]# cat /etc/redhat-release

Red Hat Enterprise Linux release 8.9 (Ootpa)

磁盘100G,内存为14G,CPU2核。

[root@localhost ~]# df -lh

Filesystem           Size  Used Avail Use% Mounted on

devtmpfs             7.1G     0  7.1G   0% /dev

tmpfs                7.2G     0  7.2G   0% /dev/shm

tmpfs                7.2G  9.6M  7.2G   1% /run

tmpfs                7.2G     0  7.2G   0% /sys/fs/cgroup

/dev/mapper/ol-root   64G   38G   26G  60% /

/dev/mapper/ol-home   32G  1.2G   30G   4% /home

/dev/sda1           1014M  352M  663M  35% /boot

tmpfs                1.5G   16K  1.5G   1% /run/user/42

tmpfs                1.5G     0  1.5G   0% /run/user/0

[root@localhost ~]# free -lh

             total        used        free      shared  buff/cache   available

Mem:           14Gi       1.9Gi       4.8Gi        10Mi       7.5Gi        11Gi

Low:           14Gi       9.5Gi       4.8Gi

High:            0B          0B          0B

Swap:         4.2Gi       1.0Mi       4.2Gi

[root@node02 bin]# obd demo -c oceanbase-standalone,obagent,grafana,prometheus

Package grafana-7.5.17-1 is available.

Package prometheus-2.37.1-10000102022110211.el8 is available.

Package oceanbase-standalone-4.2.5.3-103000152025033110.el8 is available.

Package obagent-4.2.2-100000042024011120.el8 is available.

install grafana-7.5.17 for local ok

install prometheus-2.37.1 for local ok

install oceanbase-standalone-4.2.5.3 for local ok

install obagent-4.2.2 for local ok

Cluster param config check ok

Open ssh connection ok

Generate grafana configuration ok

Generate prometheus configuration ok

Generate obagent configuration ok

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

|                                              Packages                                              |

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

| Repository           | Version | Release                | Md5                                      |

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

| grafana              | 7.5.17  | 1                      | 1bf1f338d3a3445d8599dc6902e7aeed4de4e0d6 |

| prometheus           | 2.37.1  | 10000102022110211.el8  | e4f8a3e784512fca75bf1b3464247d1f31542cb9 |

| oceanbase-standalone | 4.2.5.3 | 103000152025033110.el8 | 305669b55281773f5c53ff4e44ff9f7bed9f7bc0 |

| obagent              | 4.2.2   | 100000042024011120.el8 | bf152b880953c2043ddaf80d6180cf22bb8c8ac2 |

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

Repository integrity check ok

Load param plugin ok

Open ssh connection ok

Initializes obagent work home ok

Initializes observer work home ok

Initializes prometheus work home ok

Initializes grafana work home ok

Parameter check ok

Remote grafana-7.5.17-1-1bf1f338d3a3445d8599dc6902e7aeed4de4e0d6 repository install ok

Remote grafana-7.5.17-1-1bf1f338d3a3445d8599dc6902e7aeed4de4e0d6 repository lib check ok

Remote prometheus-2.37.1-10000102022110211.el8-e4f8a3e784512fca75bf1b3464247d1f31542cb9 repository install ok

Remote prometheus-2.37.1-10000102022110211.el8-e4f8a3e784512fca75bf1b3464247d1f31542cb9 repository lib check ok

Remote oceanbase-standalone-4.2.5.3-103000152025033110.el8-305669b55281773f5c53ff4e44ff9f7bed9f7bc0 repository install ok

Remote oceanbase-standalone-4.2.5.3-103000152025033110.el8-305669b55281773f5c53ff4e44ff9f7bed9f7bc0 repository lib check ok

Remote obagent-4.2.2-100000042024011120.el8-bf152b880953c2043ddaf80d6180cf22bb8c8ac2 repository install ok

Remote obagent-4.2.2-100000042024011120.el8-bf152b880953c2043ddaf80d6180cf22bb8c8ac2 repository lib check ok

demo deployed

Get local repositories ok

Load cluster param plugin ok

Open ssh connection ok

[WARN] OBD-1007: (127.0.0.1) The recommended number of stack size is unlimited (Current value: 8192)

[WARN] OBD-2000: (127.0.0.1) not enough memory. (Free: 5G, Need: 6G)

[WARN] OBD-1012: (127.0.0.1) clog and data use the same disk (/)

Check before start obagent ok

Check before start prometheus ok

Check before start grafana ok

cluster scenario: None

Start observer ok

observer program health check ok

Connect to observer 127.0.0.1:2881 ok

oceanbase bootstrap ok

obshell start ok

obshell program health check ok

obshell bootstrap ok

Start obagent ok

obagent program health check ok

Start promethues ok

prometheus program health check ok

Start grafana ok

grafana program health check ok

Connect to grafana ok

Grafana modify password ok

Connect to observer 127.0.0.1:2881 ok

Wait for observer init ok

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

|             oceanbase-standalone            |

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

| ip        | version | port | zone  | status |

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

| 127.0.0.1 | 4.2.5.3 | 2881 | zone1 | ACTIVE |

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

obclient -h127.0.0.1 -P2881 -uroot@sys -p'rcqxqNMCBiTYO5WiHXyj' -Doceanbase -A

cluster unique id: 0778647d-dd56-58ed-94f1-eb55ad1a068e-1963db04c8c-03050204

Connect to Obagent ok

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

|                              obagent                               |

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

| ip              | mgragent_http_port | monagent_http_port | status |

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

| 192.168.200.108 | 8089               | 8088               | active |

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

Connect to Prometheus ok

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

|                       prometheus                       |

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

| url                         | user | password | status |

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

| http://192.168.200.108:9090 |      |          | active |

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

Connect to grafana ok

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

|                                grafana                                |

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

| url                                     | user  | password   | status |

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

| http://192.168.200.108:3000/d/oceanbase | admin | 7Hsgml9CMp | active |

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

demo running

Trace ID: e24510ee-1a9a-11f0-a0b0-000c29222a19

If you want to view detailed obd logs, please run: obd display-trace e24510ee-1a9a-11f0-a0b0-000c29222a19

[root@node02 bin]# obclinet

bash: obclinet: command not found...

Similar command is: 'obclient'

[root@node02 bin]# obclient

ERROR 1045 (42000): Access denied for user 'root'@'xxx.xxx.xxx.xxx' (using password: NO)

[root@node02 bin]# obclient -h127.0.0.1 -Pobclient -h127.0.0.1 -P2881 -uroot@sys -p'rcqxqNMCBiTYO5WiHXyj' -Doceanbase -A

Unknown suffix 'o' used for variable 'port' (value 'obclient')

obclient: Error while setting value 'obclient' to 'port'

使用安装过程中生成的用户名和密码进行登录

[root@node02 bin]# obclient -h127.0.0.1 -P2881 -uroot@sys -p'rcqxqNMCBiTYO5WiHXyj' -Doceanbase -A

obclient(root@sys)[oceanbase]> alter user root identified by 'root';(修改用户密码)

ERROR 1819 (HY000): Your password does not satisfy the current policy requirements

obclient(root@sys)[oceanbase]> alter user root identified by 'Good@2019';

Query OK, 0 rows affected (0.163 sec)

obclient(root@sys)[oceanbase]> exit

Bye

[root@node02 bin]# obclient -h127.0.0.1 -P2881 -uroot@sys -p'Good@2019' -Doceanbase -A    Welcome to the OceanBase.  Commands end with ; or \g.

Your OceanBase connection id is 3221509471

Server version: OceanBase 4.2.5.3 (r103000152025033110-f5b88cd987f23383677f2eb53cf76ed38a48979b) (Built Mar 31 2025 11:08:41)

Copyright (c) 2000, 2018, OceanBase and/or its affiliates. All rights reserved.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

声明一下,在进行自动化部署时,使用者可以自己的需要,录入-c 后安装参数,没必要全都录入安装。

在进行交互式安装时,数据库在安装过程中报了这个错。

上面的错误提示说我的磁盘大小不符合要求,小于12G。另外大家注意一下configurable range[12,11],注意这个区间,出现了数据倒挂。这种情况下,数据文件最大值,你无论录入12还是11,系统还是会报同样的错。就是这个错,困扰我好几天。

想到网友的力量是巨大的,我到OB社区发问。网友的回复如上所示,网友们说我的磁盘还是太小,还是要扩展磁盘大小。

我又翻看了官方社区的产品文档信息,有如下信息

从官方的安装文档看,给出测试开发最低配置和功能最低配置、性能最低配置三种。从左到右,CPU、内存配置在不断升高,但是没提及磁盘具体要多大。

要不我把CPU和内存的配置再升高看一下,回忆一下交互式安装过程,有这样一条提示。要求CPU数量要为8。如下所示

Enter the OB cpu count (Default: 8):,如果CPU核数低于8,系统会默认为8。我的CPU核数为2,系统会默认设置为8

无奈之下,我把虚拟机配置CPU核数升级为8,内存也咬牙升级为14G.。大家不要见笑,我那台宿主机是公司组装的ERP服务器,内存总共才64G,小微公司的服务器都是这样的。这次发现升级CPU核数为8后,安装一切顺利,一路直接回车,没有再报错了。

[root@localhost bin]# ./install_obd.sh

install obd as root

Found previous obd installed, try upgrade...

Disable remote ok

Trace ID: 71f65900-1c53-11f0-90d8-000c29b587e2

If you want to view detailed obd logs, please run: obd display-trace 71f65900-1c53-11f0-90d8-000c29b587e2

name: ob-deploy

version: 3.2.0

release:2.el8

arch: x86_64

md5: 529076c3e548f690ea6cb4e50cd77b2dfc4bfc6d

size: 178634999

add /root/oceanbase-standalone-all-in-one/rpms/ob-deploy-3.2.0-2.el8.x86_64.rpm to local mirror

Trace ID: 749aea54-1c53-11f0-a403-000c29b587e2

If you want to view detailed obd logs, please run: obd display-trace 749aea54-1c53-11f0-a403-000c29b587e2

No updates detected. OBD is already up to date.

See https://www.oceanbase.com/product/ob-deployer/error-codes .

Trace ID: 77addbf2-1c53-11f0-8723-000c29b587e2

If you want to view detailed obd logs, please run: obd display-trace 77addbf2-1c53-11f0-8723-000c29b587e2

upgrade finished

name: grafana

version: 7.5.17

release:1

arch: x86_64

md5: 1bf1f338d3a3445d8599dc6902e7aeed4de4e0d6

size: 177766248

add /root/oceanbase-standalone-all-in-one/rpms/grafana-7.5.17-1.el8.x86_64.rpm to local mirror

name: obagent

version: 4.2.2

release:100000042024011120.el8

arch: x86_64

md5: bf152b880953c2043ddaf80d6180cf22bb8c8ac2

size: 72919140

add /root/oceanbase-standalone-all-in-one/rpms/obagent-4.2.2-100000042024011120.el8.x86_64.rpm to local mirror

name: ob-deploy

version: 3.2.0

release:2.el8

arch: x86_64

md5: 529076c3e548f690ea6cb4e50cd77b2dfc4bfc6d

size: 178634999

add /root/oceanbase-standalone-all-in-one/rpms/ob-deploy-3.2.0-2.el8.x86_64.rpm to local mirror

name: oceanbase-diagnostic-tool

version: 3.2.0

release:52025031411.el8

arch: x86_64

md5: e7aeaa17222aa079c8d9e0c74a73e1d7f9c5501b

size: 71147006

add /root/oceanbase-standalone-all-in-one/rpms/oceanbase-diagnostic-tool-3.2.0-52025031411.el8.x86_64.rpm to local mirror

name: oceanbase-standalone

version: 4.2.5.3

release:103000152025033110.el8

arch: x86_64

md5: 305669b55281773f5c53ff4e44ff9f7bed9f7bc0

size: 1813828757

add /root/oceanbase-standalone-all-in-one/rpms/oceanbase-standalone-4.2.5.3-103000152025033110.el8.x86_64.rpm to local mirror

name: oceanbase-standalone-libs

version: 4.2.5.3

release:103000152025033110.el8

arch: x86_64

md5: 84315910ce45d91ed361867215964369044185c0

size: 7848

add /root/oceanbase-standalone-all-in-one/rpms/oceanbase-standalone-libs-4.2.5.3-103000152025033110.el8.x86_64.rpm to local mirror

name: prometheus

version: 2.37.1

release:10000102022110211.el8

arch: x86_64

md5: e4f8a3e784512fca75bf1b3464247d1f31542cb9

size: 211224073

add /root/oceanbase-standalone-all-in-one/rpms/prometheus-2.37.1-10000102022110211.el8.x86_64.rpm to local mirror

Trace ID: 8280c210-1c53-11f0-8b56-000c29b587e2

If you want to view detailed obd logs, please run: obd display-trace 8280c210-1c53-11f0-8b56-000c29b587e2

Disable remote ok

Trace ID: 8aa082dc-1c53-11f0-a513-000c29b587e2

If you want to view detailed obd logs, please run: obd display-trace 8aa082dc-1c53-11f0-a513-000c29b587e2

add auto set env logic to profile: /root/.bash_profile

Execute this command to apply the environment config`source ~/.oceanbase-all-in-one/bin/env.sh `

[root@localhost bin]# source ~/.oceanbase-all-in-one/bin/env.sh

[root@localhost bin]# ls

env.sh  install_obd.sh  install_ob.sh  uninstall_obd.sh

[root@localhost bin]# ./install_ob.sh

Enter the IP (Default: 192.168.200.109) (only support local IP):

Valid local IP: 192.168.200.109

Enter the current user password :

Trace ID: a519feae-1c53-11f0-a5f3-000c29b587e2

If you want to view detailed obd logs, please run: obd display-trace a519feae-1c53-11f0-a5f3-000c29b587e2

get system config ok

No need to change system parameters

Trace ID: a68c157e-1c53-11f0-a20a-000c29b587e2

If you want to view detailed obd logs, please run: obd display-trace a68c157e-1c53-11f0-a20a-000c29b587e2

Enter the cluster name (Default: standalone; allowed characters: letters, numbers, and underscores):

Enter the OB SQL port (Default: 2881):

Enter the OB RPC port (Default: 2882):

Enter the obshell port (Default: 2886):

Enter the OB root password (Default: zV76YeuMNlyHnLXhw74R):

Enter the OB cpu count (Default: 8):

Enter the OB memory limit (Configurable Range[6, 11] Default: 11, Unit: G): 6

Enter the OB installation directory (Default: /root/standalone):

Enter the OB data directory (Default: /data/1/standalone):

Enter the OB log directory (Default: /data/log1/standalone):

The data_dir and redo_dir are using the same disk.

Enter the OB datafile maxsize (Configurable Range[12, 19], Default: 19, Unit: G): 12

Enter the OB log disk size (Configurable Range[12, 23], Default: 16, Unit: G): 12

Do you want to create tenant for your business workload? (y/n)(Default: y):

Tenant: sys conifguration: 2C/1G/2G(CPU/Memory/Log disk)

system_memory configuration(Unit: G): 1

Enter the tenant name (Default: test; allowed characters: letters, numbers, and underscores):

   Please select the tenant mode (enter the corresponding number):

   1) MySQL

   2) Oracle

Please enter your choice [1/2] (default 1):2

Enter the tenant cpu (Configurable Range[1, 6], Default: 6): 1

Enter the tenant memory (Configurable Range[1, 4], Default: 4, Unit: G): 1

Enter the tenant log disk size(Configurable Range[3, 9], Default: 3, Unit: G): 3

Do you want to enable encryption for password security? (y/n) (Default: n):

Do you need to install the monitoring components (OBAgent, Prometheus, Grafana)? (y/n) (Default: y):

Enter the OBAgent monitoring service port (Default: 8088):

Enter the OBAgent management service port (Default: 8089):

Enter the Prometheus port (Default: 9090):

Enter the Grafana port (Default: 3000):

#Saved configurations:

cluster name: standalone

mysql port: 2881

rpc port: 2882

obshell port: 2886

cpu count: 8

memory limit: 6G

home path: /root/standalone

data dir: /data/1/standalone

log dir: /data/log1/standalone

datafile maxsize: 12G

log disk size: 12G

tenant name: test

tenant cpu: 1

tenant memory: 1G

tenant log disk size: 3G

OBAgent monitoring service port: 8088

OBAgent management service port: 8089

Prometheus port: 9090

Grafana port: 3000

Are you sure these configurations are correct? (y/n) (Default: y):

Configuration confirmed.

start cluster...

Package oceanbase-standalone-4.2.5.3-103000152025033110.el8 is available.

Package obagent-4.2.2-100000042024011120.el8 is available.

Package prometheus-2.37.1-10000102022110211.el8 is available.

Package grafana-7.5.17-1 is available.

install oceanbase-standalone-4.2.5.3 for local ok

install obagent-4.2.2 for local ok

install prometheus-2.37.1 for local ok

install grafana-7.5.17 for local ok

Cluster param config check ok

Open ssh connection ok

Generate obagent configuration ok

Generate prometheus configuration ok

Generate grafana configuration ok

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

|                                              Packages                                              |

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

| Repository           | Version | Release                | Md5                                      |

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

| oceanbase-standalone | 4.2.5.3 | 103000152025033110.el8 | 305669b55281773f5c53ff4e44ff9f7bed9f7bc0 |

| obagent              | 4.2.2   | 100000042024011120.el8 | bf152b880953c2043ddaf80d6180cf22bb8c8ac2 |

| prometheus           | 2.37.1  | 10000102022110211.el8  | e4f8a3e784512fca75bf1b3464247d1f31542cb9 |

| grafana              | 7.5.17  | 1                      | 1bf1f338d3a3445d8599dc6902e7aeed4de4e0d6 |

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

Repository integrity check ok

Load param plugin ok

Open ssh connection ok

Initializes obagent work home ok

Initializes observer work home ok

Initializes prometheus work home ok

Initializes grafana work home ok

Parameter check ok

Remote oceanbase-standalone-4.2.5.3-103000152025033110.el8-305669b55281773f5c53ff4e44ff9f7bed9f7bc0 repository install ok

Remote oceanbase-standalone-4.2.5.3-103000152025033110.el8-305669b55281773f5c53ff4e44ff9f7bed9f7bc0 repository lib check ok

Remote obagent-4.2.2-100000042024011120.el8-bf152b880953c2043ddaf80d6180cf22bb8c8ac2 repository install ok

Remote obagent-4.2.2-100000042024011120.el8-bf152b880953c2043ddaf80d6180cf22bb8c8ac2 repository lib check ok

Remote prometheus-2.37.1-10000102022110211.el8-e4f8a3e784512fca75bf1b3464247d1f31542cb9 repository install ok

Remote prometheus-2.37.1-10000102022110211.el8-e4f8a3e784512fca75bf1b3464247d1f31542cb9 repository lib check ok

Remote grafana-7.5.17-1-1bf1f338d3a3445d8599dc6902e7aeed4de4e0d6 repository install ok

Remote grafana-7.5.17-1-1bf1f338d3a3445d8599dc6902e7aeed4de4e0d6 repository lib check ok

standalone deployed

Get local repositories ok

Load cluster param plugin ok

Open ssh connection ok

[WARN] OBD-1012: (192.168.200.109) clog and data use the same disk (/)

Check before start obagent ok

Check before start prometheus ok

Check before start grafana ok

cluster scenario: None

Start observer ok

observer program health check ok

Connect to observer 192.168.200.109:2881 ok

oceanbase bootstrap ok

obshell start ok

obshell program health check ok

obshell bootstrap ok

Start obagent ok

obagent program health check ok

Start promethues ok

prometheus program health check ok

Start grafana ok

grafana program health check ok

Connect to grafana ok

Grafana modify password ok

Connect to observer 192.168.200.109:2881 ok

Wait for observer init ok

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

|                oceanbase-standalone               |

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

| ip              | version | port | zone  | status |

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

| 192.168.200.109 | 4.2.5.3 | 2881 | zone1 | ACTIVE |

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

obclient -h192.168.200.109 -P2881 -uroot@sys -p'zV76YeuMNlyHnLXhw74R' -Doceanbase -A

cluster unique id: 3ed9b4cb-b032-5fe9-9a5a-16226d8ee1b3-19648faa6e5-03050204

Connect to Obagent ok

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

|                              obagent                               |

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

| ip              | mgragent_http_port | monagent_http_port | status |

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

| 192.168.200.109 | 8089               | 8088               | active |

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

Connect to Prometheus ok

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

|                         prometheus                        |

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

| url                         | user  | password   | status |

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

| http://192.168.200.109:9090 | admin | bLzzcCxwUu | active |

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

Connect to grafana ok

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

|                               grafana                                |

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

| url                                     | user  | password  | status |

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

| http://192.168.200.109:3000/d/oceanbase | admin | oceanbase | active |

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

standalone running

Trace ID: 4363fa92-1c54-11f0-ae91-000c29b587e2

If you want to view detailed obd logs, please run: obd display-trace 4363fa92-1c54-11f0-ae91-000c29b587e2

create tenant...

Get local repositories ok

Open ssh connection ok

Connect to observer 192.168.200.109:2881 ok

Create tenant test ok

Create user in oracle tenant is not supported and --password is not supported

Trace ID: 0b7865ea-1c55-11f0-bdd3-000c29b587e2

If you want to view detailed obd logs, please run: obd display-trace 0b7865ea-1c55-11f0-bdd3-000c29b587e2

You can access the test tenant using the following command.

For security reasons, kindly reset the root password immeditely once the tenant has been successfully created.

obclient -h192.168.200.109 -P2881 -uSYS@test

If this cluster is for production use, please import a commercial license in time.

总结:回想OB单机版数据库整个交互式安装过程,在解决问题过程中,整个人非常无助。虽然踩了坑,但总归还是爬了上来。如果大家和我是一样,是测试者,最好按功能最低配置进行硬件规划。同时也提醒大家,表面的信息报错可能会掩盖真实的故障原因,有可能是其它原因导致报错,要理性地换条思路去思考。

评论 (0 个评论)

facelist

您需要登录后才可以评论 登录 | 立即注册

合作电话:010-64087828

社区邮箱:greatsql@greatdb.com

社区公众号
社区小助手
QQ群
GMT+8, 2025-4-22 04:33 , Processed in 0.016364 second(s), 9 queries , Redis On.
返回顶部