社区版OceanBase部署丨【绽放吧!数据库】

举报
snowofsummer 发表于 2021/08/10 12:15:28 2021/08/10
【摘要】 1,软件包下载https://mirrors.aliyun.com/oceanbase/community/stable/el/7/x86_64/2,部署工具安装yum install -y ob-deploy-1.0.0-1.el7.x86_64.rpmsource /etc/profile.d/obd.sh3,导入rpm文件obd mirror clone *.rpm#/root/.ob...

1,软件包下载

https://mirrors.aliyun.com/oceanbase/community/stable/el/7/x86_64/

2,部署工具安装

yum install -y ob-deploy-1.0.0-1.el7.x86_64.rpm
source /etc/profile.d/obd.sh

3,导入rpm文件

obd mirror clone *.rpm
#/root/.obd/mirror/local
obd mirror list local

[root@db02 rpm]# obd mirror list local
+-------------------------------------------------------------------------------------------+
|                                     local Package List                                    |
+-------------------+---------+---------+--------+------------------------------------------+
| name              | version | release | arch   | md5                                      |
+-------------------+---------+---------+--------+------------------------------------------+
| libobclient       | 2.0.0   | 2.el7   | x86_64 | f73cae67e2ff5be0682ac2803aba33a7ed26430e |
| obclient          | 2.0.0   | 1.el7   | x86_64 | ae76f4a2dfaa3d4fc5a0d3db532a07351a950c50 |
| ob-deploy         | 1.0.0   | 1.el7   | x86_64 | 3cf38c88852f09d81cb0a1e8add3feaac32edb0a |
| obproxy           | 3.1.0   | 1.el7   | x86_64 | 0b17cf0459a3b53c5a2febb6572894d183154c64 |
| oceanbase-ce      | 3.1.0   | 1.el7   | x86_64 | 56f57e9843e719d830ec03c206d914f4b3adc82b |
| oceanbase-ce-libs | 3.1.0   | 1.el7   | x86_64 | b70d3839280f145a86af26811bbfcdfaeb645509 |
+-------------------+---------+---------+--------+------------------------------------------+

4,编写配置文件

mini.yaml

oceanbase-ce:
  servers:
    # Please don't use hostname, only IP can be supported
    - 127.0.0.1
  global:
    home_path: /root/observer
    # Please set devname as the network adaptor's name whose ip is  in the setting of severs.
    # if set severs as "127.0.0.1", please set devname as "lo"
    # if current ip is 192.168.1.10, and the ip's network adaptor's name is "eth0", please use "eth0"
    devname: lo
    mysql_port: 2881
    rpc_port: 2882
    zone: zone1
    cluster_id: 1
    # please set memory limit to a suitable value which is matching resource. 
    memory_limit: 8G
    system_memory: 4G
    stack_size: 512K
    cpu_count: 16
    cache_wash_threshold: 1G
    __min_full_resource_pool_memory: 268435456
    workers_per_cpu_quota: 10
    schema_history_expire_time: 1d
    # The value of net_thread_count had better be same as cpu's core number. 
    net_thread_count: 4
    sys_bkgd_migration_retry_num: 3
    minor_freeze_times: 10
    enable_separate_sys_clog: 0
    enable_merge_by_turn: FALSE
    datafile_disk_percentage: 20
    syslog_level: INFO
    enable_syslog_recycle: true
    max_syslog_file_count: 4
    # root_password: # root user password, can be empty

5,安装

[root@db02 rpm]# obd cluster deploy test -c /root/mini.yaml
oceanbase-ce-3.1.0 already installed
+-------------------------------------------------------------------+
|                              Packages                             |
+--------------+---------+------------------------------------------+
| Repository   | Version | Md5                                      |
+--------------+---------+------------------------------------------+
| oceanbase-ce | 3.1.0   | 56f57e9843e719d830ec03c206d914f4b3adc82b |
+--------------+---------+------------------------------------------+
Open ssh connection ok
Remote oceanbase-ce-3.1.0-56f57e9843e719d830ec03c206d914f4b3adc82b repository install ok
Remote oceanbase-ce-3.1.0-56f57e9843e719d830ec03c206d914f4b3adc82b repository lib check ok
127.0.0.1 initiali

6,启动并查看状态

[root@db02 rpm]# obd cluster start test

Get local repositories and plugins ok
[WARN] (127.0.0.1) open files number must not be less than 655350 (Current value: 600000)
Start observer ok
observer program health check ok
Connect to observer ok
Initialize cluster
Cluster bootstrap ok
Wait for observer init ok
+---------------------------------------------+
|                   observer                  |
+-----------+---------+------+-------+--------+
| ip        | version | port | zone  | status |
+-----------+---------+------+-------+--------+
| 127.0.0.1 | 3.1.0   | 2881 | zone1 | active |
+-----------+---------+------+-------+--------+

test running
[root@db02 rpm]# obd cluster display test
Get local repositories and plugins ok
Connect to observer ok
Wait for observer init ok
+---------------------------------------------+
|                   observer                  |
+-----------+---------+------+-------+--------+
| ip        | version | port | zone  | status |
+-----------+---------+------+-------+--------+
| 127.0.0.1 | 3.1.0   | 2881 | zone1 | active |
+-----------+---------+------+-------+--------+

7,客户端安装并连接数据库

[root@db02 rpm]# rpm -ivh libobclient-2.0.0-2.el7.x86_64.rpm 
[root@db02 rpm]# rpm -ivh obclient-2.0.0-1.el7.x86_64.rpm 


[root@db02 rpm]# obclient -h 127.0.0.1 -P 2881 -uroot
Welcome to the OceanBase.  Commands end with ; or \g.
Your MySQL connection id is 3221487637
Server version: 5.7.25 OceanBase 3.1.0 (r-) (Built May 30 2021 11:21:29)

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

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

MySQL [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| oceanbase          |
| information_schema |
| mysql              |
| SYS                |
| LBACSYS            |
| ORAAUDITOR         |
| test               |
+--------------------+
7 rows in set (0.003 sec)

MySQL [(none)]> use oceanbase;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
MySQL [oceanbase]>  SELECT svr_ip,svr_port, cpu_total, mem_total, disk_total, zone FROM __all_virtual_server_stat ;
+-----------+----------+-----------+------------+-------------+-------+
| svr_ip    | svr_port | cpu_total | mem_total  | disk_total  | zone  |
+-----------+----------+-----------+------------+-------------+-------+
| 127.0.0.1 |     2882 |        14 | 4294967296 | 85893054464 | zone1 |
+-----------+----------+-----------+------------+-------------+-------+
1 row in set (0.002 sec)

MySQL [oceanbase]>



【绽放吧!数据库】有奖征文火热进行中:https://bbs.huaweicloud.com/blogs/285617

【版权声明】本文为华为云社区用户原创内容,转载时必须标注文章的来源(华为云社区)、文章链接、文章作者等基本信息, 否则作者和本社区有权追究责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@huaweicloud.com
  • 点赞
  • 收藏
  • 关注作者

评论(0

0/1000
抱歉,系统识别当前为高风险访问,暂不支持该操作

全部回复

上滑加载中

设置昵称

在此一键设置昵称,即可参与社区互动!

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。