银河麒麟操作系统 安装OceanBase 3.1图文详解

1 软件介绍

OceanBase 是一款由阿里巴巴公司自主研发的高性能、分布式的关系型数据库,支持完整的 ACID 特性,高度兼容?MySQL?协议与语法,能够以最小的迁移成本使用高性能、可扩张、持续可用的分布式数据服务。

2 安装环境

2.1 操作系统环境

银河麒麟高级服务器操作系统V10
x86:Kylin-Server-10-SP2-x86-Release-Build09-20210524.iso

2.2 硬件环境

项目 说明
CPU 4核
内存 8 G
磁盘 100G
网络 可访问互联网

2.3 软件环境

软件版本:OceanBase 3.1组件

项目 说明
Kylin-Server-10 V10(SP2)
OceanBase 3.1

3 安装操作步骤

3.1启动和运行oceanbase数据库

yum  install python3-pip

银河麒麟操作系统 安装OceanBase 3.1图文详解_第1张图片

3.2安装obdeploy

tar -xvf oceanbase-cluster-install.tar.gz   #解压OceanBase 3.1安装包 
cd obdeploy   #进入解压目录
pip3 install -r requirements3.txt  #使用pip3安装依赖包

银河麒麟操作系统 安装OceanBase 3.1图文详解_第2张图片

 sh build.sh #执行构建脚本

执行构建脚本

source /etc/profile.d/obd.sh   #设置环境变量
cd ..   #返回上级目录

3.3将本地的rpm导入mirror

obd mirror clone  -f rpms/oceanbase-ce-libs-3.1.0-1.ky10.x86_64.rpm
obd mirror clone  -f rpms/oceanbase-ce-3.1.0-1.ky10.x86_64.rpm

在这里插入图片描述在这里插入图片描述

3.4部署安装

obd cluster deploy c1 -c obdeploy/example/mini-local-example.yaml

银河麒麟操作系统 安装OceanBase 3.1图文详解_第3张图片

3.5启动和停止

启动 oceanbase数据库

obd cluster start c1    #启动 oceanbase数据库

银河麒麟操作系统 安装OceanBase 3.1图文详解_第4张图片 停止oceanbase数据库

obd cluster stop c1  #停止oceanbase数据库

3.6登录oceanbase数据库

mysql -h127.0.0.1 -uroot -P2881

银河麒麟操作系统 安装OceanBase 3.1图文详解_第5张图片列出数据库实例

show databases;

银河麒麟操作系统 安装OceanBase 3.1图文详解_第6张图片
切换数据库oceanbase

use oceanbase;

切换数据库oceanbase
显示表

show tables;

银河麒麟操作系统 安装OceanBase 3.1图文详解_第7张图片查询

 select * from CDB_CKPT_HISTORY;

查询建表

create table student (name varchar(10),age int(3),height float);

插入语句

insert into student values('xiaoming',20,1.80);

查询语句

select * from student;

更新语句

update student set age=24 where name='xiaoming';
select * from student;

删除语句

delete from student where age='24';

删除表

drop table student;

你可能感兴趣的:(oceanbase,阿里云)