使用obd离线安装oceanbase

 

1、在可以联网的机器上下载需要的安装包

https://open.oceanbase.com/softwareCenter/community
ob-deploy-*.x86_64.rpm
oceanbase-ce-*.x86_64.rpm
oceanbase-ce-libs-*.x86_64.rpm

 

2、将离线包上传到中控机

[root@test rpm]# pwd
/home/rpm
[root@test rpm]# ll
总用量 66140
-rw-r--r--. 1 root root     1399 7月  27 14:20 mini_local.yaml
-rw-r--r--. 1 root root 12894260 6月  28 19:49 ob-deploy-1.0.2-2.el7.x86_64.rpm
-rw-r--r--. 1 root root 46315968 5月  30 19:53 oceanbase-ce-3.1.0-1.el7.x86_64.rpm
-rw-r--r--. 1 root root   422984 5月  30 19:53 oceanbase-ce-libs-3.1.0-1.el7.x86_64.rpm

 

3、安装ob-deploy软件

[root@test rpm]# rpm -ivh ob-deploy-1.0.2-2.el7.x86_64.rpm 
警告:ob-deploy-1.0.2-2.el7.x86_64.rpm: 头V4 RSA/SHA1 Signature, 密钥 ID e9b4a7aa: NOKEY
准备中...                          ################################# [100%]
正在升级/安装...
   1:ob-deploy-1.0.2-2.el7            ################################# [100%]
Installation of obd finished successfully
Please source /etc/profile.d/obd.sh to enable it
[root@test rpm]# source /etc/profile.d/obd.sh 
[root@test rpm]# 

 

4、将离线rpm包加入到本地镜像

[root@test rpm]# obd mirror clone /home/rpm/*.rpm
name: ob-deploy
version: 1.0.2
release:2.el7
arch: x86_64
md5: 64615337b41fb1261a7ed271944f61b09f9669c7
add /home/rpm/ob-deploy-1.0.2-2.el7.x86_64.rpm to local mirror
name: obproxy
version: 3.1.0
release:1.el7
arch: x86_64
md5: 0b17cf0459a3b53c5a2febb6572894d183154c64
add /home/rpm/obproxy-3.1.0-1.el7.x86_64.rpm to local mirror
name: oceanbase-ce
version: 3.1.0
release:1.el7
arch: x86_64
md5: 56f57e9843e719d830ec03c206d914f4b3adc82b
add /home/rpm/oceanbase-ce-3.1.0-1.el7.x86_64.rpm to local mirror
name: oceanbase-ce-libs
version: 3.1.0
release:1.el7
arch: x86_64
md5: b70d3839280f145a86af26811bbfcdfaeb645509
add /home/rpm/oceanbase-ce-libs-3.1.0-1.el7.x86_64.rpm to local mirror
[root@test rpm]# 

  

5、clone后验证

clone成功后在对应的local目录确认,已将安装包从最初的/home/rpm拷贝到/root/.obd/mirror/local
[root@test local]# pwd
/root/.obd/mirror/local
[root@test local]# ll
总用量 66132
-rw-r--r--. 1 root root 12894260 7月  27 14:17 ob-deploy-1.0.2-2.el7.x86_64.rpm
-rw-r--r--. 1 root root 46315968 7月  27 14:17 oceanbase-ce-3.1.0-1.el7.x86_64.rpm
-rw-r--r--. 1 root root   422984 7月  27 14:17 oceanbase-ce-libs-3.1.0-1.el7.x86_64.rpm

#查看local仓库镜像的包情况
[root@test local]# obd mirror list local
+-------------------------------------------------------------------------------------------+
|                                     local Package List                                    |
+-------------------+---------+---------+--------+------------------------------------------+
| name              | version | release | arch   | md5                                      |
+-------------------+---------+---------+--------+------------------------------------------+
| ob-deploy         | 1.0.2   | 2.el7   | x86_64 | 64615337b41fb1261a7ed271944f61b09f9669c7 |
| oceanbase-ce      | 3.1.0   | 1.el7   | x86_64 | 56f57e9843e719d830ec03c206d914f4b3adc82b |
| oceanbase-ce-libs | 3.1.0   | 1.el7   | x86_64 | b70d3839280f145a86af26811bbfcdfaeb645509 |
+-------------------+---------+---------+--------+------------------------------------------+
[root@test local]# 

 

6、重点(默认obd部署的时候使用在线远程安装,如果要本地安装需删除或者重命名remote目录)

[root@test mirror]# pwd
/root/.obd/mirror
[root@test mirror]# mv remote/ remote_bak

 

  

7、部署ob集群(for local ok再次说明是使用的本地仓库的离线安装包)

[root@test ~]# obd cluster deploy myob_test8 -c /home/rpm/mini_local.yaml
Package oceanbase-ce-3.1.0 is available.
install oceanbase-ce-3.1.0 for local ok
+-----------------------------------------------------------------------------+
|                                   Packages                                  |
+--------------+---------+---------+------------------------------------------+
| Repository   | Version | Release | Md5                                      |
+--------------+---------+---------+------------------------------------------+
| oceanbase-ce | 3.1.0   | 1.el7   | 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 !!
[WARN] z1(192.168.68.63) oceanbase-ce-3.1.0-56f57e9843e719d830ec03c206d914f4b3adc82b require: libmariadb.so.3

Try to get lib-repository
Package oceanbase-ce-libs-3.1.0 is available.
install oceanbase-ce-libs-3.1.0 for local ok
Use oceanbase-ce-libs-3.1.0-b70d3839280f145a86af26811bbfcdfaeb645509 for oceanbase-ce-3.1.0-56f57e9843e719d830ec03c206d914f4b3adc82b
Remote oceanbase-ce-libs-3.1.0-b70d3839280f145a86af26811bbfcdfaeb645509 repository install ok
Remote oceanbase-ce-3.1.0-56f57e9843e719d830ec03c206d914f4b3adc82b repository lib check ok
Cluster status check ok
z1(192.168.68.63) initializes cluster work home
myob_test8 deployed

 

8、启动ob集群

[root@test ~]# obd cluster start myob_test8
Get local repositories and plugins ok
Open ssh connection ok
Cluster param config check ok
Check before start observer ok
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 |
+---------------+---------+-------+-------+--------+
| 192.168.68.63 | 3.1.0   | 13881 | zone1 | active |
+---------------+---------+-------+-------+--------+

myob_test8 running
[root@test ~]# 

 

9、mini_local.yaml示例

## Only need to configure when remote login is required
#https://gitee.com/oceanbase/obdeploy/blob/master/example/mini-distributed-example.yaml
user:
  username: root
  password: root
#  key_file: your ssh-key file path if need
oceanbase-ce:
  servers:
    - name: z1
      # Please don't use hostname, only IP can be supported
      ip: 192.168.68.63
  global:
    # 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"
    syslog_level: ERROR
    devname: em1
    cluster_id: 1
    datafile_size: 8G
    # 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
    major_freeze_duty_time: Disable
    minor_freeze_times: 10
    enable_separate_sys_clog: 0
    enable_merge_by_turn: FALSE
    datafile_disk_percentage: 20
    appname: myob_test8
  z1:
    mysql_port: 13881
    rpc_port: 13882
    home_path: /home/test/observer_13881
    zone: zone1
上一篇:2022年1月国产数据库排行榜:TiDB霸榜两年势头不减,openGauss与OceanBase分数大涨


下一篇:oceanbase