当前位置: 首页 > article >正文

黑屏环境下,如何利用OBD部署OceanBase企业版集群

一、前言

OBD,作为OceanBase官方推出的部署工具,显著简化了OB单机及集群的部署流程。此前,OBD能够支持对社区版OB进行一键部署,那OBD是否同样支持OB企业版的部署呢?

本文为大家介绍通过OBD,在OB企业版集群部署过程中遇到的一些问题和解决方案,希望能为大家提供一些参考。

二、部署准备

开发机资源cpu与内存存储大小
阿里云AY12C8G40G
阿里云AY22C8G40G
阿里云AY32C8G40G
资源包版本
OceanBase企业版4.2.2.0
OB-Deploy2.4.1(2.5以上不支持商业版,2.4.1可兼容431版本的OB,预计3.0开始支持商业版)
OBProxy4.2.3.0
OBClient2.2.6

注意⚠️:本篇文档部署的是企业版OceanBase,并非社区版

前置条件:为了方便OBD远程部署,需要将集群内开发机的SSH登录用户名和密码改为一样的,如:

username:root
password:xxxxx

一台机器上先准备如下四个文件(如下载到AY1上),点击前往 mirror 网站搜索下载

三、部署流程

📖 以下部署流程只需要在一台机器上完成即可,如我所用的机器是 AY1,其 IP 为 192.168.0.167

解压 ob-deploy 文件

rpm -ivh ob-depoly.xxxxxx.rpm

然后将所有的 rpm 加入 OBD 的镜像当中

rpm mirror remote disable
rpm mirror clone *.rpm
rpm mirror list local

查看是否添加成功

1718846954

进入 /usr/obd/example 目录下,编辑 mini-distribute-withe-obproxy-example.yaml 文件

## Only need to configure when remote login is required
user:
   username: 你设置的用户名,一般是root
   password: 你设置的密码
#   key_file: your ssh-key file path if need
   port: 22
   timeout: 30
oceanbase:
  servers:
    - name: server1
      # Please don't use hostname, only IP can be supported
      ip: 192.168.18.207
    - name: server2
      ip: 192.168.18.205
    - name: server3
      ip: 192.168.18.206
  global:
    # Starting from observer version 4.2, the network selection for the observer is based on the 'local_ip' parameter, and the 'devname' parameter is no longer mandatory.
    # If the 'local_ip' parameter is set, the observer will first use this parameter for the configuration, regardless of the 'devname' parameter.
    # If only the 'devname' parameter is set, the observer will use the 'devname' parameter for the configuration.
    # If neither the 'devname' nor the 'local_ip' parameters are set, the 'local_ip' parameter will be automatically assigned the IP address configured above.
    # devname: eth0
    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: 2G # Size of the data file.
    datafile_next: 2G # the auto extend step. Please enter an capacity, such as 2G
    datafile_maxsize: 20G # the auto extend max size. Please enter an capacity, such as 20G
    log_disk_size: 13G # The size of disk space used by the clog files.
    cpu_count: 16
    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.
    # observer cluster name, consistent with obproxy's cluster_name
    appname: obcluster
    # root_password: # root user password, can be empty
    # proxyro_password: # proxyro user pasword, consistent with obproxy's observer_sys_password, can be empty
  server1:
    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.
    #  The working directory for OceanBase Database. OceanBase Database is started under this directory. This is a required field.
    home_path: /root/observer
    # The directory for data storage. The default value is $home_path/store.
    # data_dir: /data
    # The directory for clog, ilog, and slog. The default value is the same as the data_dir value.
    # redo_dir: /redo
    zone: zone1
  server2:
    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.
    #  The working directory for OceanBase Database. OceanBase Database is started under this directory. This is a required field.
    home_path: /root/observer
    # The directory for data storage. The default value is $home_path/store.
    # data_dir: /data
    # The directory for clog, ilog, and slog. The default value is the same as the data_dir value.
    # redo_dir: /redo
    zone: zone2
  server3:
    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.
    #  The working directory for OceanBase Database. OceanBase Database is started under this directory. This is a required field.
    home_path: /root/observer
    # The directory for data storage. The default value is $home_path/store.
    # data_dir: /data
    # The directory for clog, ilog, and slog. The default value is the same as the data_dir value.
    # redo_dir: /redo
    zone: zone3
obproxy:
  # Set dependent components for the component.
  # When the associated configurations are not done, OBD will automatically get the these configurations from the dependent components.
  depends:
    - oceanbase
  servers:
    - 192.168.18.207
  global:
    listen_port: 2883 # External port. The default value is 2883.
    prometheus_listen_port: 2884 # The Prometheus port. The default value is 2884.
    home_path: /root/obproxy
    # oceanbase root server list
    # format: ip:mysql_port;ip:mysql_port. When a depends exists, OBD gets this value from the oceanbase-ce of the depends.
    # rs_list: 192.168.1.2:2881;192.168.1.3:2881;192.168.1.4:2881
    enable_cluster_checkout: false
    # observer cluster name, consistent with oceanbase-ce's appname. When a depends exists, OBD gets this value from the oceanbase-ce of the depends.
    # cluster_name: obcluster
    skip_proxy_sys_private_check: true
    enable_strict_kernel_release: false
    proxy_id: 100
    client_session_id_version: 2
    # obproxy_sys_password: # obproxy sys user password, can be empty. When a depends exists, OBD gets this value from the oceanbase-ce of the depends.
    # observer_sys_password: # proxyro user pasword, consistent with oceanbase-ce's proxyro_password, can be empty. When a depends exists, OBD gets this value from the oceanbase-ce of the depends.

编辑好文件后我们就可以部署 obcluster 这个集群了

obd cluster deploy obcluster -c mini-distributed-with-obproxy-example.yaml

部署成功截图

1718846933

此时启动 obcluster 可能会报错

1718846983

what❓

针对此问题有两种解决方法

方法一

  • 如果对安全检查不是很在意,且仅仅是简单测试的话可以试试该方法,如下直接删除安全检查脚本即可(结果可能不稳定,且也需要每台机器运行一遍,故不推荐该方法)
rm -rf ~/.obd/plugins/oceanbase/*/start_check.py

方法二

  • 比较推荐的方法,只需要每台机器执行一遍如下命令
echo -e "* soft nproc 120000\n* hard nproc 120000" >> /etc/security/limits.d/20-nproc.conf
source /etc/profile

本篇文档使用方法二进行部署,随后重新执行启动集群命令

obd cluster start obcluster

1718847005

按照提示登录 OB 即可检验是否拉起分布式环境

1718847025

最终集群结果分析:

开发机内网IP节点角色
AY1192.168.0.167Observer + OBproxy
AY2192.168.0.168Observer
AY3192.168.0.169Observer


💡OBD 全程部署需要等待的时间大约为3分钟。若您想获取源码及更多详情,请访问我们的 GitHub 仓库:GitHub - oceanbase/obdeploy: A deployer and package manager for OceanBase open-source software.。


http://www.kler.cn/news/283882.html

相关文章:

  • Web3开发与安全:6个月高效学习路径
  • Python从入门到进阶教程文章分享汇总~持续更新
  • 缓存:浅谈双写导致的数据一致性问题
  • 【2024 CCF编程能力等级认证(GESP)Python 】一级大纲
  • 桥接与NET
  • AI-Talk开发板硬件适配
  • 改造小蚁摄像头支持免费无限容量云储存(Samba挂载篇)
  • 零基础入门转录组数据分析——基因Wilcoxon秩和检验
  • python进阶篇-day02-面向对象高级
  • DIFFUSION 系列笔记| Latent Diffusion Model、Stable Diffusion基础概念、数学原理、代码分析、案例展示
  • 【node.js】基础之修改文件
  • APP渠道来源方案探索
  • 第22周:调用Gensim库训练Word2Vec模型
  • 使用对象池优化 C++ 程序性能的实用指南
  • 传输层协议-UDP数据报
  • 6 自研rgbd相机基于rk3566之深度计算库程序详解
  • 第一次用macos快速上手教程
  • 算法进阶篇 之 实用数据结构
  • 【图论简介】
  • 深入理解Python中的`super()`函数:如何调用父类的方法
  • 【数字IC】——逻辑综合,物理数据的读入
  • Vxe UI vue vxe-table 如何在表格中使用上传附件、上传图片
  • Linux下编译安装SuperLU
  • 应对Java虚拟机(JVM)负载突然增大的全面指南
  • Sentinel-1 Level 1数据处理的详细算法定义(七)
  • ARM/Linux嵌入式面经(三二):百度
  • 【区块链 + 司法存证】智慧审判留痕系统 | FISCO BCOS应用案例
  • 掀起社交娱乐新浪潮!AI如何应用到短视频APP?
  • Windows 局域网文件共享
  • js 如何获取文件名