OceanBase 4.0:使用all in one包安装和启动一个单机集群

简介: Ocean Base 4.0的all in one 包简化了安装和启动集群的步骤

1 下载OB 4.0的all in one包

  下载地址在这里

https://open.oceanbase.com/softwareCenter/community

  打开页面点击第一个OceanBase All in One后弹出下载窗口,下载时注意点击对应CPU架构的链接。

屏幕截图(1339).png

2 将下载的包传到服务器上并解压安装

     OceanBase 4.0对操作系统及内核的版本都有要求,如果是centos,要求本为7.x,内核3.10.0 版本及以上,检查一下操作系统及内核版本。

[root@my_ob ~]# uname -a  Linux my_ob 3.10.0-1160.59.1.el7.x86_64 #1 SMP Wed Feb 23 16:47:03 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux[root@my_ob ~]# cat /etc/redhat-release  CentOS Linux release 7.9.2009 (Core)

    下载的安装包上传到/root目录下,解压到/usr/local目录下

[root@my_ob ~]# ls -l oceanbase-all-in-one.4.0.0.0-beta-100120221102135736.el7.x86_64.tar.gz-rw-r--r--1 root root 257703079 Dec 2609:15 oceanbase-all-in-one.4.0.0.0-beta-100120221102135736.el7.x86_64.tar.gz
[root@my_ob ~]# tar -xzf oceanbase-all-in-one.4.0.0.0-beta-100120221102135736.el7.x86_64.tar.gz -C /usr/local

  切换到/usr/local/oceanbase-all-in-one/bin目录下,运行安装脚本

[root@my_ob bin]# ./install.sh  name: grafana
  version: 7.5.17
  release:1
  arch: x86_64
  md5: 1bf1f338d3a3445d8599dc6902e7aeed4de4e0d6
  add /usr/local/oceanbase-all-in-one/rpms/grafana-7.5.17-1.el7.x86_64.rpm to local mirror
  name: obagent
  version: 1.2.0
  release:4.el7
  arch: x86_64
  md5: 0e8f5ee68c337ea28514c9f3f820ea546227fa7e
  add /usr/local/oceanbase-all-in-one/rpms/obagent-1.2.0-4.el7.x86_64.rpm to local mirror
  name: obproxy-ce
  version: 4.0.0
  release:5.el7
  arch: x86_64
  md5: de53232a951184fad75b15884458d85e31d2f6c3
  add /usr/local/oceanbase-all-in-one/rpms/obproxy-ce-4.0.0-5.el7.x86_64.rpm to local mirror
  name: oceanbase-ce
  version: 4.0.0.0
  release:100000272022110114.el7
  arch: x86_64
  md5: 42611dc51ca9bb28f36e60e4406ceea4a74914c7
  add /usr/local/oceanbase-all-in-one/rpms/oceanbase-ce-4.0.0.0-100000272022110114.el7.x86_64.rpm to local mirror
  name: oceanbase-ce-libs
  version: 4.0.0.0
  release:100000272022110114.el7
  arch: x86_64
  md5: 188919f8128394bf9b62e3989220ded05f1d14da
  add /usr/local/oceanbase-all-in-one/rpms/oceanbase-ce-libs-4.0.0.0-100000272022110114.el7.x86_64.rpm to local mirror
  name: prometheus
  version: 2.37.1
  release:10000102022110211.el7
  arch: x86_64
  md5: 58913c7606f05feb01bc1c6410346e5fc31cf263
  add /usr/local/oceanbase-all-in-one/rpms/prometheus-2.37.1-10000102022110211.el7.x86_64.rpm to local mirror
  Disable remote ok
#####################################################################   Install Finished
=====================================================================  Setup Environment:     source ~/.oceanbase-all-in-one/bin/env.sh
  Quick Start:           obd demo
  More Details:          obd -h=====================================================================

可以看到脚本不仅安装了ob,obproxy,也安装了prometheus,grafana。

3 集群部署和启动

     可以使用obd demo命令快速部署和启动ob集群,不过使用这个命令部署需要50G的磁盘空间,我这里root文件系统没有这个多剩余空间,选择使用obd提供的配置文件示例来启动一个最小化的集群。

     obd的配置文件示例在/usr/local/oceanbase-all-in-one/obd/usr/obd/example目录下,拷贝目录下的mini-local-example.yaml至当前用户的home目录下,简单编辑一下,可以部署和启动集群了。

[root@my_ob ~]# obd cluster deploy lo -c mini-local-example.yaml      install oceanbase-ce-4.0.0.0 for local ok
+--------------------------------------------------------------------------------------------+      |                                          Packages                                          |
+--------------+---------+------------------------+------------------------------------------+      | Repository   | Version | Release                | Md5                                      |
+--------------+---------+------------------------+------------------------------------------+      | oceanbase-ce | 4.0.0.0 | 100000272022110114.el7 | 42611dc51ca9bb28f36e60e4406ceea4a74914c7 |
+--------------+---------+------------------------+------------------------------------------+      Repository integrity check ok
      Parameter check ok
      Open ssh connection ok
      Cluster status check ok
      Initializes observer work home ok
      Remote oceanbase-ce-4.0.0.0-100000272022110114.el7-42611dc51ca9bb28f36e60e4406ceea4a74914c7 repository install ok
      Remote oceanbase-ce-4.0.0.0-100000272022110114.el7-42611dc51ca9bb28f36e60e4406ceea4a74914c7 repository lib check ok
      lo deployed
[root@my_ob ~]# obd cluster start lo      Get local repositories ok
      Search plugins ok
      Open ssh connection ok
      Load cluster param plugin ok
      Check before start observer x
      [ERROR] (127.0.0.1): when production_mode is True, memory_limit can not be less then16.0G
      [ERROR] (127.0.0.1) / not enough disk space. (Avail: 11.4G, Need: 20.0G)
      See https://www.oceanbase.com/product/ob-deployer/error-codes .

      集群部署时没有问题,启动时报错了,一个是生产模式下内存不能小于16G,另一个是空间不能小于20G,第一个问题可以将配置文件中的生产模式改为false,第二个问题则需要设置ob工作目录到较大的文件系统上。删除现有部署重新部署后启动集群。

[root@localhost ~]# obd cluster start lo      Get local repositories ok
      Search plugins ok
      Open ssh connection ok
      Load cluster param plugin ok
      Check before start observer ok
      [WARN] (127.0.0.1) The recommended value of fs.aio-max-nr is 1048576 (Current value: 65536)
      [WARN] OBD-1007: (127.0.0.1) The recommended number of open files is 655350 (Current value: 65536)
      [WARN] (127.0.0.1) clog and data use the same disk (/)
      Start observer ok
      observer program health check ok
      Connect to observer ok
      Initialize cluster ok
      Wait for observer init ok
+---------------------------------------------+      |                   observer                  |
+-----------+---------+------+-------+--------+      | ip        | version | port | zone  | status |
+-----------+---------+------+-------+--------+      | 127.0.0.1 | 4.0.0.0 | 2881 | zone1 | ACTIVE |
+-----------+---------+------+-------+--------+      obclient -h127.0.0.1 -P2881-uroot-Doceanbase      lo running

集群启动成功,可以使用obclient登录了

[root@localhost ~]# obclient -h127.0.0.1 -P2881 -uroot -Doceanbase      Reading table information for completion of table and column names
      You can turn off this feature to get a quicker startup with -A      Welcome to the OceanBase.  Commands end with ; or \g.
      Your OceanBase connection id is 3221487617      Server version: OceanBase_CE 4.0.0.0 (r100000272022110114-6af7f9ae79cd0ecbafd4b1b88e2886ccdba0c3be) (Built Nov  1202214:57:18)
      Copyright (c) 2000, 2018, OB Corporation Ab and others.
      Type 'help;' or '\h'for help. Type '\c' to clear the current input statement.

检查一下数据库的版本

obclient [oceanbase]>select version();+------------------------------+| version()|+------------------------------+|5.7.25-OceanBase_CE-v4.0.0.0|+------------------------------+1 row inset(0.001 sec)
相关文章
|
2月前
|
存储 关系型数据库 MySQL
OceanBase集群的组成
【8月更文挑战第10天】OceanBase集群的组成
165 60
|
2月前
|
存储 容灾 数据处理
OceanBase集群是什么?
【8月更文挑战第9天】OceanBase集群是什么?
180 59
|
2月前
|
存储 容灾 数据处理
OceanBase集群
【8月更文挑战第10天】OceanBase集群
30 6
|
2月前
|
运维 监控 数据库
在OceanBase数据库中,obd集群版本需在线升级4.3.1.0升级至4.3.2
【8月更文挑战第14天】在OceanBase数据库中,obd集群版本需在线升级4.3.1.0升级至4.3.2
47 0
|
5月前
|
SQL 关系型数据库 MySQL
OBCP实践 - 迁移 MySQL 数据到 OceanBase 集群
OBCP实践 - 迁移MySQL数据到OceanBase集群,这是一个涉及到将现有MySQL数据库的数据和表结构迁移到OceanBase分布式数据库集群的实际操作过程。OceanBase是一款高度兼容MySQL协议的分布式数据库产品,支持在线平滑迁移,以便企业用户可以从传统的MySQL数据库平滑迁移到OceanBase,以实现更高的可用性、扩展性和性能。
102 0
|
2月前
|
存储 SQL 分布式数据库
OceanBase 入门:分布式数据库的基础概念
【8月更文第31天】在当今的大数据时代,随着业务规模的不断扩大,传统的单机数据库已经难以满足高并发、大数据量的应用需求。分布式数据库应运而生,成为解决这一问题的有效方案之一。本文将介绍一款由阿里巴巴集团自主研发的分布式数据库——OceanBase,并通过一些基础概念和实际代码示例来帮助读者理解其工作原理。
117 0
|
2月前
|
Oracle 架构师 分布式数据库
OceanBase数据库的发展历程是什么?
【8月更文挑战第11天】OceanBase数据库的发展历程是什么?
146 63
|
2月前
|
Oracle 关系型数据库 MySQL
OceanBase数据库简介
【8月更文挑战第9天】OceanBase数据库简介
275 60
|
2月前
|
Oracle 关系型数据库 MySQL
OceanBase 与传统数据库的对比
【8月更文第31天】随着云计算和大数据技术的发展,分布式数据库因其高扩展性、高可用性和高性能而逐渐成为企业和开发者关注的焦点。在众多分布式数据库解决方案中,OceanBase作为一个由阿里巴巴集团自主研发的分布式数据库系统,以其独特的架构设计和卓越的性能表现脱颖而出。本文将深入探讨OceanBase与其他常见关系型数据库管理系统(如MySQL、Oracle)之间的关键差异,并通过具体的代码示例来展示这些差异。
98 1
|
2月前
|
关系型数据库 OLAP 分布式数据库
揭秘Polardb与OceanBase:从OLTP到OLAP,你的业务选对数据库了吗?热点技术对比,激发你的选择好奇心!
【8月更文挑战第22天】在数据库领域,阿里巴巴的Polardb与OceanBase各具特色。Polardb采用共享存储架构,分离计算与存储,适配高并发OLTP场景,如电商交易;OceanBase利用灵活的分布式架构,优化数据分布与处理,擅长OLAP分析及大规模数据管理。选择时需考量业务特性——Polardb适合事务密集型应用,而OceanBase则为数据分析提供强大支持。
197 2

热门文章

最新文章

下一篇
无影云桌面