首页 > 其他分享 >obd自动化部署单副本集群

obd自动化部署单副本集群

时间:2023-04-20 11:36:48浏览次数:43  
标签:副本 ok observer oceanbase obd single 集群 root

1. 环境介绍

centos 7.6

可用内存不少于8G

根目录可用空间不少于30G

 

2. 介绍

obd针对不同部署场景提供不同配置文件

谷歌浏览器:https://github.com/oceanbase/obdeploy/tree/master/example

  • mini-single-example.yaml:observer单节点配置文件(最小资源配置)
  • mini-single-with-obproxy-example.yaml:observer和obproxy单节点配置文件(最小资源配置)

 

3. 下载observer单节点配置文件:mini-single-example.yaml

[root]# cat mini-single-example.yaml
## Only need to configure when remote login is required
# user:
#   username: your username
#   password: your password if need
#   key_file: your ssh-key file path if need
#   port: your ssh port, default 22
#   timeout: ssh connection timeout (second), default 30
oceanbase-ce:
  servers:
    # Please don't use hostname, only IP can be supported
    - 192.168.1.71    # 修改为本机IP
  global:
    #  The working directory for OceanBase Database. OceanBase Database is started under this directory. This is a required field.
    home_path: /data/observer # 修改安装目录
    # The directory for data storage. The default value is $home_path/store.
    # data_dir: /data/observer/store
    # The directory for clog, ilog, and slog. The default value is the same as the data_dir value.
    # redo_dir: /data/observer/redo
    # 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: ens33    # 修改网卡
    mysql_port: 2881 # External port for OceanBase Database. The default value is 2881. DO NOT change this value after the cluster is started.
    rpc_port: 2882 # Internal port for OceanBase Database. The default value is 2882. DO NOT change this value after the cluster is started.
    zone: zone1
    cluster_id: 1
    # please set memory limit to a suitable value which is matching resource. 
    memory_limit: 6G # The maximum running memory for an observer
    system_memory: 1G # The reserved system memory. system_memory is reserved for general tenants. The default value is 30G.
    datafile_size: 20G # Size of the data file. 
    log_disk_size: 15G # The size of disk space used by the clog files.
    cpu_count: 4
    production_mode: false
    enable_syslog_wf: false # Print system logs whose levels are higher than WARNING to a separate log file. The default value is true.
    enable_syslog_recycle: true # Enable auto system log recycling or not. The default value is false.
    max_syslog_file_count: 4 # The maximum number of reserved log files before enabling auto recycling. The default value is 0.
    # root_password: # root user password, can be empty

提示: 根据自己的环境修改:IP、网卡、端口、zone名称、cluster_id、安装目录、data路径、redo路径、资源等。

 

4. 安装ob-deploy、observer、obclient

[root]# rpm -ivh obclient-2.2.2-1.el7.x86_64.rpm 
Preparing...                          ################################# [100%]
Updating / installing...
   1:obclient-2.2.2-1.el7             ################################# [100%]
[root]# rpm -ivh oceanbase-ce-*
Preparing...                          ################################# [100%]
Updating / installing...
   1:oceanbase-ce-libs-4.0.0.0-1000002################################# [ 50%]
   2:oceanbase-ce-4.0.0.0-100000272022################################# [100%]
[root]# rpm -ivh ob-deploy-2.0.0-10.el7.x86_64.rpm 
Preparing...                          ################################# [100%]
Updating / installing...
   1:ob-deploy-2.0.0-10.el7           ################################# [100%]
Installation of obd finished successfully
Please source /etc/profile.d/obd.sh to enable it
[root]# source /etc/profile.d/obd.sh

 

6. 部署集群

obd cluster deploy [集群名称] -c [配置文件]

[root]# obd cluster deploy obce-single -c single-observer.yaml
+--------------------------------------------------------------------------------------------+
|                                          Packages                                          |
+--------------+---------+------------------------+------------------------------------------+
| Repository   | Version | Release                | Md5                                      |
+--------------+---------+------------------------+------------------------------------------+
| oceanbase-ce | 4.1.0.0 | 100000192023032010.el7 | 8439ecf8db5e0649bd49671b41ea9e8c85756b63 |
+--------------+---------+------------------------+------------------------------------------+
Repository integrity check ok
Parameter check ok
Open ssh connection ok
Cluster status check ok
Initializes observer work home ok
Remote oceanbase-ce-4.1.0.0-100000192023032010.el7-8439ecf8db5e0649bd49671b41ea9e8c85756b63 repository install ok
Remote oceanbase-ce-4.1.0.0-100000192023032010.el7-8439ecf8db5e0649bd49671b41ea9e8c85756b63 repository lib check !!
Try to get lib-repository
Download oceanbase-ce-libs-4.1.0.0-100000192023032010.el7.x86_64.rpm (155.18 K):  99% [######################################################################################################################################### ] ETA:  0:00:00 744.80 kB/s
Package oceanbase-ce-libs-4.1.0.0-100000192023032010.el7 is available.
install oceanbase-ce-libs-4.1.0.0 for local ok
Remote oceanbase-ce-libs-4.1.0.0-100000192023032010.el7-a83b1dd1cab44d3f610d439931322be7a08555f2 repository install ok
Remote oceanbase-ce-4.1.0.0-100000192023032010.el7-8439ecf8db5e0649bd49671b41ea9e8c85756b63 repository lib check ok
obce-single deployed
Trace ID: da1b83e6-df26-11ed-808f-000c29501e19
If you want to view detailed obd logs, please run: obd display-trace da1b83e6-df26-11ed-808f-000c29501e19

 

7. 检查集群状态,status当前为“deployed”,obd cluster deploy...操作只是安装了软件和准备初始化目录

[root]# obd cluster list
+----------------------------------------------------------------+
|                          Cluster List                          |
+-------------+--------------------------------+-----------------+
| Name        | Configuration Path             | Status (Cached) |
+-------------+--------------------------------+-----------------+
| obce-single | /root/.obd/cluster/obce-single | deployed        |
+-------------+--------------------------------+-----------------+
Trace ID: 8bf84a36-df27-11ed-be0f-000c29501e19
If you want to view detailed obd logs, please run: obd display-trace 8bf84a36-df27-11ed-be0f-000c29501e19

 

8. 查看obce-single集群组件信息,此时还看不到相关组件信息 

 

[root]# obd cluster display obce-single
Deploy "obce-single" is deployed
See https://www.oceanbase.com/product/ob-deployer/error-codes .
Trace ID: 30ae90ae-df27-11ed-acbd-000c29501e19
If you want to view detailed obd logs, please run: obd display-trace 30ae90ae-df27-11ed-acbd-000c29501e19

 

9. 检查observer进程,observer进程还未运行

[root]# ps -ef | grep observer

 

10. 启动并初始化集群

[root]# obd cluster start obce-single
Get local repositories ok
Search plugins ok
Open ssh connection ok
Load cluster param plugin ok
Check before start observer ok
[WARN] OBD-1012: (192.168.1.71) clog and data use the same disk (/data)

Start observer ok
observer program health check ok
Connect to observer ok
Initialize oceanbase-ce ok
Wait for observer init ok
+------------------------------------------------+
|                    observer                    |
+--------------+---------+------+-------+--------+
| ip           | version | port | zone  | status |
+--------------+---------+------+-------+--------+
| 192.168.1.71 | 4.1.0.0 | 2881 | zone1 | ACTIVE |
+--------------+---------+------+-------+--------+
obclient -h192.168.1.71 -P2881 -uroot -Doceanbase -A

obce-single running
Trace ID: cf7afe48-df27-11ed-9473-000c29501e19
If you want to view detailed obd logs, please run: obd display-trace cf7afe48-df27-11ed-9473-000c29501e19

 

11. 再次检查observer进程,此时可以看到observer进程已经启动

[root]# ps -ef | grep observer
root     10539     1 99 11:02 ?        00:12:42 /data/observer/bin/observer -r 192.168.1.71:2882:2881 -p 2881 -P 2882 -z zone1 -c 1 -d /data/observer/store -i ens33 -o __min_full_resource_pool_memory=2147483648,memory_limit=6G,system_memory=1G,datafile_size=20G,log_disk_size=15G,cpu_count=4,enable_syslog_wf=False,enable_syslog_recycle=True,max_syslog_file_count=4

 

 12. 再次检查集群状态,status当前为“running”

[root]# obd cluster list
+----------------------------------------------------------------+
|                          Cluster List                          |
+-------------+--------------------------------+-----------------+
| Name        | Configuration Path             | Status (Cached) |
+-------------+--------------------------------+-----------------+
| obce-single | /root/.obd/cluster/obce-single | running         |
+-------------+--------------------------------+-----------------+
Trace ID: 39e7f20e-df28-11ed-b8b2-000c29501e19
If you want to view detailed obd logs, please run: obd display-trace 39e7f20e-df28-11ed-b8b2-000c29501e19

 

13. 再次查看obce-single集群组件信息 ,此时可以看到相关组件信息

[root]# obd cluster display obce-single
Get local repositories and plugins ok
Open ssh connection ok
Cluster status check ok
Connect to observer ok
Wait for observer init ok
+------------------------------------------------+
|                    observer                    |
+--------------+---------+------+-------+--------+
| ip           | version | port | zone  | status |
+--------------+---------+------+-------+--------+
| 192.168.1.71 | 4.1.0.0 | 2881 | zone1 | ACTIVE |
+--------------+---------+------+-------+--------+
obclient -h192.168.1.71 -P2881 -uroot -Doceanbase -A

Trace ID: a1a0c880-df28-11ed-be22-000c29501e19
If you want to view detailed obd logs, please run: obd display-trace a1a0c880-df28-11ed-be22-000c29501e19

 

14. 连接oceanbase

obclient方式:

[root]# obclient -h192.168.1.71 -P2881 -uroot -Doceanbase -A -p

mysqlclient方式:

[root]# mysql -h192.168.1.71 -P2881 -uroot -Doceanbase -A -p

 

参考:《oceanbase社区版入门与实战.pdf》

标签:副本,ok,observer,oceanbase,obd,single,集群,root
From: https://www.cnblogs.com/haha029/p/17335840.html

相关文章

  • Nacos笔记(五):Nacos集群整合Nginx
    前言Nginx搭建,参考:Linux安装Nginx。1、Nginx配置添加nacos集群,调整端口与服务名,并设置代理,详情如下:   配置详情如下http{includemime.types;default_typeapplication/octet-stream;sendfileon;keepalive_timeout......
  • elasticsearch 8集群搭建并完成CDN日志收集和解析
     谷歌一下,搜索结果有各种样的博客文章,看了很多篇,反而被绕晕,经过自己的实践搭建完成获取到的经验最适合自己,在这里把整个过程记录下来,也希望可以帮助到一些需要的人。搭建前,请阅读官方文档,虽然是英文,如果能看懂你能学到更精髓的部分。英文好坏也是技术和技术之间的分水岭。好的技......
  • Kubernetes集群调度增强之超容量扩容
    作者:京东科技 徐宪章1什么是超容量扩容超容量扩容功能,是指预先调度一定数量的工作节点,当业务高峰期或者集群整体负载较高时,可以使应用不必等待集群工作节点扩容,从而迅速完成应用横向扩容。通常情况下HPA、ClusterAutosacler和超容量扩容同时使用以满足负载敏感度高的业务场景。超......
  • Hadoop集群手动主备切换
     查看节点状态#查看节点状态[root@hadoop1bin]#hdfshaadmin-getServiceStatenn1standby[root@hadoop1bin]#hdfshaadmin-getServiceStatenn2active[root@hadoop1bin]#pwd/root/tools/hadoop/tools/hadoop/bin将NN2切换为Standby备用节点hdfshaadmin......
  • 并行计算、分布式计算、集群计算和网格计算的介绍,以及主要有哪些区别?
    并行计算(ParallelComputing)并行计算或称平行计算是相对于串行计算来说的。并行计算(ParallelComputing)是指同时使用多种计算资源解决计算问题的过程。为执行并行计算,计算资源应包括一台配有多处理机(并行处理)的计算机、一个与网络相连的计算机专有编号,或者两者结合使用。......
  • 63、Prometheus-独立部署的Prometheus监控K8S集群
    Kubernetes学习目录1、简介1.1、原因这里我们以prometheus的配置解析如获取各各所需的文件和相关的原理问题,不会细写通过标签如果去获取数据的规则,先把获取K8S的数据链路打通,有助于后面的深入。研究四五天,网上搜了,获取相关token和ca.crt文件这块都是忽略了事,踏了不少坑。1.2......
  • obd demo快速部署单副本oceanbase(在线)
    资源要求:可用内存不少于8G安装目录空间不少于50G(默认安装在当前安装用户的家目录下) 1.什么是obd?odb是oceanbase社区版部署工具oceanbasedeployer的简称,通过obd可以快速完成oceanbaseclusterr的部署。不传入配置文件的情况下,在单机通过执行obddemo可以快速部署oceanba......
  • 云原生之在kubernetes集群下部署Mysql应用
    (云原生之在kubernetes集群下部署mysql应用)一、Mysql介绍数据库(Database)是按照数据结构来组织、存储和管理数据的仓库。MySQL是一种开源的关系型数据库管理系统,可将数据保存在不同的表中,而不是将所有数据放在一个大的仓库内,从而加快了访问速度并提高了灵活性。MySQL使用了标准......
  • 搭建高可用的rabbitmq集群 + Mirror Queue + 使用C#驱动连接
    我们知道rabbitmq是一个专业的MQ产品,而且它也是一个严格遵守AMQP协议的玩意,但是要想骚,一定需要拿出高可用的东西出来,这不本篇就跟大家说一下cluster的概念,rabbitmq是erlang写的一个成品,所以知道如何构建erlang的node集群就ok了,他需要一个统一的cookie机制......
  • 部署多节点elasticsearch集群的shell脚本
    以下是一个部署多个节点的elasticsearch集群的shell脚本示例:#!/bin/bash#设置集群名称CLUSTER_NAME="my_cluster"#设置elasticsearch版本号ES_VERSION="7.10.2"#设置elasticsearch安装目录ES_HOME="/usr/local/elasticsearch"#设置elasticsearch数据目录DATA_DI......