OceanBase4.2.2.1 单机集群在ArmX86安装(自测记录)

OceanBase

        OceanBase就不必多加介绍了,本次主要是分享对于它的安装使用,先说说背景,首先接触是因为信创国产化的要求,为满足支持国产化,安装了Arm架构下版本4.0.0,满足支持通过。后来项目实际使用,重新进行搭建,采用了最新版4.2.2.1,本次是基于X86进行安装部署,经历过Arm和X86两种安装,他们的安装除了RPM包不同,安装过程一样,本次是基于X86安装最新版4.2.2.1,希望能帮到大家~

一:下载想要安装的版本rpm包

OceanBase相关组件很多,能力也很强,如果资源充足,可以安装所有相关东西,本次主要说明最小化使用组件安装,下面内容就可以完成一个数据库,当然OBP(obproxy)如不需要,也可以不安装,但本人还是推荐使用。

  1. observer:oceanbase数据库
  2. obproxy:oceanbase反向代理
  3. obclient:oceanbase客户端
  4. obd:oceanbase deploy

二:安装前的一些准备工作

注:部分内容,单机可跳过,会具体标注

2.1 创建用户

先创建adminy用户

adduser admin

2.2 主机之间配置ssh互信

      集群环境下需要,如果只是部署单机,这一步可以跳过。

        因为机器有限,我这里采用双机部署

  vi /etc/hosts

echo "admin   ALL=(ALL)NOPASSWD:ALL" >>/etc/sudoers

ssh-keygen

ssh-copy-id host1  

ssh-copy-id host2 对应几个host写几个

2.3 修改内核参数

也可以不进行修改,看个人

[root]# vim /etc/sysctl.conf

net.core.somaxconn = 2048net.core.netdev_max_backlog = 10000net.core.rmem_default = 16777216net.core.wmem_default = 16777216net.core.rmem_max = 16777216net.core.wmem_max = 16777216net.ipv4.ip_local_port_range = 3500 65535net.ipv4.ip_forward = 0net.ipv4.conf.default.rp_filter = 1net.ipv4.conf.default.accept_source_route = 0net.ipv4.tcp_syncookies = 0net.ipv4.tcp_rmem = 4096 87380 16777216net.ipv4.tcp_wmem = 4096 65536 16777216net.ipv4.tcp_max_syn_backlog = 16384net.ipv4.tcp_fin_timeout = 15net.ipv4.tcp_max_syn_backlog = 16384net.ipv4.tcp_tw_reuse = 1net.ipv4.tcp_tw_recycle = 1net.ipv4.tcp_slow_start_after_idle=0vm.swappiness = 0vm.min_free_kbytes = 2097152vm.max_map_count=655360fs.aio-max-nr=1048576

[root]# sysctl –p

2.4 修改全局会话变量

已经登录的会话需要重连,修改句柄数

  1. vi /etc/security/limits.conf

   添加:

* soft nofile 655360

* hard nofile 655360

* soft nproc 655360

* hard nproc 655360

* soft core unlimited

* hard core unlimited

* soft stack unlimited

* hard stack unlimited

  1. vi /etc/sysctl.conf

添加:

fs.file-max = 6553560

  1. 刷新

sysctl -p 

2.5 配置时钟同步

这一步,如果是单机可以跳过,如果是集群环境,就得验证,涉及到集群之间通信同步等问题,保证时间一致

需要同步时间,自行根据系统类型设置同步

  1. 安装chrony

[root]# yum install -y chrony

  1. 配置与阿里时钟同步

    [root]# vi /etc/chrony.conf

server ntp.aliyun.com minpoll 4 maxpoll 10 iburstallow xxx.xxx.xxx.xxxallow xxx.xxx.xxx.xxxlocal stratum 10

重启chronyd

[root]# systemctl restart chronyd

查看时间同步活动

[root]# chronyc activity

查看时间服务器

[root]# chronyc sources

查看同步状态

[root]# chronyc sources -v

校准时间服务器:

[root]# chronyc tracking

2.6 关闭防火墙

      非集群,只部署单机的话,可以跳过

[root]# systemctl stop firewalld

[root]# systemctl disable firewalld

也可根据端口使用情况,开启对应的端口

2.7 关闭selinux

[root]# vi /etc/selinux/config

          添加

          SELINUX=disabled

[root]# setenforce 0

三:部署

3.1 单机部署

3.1.1安装obd

  1. 安装部署工具

rpm -ivh ob-deploy-2.6.2-2.el7.x86_64.rpm

  1. 设置环境变量

source /etc/profile.d/obd.sh

3.1.2构建本地源

  1. 移动rpm包,构建本地源

  obd mirror clone /home/rpm/*.rpm

  1. 删除远程源

   rm -rf ~/.obd/mirror/remote/

  1. 查看本地源

   obd mirror list local

3.1.3编辑OBD配置文件

  1. 创建mini-local-example.yaml配置文件

获取方式

https://github.com/oceanbase/obdeploy/blob/master/example/mini-local-example.yaml

这里我提供一份

oceanbase-ce:servers:# Please don't use hostname, only IP can be supported- 127.0.0.1global:#  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# 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: lomysql_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: zone1cluster_id: 1# please set memory limit to a suitable value which is matching resource. memory_limit: 6G # The maximum running memory for an observersystem_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: 24G # The size of disk space used by the clog files.cpu_count: 16production_mode: falsesyslog_level: INFO # System log level. The default value is INFO.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

注意事项:

servers:只能使用ip,不能使用主机名(hostname)

cpu_count:CPU数量可以大于物理CPU的数量。

home_path 是 OceanBase 数据库的工作目录,OceanBase 数据库在此目录下启动,您需提前创建。

内存和CPU核数根据自己的机器进行调整,如果太大资源不够,后面启动时会进行报错,那会更改也可以,需要重新加载,后面问题解决里我会说明如何对于配置修改和加载

  1. 配置文件中的home权限

chown -R admin:admin  /home/observer/(你的home_path路径)

3.1.4部署observer

  1. 进行单机部署observer

obd cluster deploy myob -c mini-local-example.yaml

如果遇到问题,可查看最后一章问题汇总;部署正常显示为:

  1. 查看部署结果

  obd cluster list

OBD 中注册的集群状态有如下几种。

  1. configured:已配置,表示 OBD 中已包含该集群的配置文件,但该集群还未部署,此时可执行 obd cluster deploy 命令部署该集群。
  2. deployed:已部署,表示该集群已部署,但是还未启动,此时可执行 obd cluster start 命令启动该集群。
  3. running:运行中,表示集群正在运行中。
  4. stopped:已停止,表示集群中有组件已被停止,此时可执行 obd cluster start 命令启动该集群。
  5. upgrading:升级中,表示集群中有组件处于升级中。
  6. destroyed:已销毁,表示该集群已被销毁。
  1. 启动集群

  obd cluster start myob

默认的密码就在日志下方,具体可以进到数据库修改

然后再看状态,就是runing状态

3.2集群部署—双主

     该部署方式,先不部署代理,只是部署两台服务器的数据库,数据库之间表数据实时同步,类似于双主数据库,当然,也可以部署多台,效果一致

3.2.1安装obd

  1. 安装部署工具

rpm -ivh ob-deploy-2.6.2-2.el7.x86_64.rpm

  1. 设置环境变量

source /etc/profile.d/obd.sh

3.2.2构建本地源

  1. 移动rpm包,构建本地源

  obd mirror clone /home/rpm/*.rpm

  1. 删除远程源

   rm -rf ~/.obd/mirror/remote/

  1. 查看本地源

   obd mirror list local

3.2.3编辑OBD配置文件

  1. 创建mini-distributed-example.yaml配置文件

获取方式

https://github.com/oceanbase/obdeploy/blob/master/example/mini-distributed-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:- name: server1# Please don't use hostname, only IP can be supportedip: ip- name: server2ip: ip#- name: server3#  ip: 172.19.33.4global:# 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: eth0cluster_id: 1# please set memory limit to a suitable value which is matching resource. memory_limit: 6G # The maximum running memory for an observersystem_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 2Gdatafile_maxsize: 20G # the auto extend max size. Please enter an capacity, such as 20Glog_disk_size: 14G # The size of disk space used by the clog files.cpu_count: 8production_mode: falseenable_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 emptyserver1: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: /home/admin/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: /redozone: zone1server2: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: /home/admin/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: /redozone: 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

注意事项:

cpu_count:CPU数量可以大于物理CPU的数量。

home_path 是 OceanBase 数据库的工作目录,OceanBase 数据库在此目录下启动,您需提前创建。

内存和CPU核数根据自己的机器进行调整,如果太大资源不够,后面启动时会进行报错,那会更改也可以,需要重新加载,后面问题解决里我会说明如何对于配置修改和加载

  1. 配置文件中的home权限

chown -R admin:admin  /home/admin/observer(你的home_path路径)

3.2.4部署observer

  1. 进行集群部署observer

部署命令:obd cluster deploy [集群名] -c [集群配置文件]

obd cluster deploy peachzones -c mini-distributed-example.yaml

如果遇到问题,可查看最后一章问题汇总;部署正常显示为:

  1. 查看部署结果

  obd cluster list

  myzone忽略,那是之前创建的集群

OBD 中注册的集群状态有如下几种。

  1. configured:已配置,表示 OBD 中已包含该集群的配置文件,但该集群还未部署,此时可执行 obd cluster deploy 命令部署该集群。
  2. deployed:已部署,表示该集群已部署,但是还未启动,此时可执行 obd cluster start 命令启动该集群。
  3. running:运行中,表示集群正在运行中。
  4. stopped:已停止,表示集群中有组件已被停止,此时可执行 obd cluster start 命令启动该集群。
  5. upgrading:升级中,表示集群中有组件处于升级中。
  6. destroyed:已销毁,表示该集群已被销毁。
  7. 启动集群

  obd cluster start peachzones

默认的密码就在日志下方,具体可以进到数据库修改

然后再看状态,就是runing状态

 

3.3集群部署—分开部署proxy

     该部署方式,将proxy进行单独部署,不会通过cluster进行绑定,都需要单独的部署服务,proxy的配置信息和OBD的配置信息分开,如果看过集群部署—不带proxy,那么前面的步骤都是一样的,直接到部署observer以后的步骤看就可以了

3.3.1安装obd

  1. 安装部署工具

rpm -ivh ob-deploy-2.6.2-2.el7.x86_64.rpm

  1. 设置环境变量

source /etc/profile.d/obd.sh

3.3.2构建本地源

  1. 移动rpm包,构建本地源

  obd mirror clone /home/rpm/*.rpm

  1. 删除远程源

   rm -rf ~/.obd/mirror/remote/

  1. 查看本地源

   obd mirror list local

3.3.3编辑OBD配置文件

  1. 创建mini-distributed-example.yaml配置文件

获取方式

https://github.com/oceanbase/obdeploy/blob/master/example/mini-distributed-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:- name: server1# Please don't use hostname, only IP can be supportedip: ip- name: server2ip: ip#- name: server3#  ip: 172.19.33.4global:# 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: eth0cluster_id: 1# please set memory limit to a suitable value which is matching resource. memory_limit: 6G # The maximum running memory for an observersystem_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 2Gdatafile_maxsize: 20G # the auto extend max size. Please enter an capacity, such as 20Glog_disk_size: 14G # The size of disk space used by the clog files.cpu_count: 8production_mode: falseenable_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 emptyserver1: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: /home/admin/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: /redozone: zone1server2: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: /home/admin/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: /redozone: 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

注意事项:

cpu_count:CPU数量可以大于物理CPU的数量。

home_path 是 OceanBase 数据库的工作目录,OceanBase 数据库在此目录下启动,您需提前创建。

内存和CPU核数根据自己的机器进行调整,如果太大资源不够,后面启动时会进行报错,那会更改也可以,需要重新加载,后面问题解决里我会说明如何对于配置修改和加载

  1. 配置文件中的home权限

chown -R admin:admin  /home/admin/observer(你的home_path路径)

3.3.4部署observer

  1. 进行集群部署observer

部署命令:obd cluster deploy [集群名] -c [集群配置文件]

obd cluster deploy peachzones -c mini-distributed-example.yaml

如果遇到问题,可查看最后一章问题汇总;部署正常显示为:

  1. 查看部署结果

  obd cluster list

  myzone忽略,那是之前创建的集群

OBD 中注册的集群状态有如下几种。

  1. configured:已配置,表示 OBD 中已包含该集群的配置文件,但该集群还未部署,此时可执行 obd cluster deploy 命令部署该集群。
  2. deployed:已部署,表示该集群已部署,但是还未启动,此时可执行 obd cluster start 命令启动该集群。
  3. running:运行中,表示集群正在运行中。
  4. stopped:已停止,表示集群中有组件已被停止,此时可执行 obd cluster start 命令启动该集群。
  5. upgrading:升级中,表示集群中有组件处于升级中。
  6. destroyed:已销毁,表示该集群已被销毁。

  1. 启动集群

  obd cluster start peachzones

默认的密码就在日志下方,具体可以进到数据库修改

然后再看状态,就是runing状态

 

3.3.5安装obproxy

3.3.5.1上传obproxy

  1. 移动rpm包,构建本地源

       //可操作可不操作

             obd mirror clone /home/rpm/ obproxy-ce-4.2.3.0-3.el7.x86_64.rpm

  1. 删除远程源

               rm -rf ~/.obd/mirror/remote/

  1. 查看本地源

               obd mirror list local

3.3.5.2安装obproxy
  1. 安装

rpm -ivh obproxy-ce-4.2.3.0-3.el7.x86_64.rpm

  1. 执行

           [root]# cd /home/admin/obproxy-4.2.3.0

 [root]# bin/obproxy -r "ip:2881;ip:2881" -p 2885 -o "enable_strict_kernel_release=false,enable_cluster_checkout=false,enable_metadb_used=false,skip_proxy_sys_private_check=true,observer_sys_password=pass " -c msp_cluster

3.3.5.3安装obclient

   rpm -ivh obclient-2.2.3-1.el7.x86_64.rpm

3.3.5.4配置操作proxy

使用root@sys用户连接

[admin]# obclient –hxxx.xxx.xxx.xxx -P2881 -D oceanbase -uroot@sys -p –A

1、修改root用户密码

obclient [oceanbase]> alter user root identified by 'peachpass';

2、创建proxyro用户,obproxy连接oceanbase时使用

obclient [oceanbase]> grant select on oceanbase.* to proxyro identified by 'peachproxy';

3、修改proxy密码

用户名:root@proxysys,端口:2883,初始密码:空

[admin]# obclient  -h ip -P2883 -u root@proxysys –p

obclient [oceanbase]> show proxyconfig like '%sys_password%';

修改proxy密码为数据设置的proxyro用户密码

alter proxyconfig set observer_sys_password='peachproxy';

可选择修改proxysys密码

alter proxyconfig set obproxy_sys_password='OceanBase010';

3.3.5.5obproxy连接集群

通过obproxy连接oceanbase集群

obclient –hxxx.xxx.xxx.xxx -P2883 -uroot -p –A

最终访问成功

3.4集群部署—组件部署proxy

     该部署方式,将proxy和db绑定在一起,进行同时部署, proxy的配置信息和OBD的配置信息分开

3.4.1安装obd

  1. 安装部署工具

rpm -ivh ob-deploy-2.6.2-2.el7.x86_64.rpm

  1. 设置环境变量

source /etc/profile.d/obd.sh

3.4.2构建本地源

  1. 移动rpm包,构建本地源

注意:这里截图我没有加proxy,正常应该在开始就将proxy一起放进去构建

  obd mirror clone /home/rpm/*.rpm

  1. 删除远程源

   rm -rf ~/.obd/mirror/remote/

  1. 查看本地源

   obd mirror list local

注意:这里截图我没有加proxy,正常应该在里面有proxy

3.3.3编辑OBD配置文件

  1. 创建mini-distributed-with-obproxy-example.yaml配置文件

获取方式

https://github.com/oceanbase/obdeploy/blob/master/example/ mini-distributed-with-obproxy-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:- name: server1# Please don't use hostname, only IP can be supportedip: ip- name: server2ip: ip#- name: server3#  ip: 192.168.1.4global:# 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: eth0cluster_id: 1# please set memory limit to a suitable value which is matching resource. memory_limit: 6G # The maximum running memory for an observersystem_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 2Gdatafile_maxsize: 20G # the auto extend max size. Please enter an capacity, such as 20Glog_disk_size: 14G # The size of disk space used by the clog files.cpu_count: 16production_mode: falseenable_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_nameappname: obcluster# root_password: # root user password, can be empty# proxyro_password: # proxyro user pasword, consistent with obproxy's observer_sys_password, can be emptyserver1: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: /home/admin/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: /redozone: zone1server2: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: /home/admin/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: /redozone: 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-ce:# 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-ceservers:- ipglobal:listen_port: 2883 # External port. The default value is 2883.prometheus_listen_port: 2884 # The Prometheus port. The default value is 2884.home_path: /home/admin/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:2881enable_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: obclusterskip_proxy_sys_private_check: trueenable_strict_kernel_release: false# 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.# 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.observer_sys_password: peachpass

注意事项:

cpu_count:CPU数量可以大于物理CPU的数量。

home_path 是 OceanBase 数据库的工作目录,OceanBase 数据库在此目录下启动,您需提前创建。

内存和CPU核数根据自己的机器进行调整,如果太大资源不够,后面启动时会进行报错,那会更改也可以,需要重新加载,后面问题解决里我会说明如何对于配置修改和加载

  1. 配置文件中的home权限

chown -R admin:admin  /home/admin/observer(你的home_path路径)

3.3.4部署observer

    下面的部署内容和单独上节分开部署内容差不了太多,就是直接将proxy进行提前配置和一起安装了,安装过程种截图大差不差,主要看结果,流程是一样的

  1. 进行集群部署observer

部署命令:obd cluster deploy [集群名] -c [集群配置文件]

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

如果遇到问题,可查看最后一章问题汇总;部署正常显示为:

  1. 查看部署结果

  obd cluster list

  myzone忽略,那是之前创建的集群

OBD 中注册的集群状态有如下几种。

  1. configured:已配置,表示 OBD 中已包含该集群的配置文件,但该集群还未部署,此时可执行 obd cluster deploy 命令部署该集群。
  2. deployed:已部署,表示该集群已部署,但是还未启动,此时可执行 obd cluster start 命令启动该集群。
  3. running:运行中,表示集群正在运行中。
  4. stopped:已停止,表示集群中有组件已被停止,此时可执行 obd cluster start 命令启动该集群。
  5. upgrading:升级中,表示集群中有组件处于升级中。
  6. destroyed:已销毁,表示该集群已被销毁。

  1. 启动集群

  obd cluster start peachzones

默认的密码就在日志下方,具体可以进到数据库修改

然后再看状态,就是runing状态

 

3.3.5配置操作proxy

使用root@sys用户连接

[admin]# obclient –hxxx.xxx.xxx.xxx -P2881 -D oceanbase -uroot@sys -p –A

1、修改root用户密码

obclient [oceanbase]> alter user root identified by 'peachpass';

2、创建proxyro用户,obproxy连接oceanbase时使用

obclient [oceanbase]> grant select on oceanbase.* to proxyro identified by 'peachproxy';

3、修改proxy密码

用户名:root@proxysys,端口:2883,初始密码:空

[admin]# obclient  -h ip -P2883 -u root@proxysys –p

obclient [oceanbase]> show proxyconfig like '%sys_password%';

修改proxy密码为数据设置的proxyro用户密码

alter proxyconfig set observer_sys_password='peachproxy';

可选择修改proxysys密码

alter proxyconfig set obproxy_sys_password='OceanBase010';

3.3.6obproxy连接集群

通过obproxy连接oceanbase集群

obclient –hxxx.xxx.xxx.xxx -P2883 -uroot -p –A

最终访问成功

三:问题汇总

3.1 重复部署

再次执行 obd cluster display myob

   

可忽略,说明已部署,至于至于部署状态是什么,单独看了

3.2 重新部署

    obd cluster destroy

销毁已部署的集群。如果集群处于运行中的状态,该命令会先尝试执行 stop,成功

再执行 destroy。

3.3 enp0s3 fail to ping ……

enp0s3 fail to ping 127.0.0.1,please check ‘devname’

  此问题单机部署出现,配置IP地址为网卡地址,非loopback地址。

解决方案:编辑配置文件,重新部署集群myob 。

3.4 修改配置文件yaml,但是没生效

Deplay以后,配置文件就被加载进去了,原始的文件修改不生效,需要命令修改

[wuhs@s153 ~]$ sudo obd cluster edit-config myob

#如将devname参数改为:devname: eth0

[wuhs@s153 ~]$ sudo obd cluster redeploy myob

3.5 fail to init xxx.xxx.xxx.xxx home path : /home/admin/observer is not empty

fail to init xxx.xxx.xxx.xxx home path : /home/admin/observer is not empty

之前已经部署过集群,目录里面存在文件

解决:1、删除里面内容,

      2、修改原配置文件home_path,加载创建新的集群

3.6 The value of the ulimit parameter "max user processes"……

The value of the ulimit parameter "max user processes" must not be less than 120000 (Current value: 4096), Please execute `echo -e "* soft nproc 120000\n* hard nproc 120000" >> /etc/security/limits.d/nproc.conf` as root in 127.0.0.1. if it dosen't work, please check whether UsePAM is yes in /etc/ssh/sshd_config.

按提示操作

 echo -e "* soft nproc 120000\n* hard nproc 120000" >> /etc/security/limits.d/nproc.conf

3.7 no authentication methods available

解决:主机之间配置ssh互信,具体看准备工作2.2

3.8长时间停留在Initialize oceanbase-ce \

长时间停留在这,集群环境中防火墙端口没放开,关闭防火墙

[root]# systemctl stop firewalld

[root]# systemctl disable firewalld

3.9 defaultuser@ip connect failed:timeout

Ssh端口不是默认的,需要在配置文件手动配置

打开yaml配置文件种user属性,配置用户名,密码,Port,如果配置证书,可不配置密码

3.10 Fail check_uid_before_start, please use the initial user to start observer!

出现这个报错,可以查看启动日志,里面是否有

current user(uid=0) that starts observer is not the same with the original one(uid=1000), observer starts failed!

说明部署用户uid和启动用户uid存在差异,不让启动,

   

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/770090.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

由浅到深认识Java语言(20):包装类

该文章Github地址:https://github.com/AntonyCheng/java-notes 在此介绍一下作者开源的SpringBoot项目初始化模板(Github仓库地址:https://github.com/AntonyCheng/spring-boot-init-template & CSDN文章地址:https://blog.c…

leetcode刷题日记-外观数组

题目描述 解题思路 初始化字符串 init 为 “1”,作为外观数列的第一项。 通过循环迭代生成外观数列的下一项,循环次数为 n-1,因为已经初始化了第一项。 在每次迭代中,通过两个指针 pos 和 start 来遍历当前项 init,po…

C++中的枚举类型

C中的enum(枚举)类型是一种用户定义的类型,用于表示一组整数值,每个值都有对应的名称,增强了代码的可读性和可维护性。 1. 基本枚举类型 基本的枚举类型定义了一组命名的整数常量。 enum Color {RED,GREEN,BLUE };C…

创业之路:探索如何在Facebook上创业成功

引言 在当今数字化时代,社交媒体已成为创业者们开展业务、建立品牌和推广产品的重要平台之一。作为全球最大的社交媒体平台之一,Facebook为创业者提供了丰富的机会和资源。本文将探讨如何在Facebook上创业成功的关键因素和实践方法,帮助创业…

第九届蓝桥杯大赛个人赛省赛(软件类)真题C 语言 A 组-第几个幸运数字

幸运数字是可以被3,5,7任一整除的数字&#xff0c;列举小明号码内的所有可能组合并计数。注意别忘了把1占的一位减去。 #include<stdio.h> typedef long long ll; int main(){long long ans 0, n 59084709587505LL;for(ll i 1; i < n; i * 3){//计算小于等于n的数…

计算机程序的编译和链接

c语言中的小小白-CSDN博客c语言中的小小白关注算法,c,c语言,贪心算法,链表,mysql,动态规划,后端,线性回归,数据结构,排序算法领域.https://blog.csdn.net/bhbcdxb123?spm1001.2014.3001.5343 给大家分享一句我很喜欢我话&#xff1a; 知不足而奋进&#xff0c;望远山而前行&am…

下载网页上的在线视频 网络视频 视频插件下载

只需要在浏览器上安装一个插件&#xff0c;就可以下载大部分的视频文件&#xff0c;几秒到一两个小时的视频&#xff0c;基本都不是问题。详细解决如下&#xff1a; 0、因为工作需要&#xff0c;需要获取某网站上的宣传视频&#xff0c;我像往常一样&#xff0c;查看视频的url…

Schemdraw小白从入门到放弃---原理工具书

文章目录 序版本最简单的例子一、总体思路二、元件2.1 color习题 2.2 label2.3 length 三、元件的连接3.1 延续性习题 3.2 方向习题 3.3 接线点习题3.3.1 默认激活anchor与沉默anchor3.3.2 切换鼠标焦点机制3.3.2.1 at函数规定元件的start接在哪个anchor上3.3.2.2 to函数规定元…

重磅!一起做个淘宝的简易布局!(超详细)

你好&#xff0c;我是云桃桃。 一个希望帮助更多朋友快速入门 WEB 前端程序媛。 因为之前的学习内容&#xff0c;今天&#xff0c;我们可以来综合运用一下标签和 CSS 样式&#xff0c;做一个简易的淘宝网页大体布局了&#xff0c;如图。 咱们今天要做成这样子&#xff01; 里面…

4.1 RK3399项目开发实录-案例开发之MIPI 摄像头开发(wulianjishu666)

嵌入式从零到项目开发全套例程资料 链接&#xff1a;https://pan.baidu.com/s/1ksCQN__jD8ZrJhw8sWzhwQ?pwdvvfz 3.2. MIPI 摄像头 带有 MIPI CSI 接口的 RK3399 板子都添加了双 MIPI 摄像头 OV13850 的支持&#xff0c;应用中也添加了摄像头的例子。下面介绍一下相关配置。…

蓝桥杯(2):python基础算法【上】

时间复杂度、枚举、模拟、递归、进制转换、前缀和、差分、离散化 1 时间复杂度 重要是看循环&#xff0c;一共运行了几次 1.1 简单代码看循环 #时间复杂度1 n int(input()) for i in range(1,n1):for j in range(0,i):pass ###时间复杂度&#xff1a;123....nn(1n)/2 所以…

2024 ccfcsp认证打卡 2023 09 02 坐标变换(其二)

202309-2 坐标变换&#xff08;其二&#xff09; 题解1题解2区别第一种算法&#xff08;使用ArrayList存储操作序列&#xff09;&#xff1a;数据结构&#xff1a;操作序列处理&#xff1a; 第二种算法&#xff08;使用两个数组存储累积结果&#xff09;&#xff1a;数据结构&a…

Unable to authenticate, need: BASIC realm=“Sonatype Nexus Repository Manager“

问题 使用公司的私有源&#xff0c;执行 npm i 的时候突然报错了&#xff1a; 解决 执行命令 npm config list找到 .npmrc 去掉对应的这一行即可&#xff0c;或者使用 nrm 工具执行 nrm del xxx 删掉私有源&#xff0c;然后在添加私有源也可。可以参考我这篇&#xff1a;使…

(一)基于IDEA的JAVA基础8

使用多重if选择结构 多个if条件进行判断: 语法: if(条件1){ 执行语句1&#xff1b; }else if(条件2){ 执行语句2&#xff1b; }else if(条件3){ 执行语句3&#xff1b; }else if (条件4)…… 流程图: 我们来写个好玩的&#xff0c;对暗号: public class Test01 { …

五分钟快速搭建个人游戏网站(1Panel)

五分钟快速搭建个人游戏网站&#xff08;1Panel&#xff09; 环境要求&#xff1a;主流 Linux 发行版本&#xff08;基于 Debian / RedHat&#xff0c;包括国产操作系统&#xff09;&#xff1b; 如果是Windows OS的可以通过WSL来实现安装。 1 介绍 1Panel 是一个基于 Web 的 L…

结构体讲解

目录 一.结构体类型的声明 (1)结构体的声明 (2)结构体的创建和初始化 (3)匿名结构体 (4)结构体的自引用 二.结构体内存对齐 (1)对齐规则 (2)为什么存在内存对齐&#xff1f; (3)结构体传参 三.结构体实现位段 (1)什么是位段 (2)位段的内存分配 (3)位段的跨平…

电脑桌面便签,怎么在电脑桌面上设置便签

在数字化时代&#xff0c;电脑已成为我们日常生活不可或缺的一部分。在我们使用电脑进行各种工作和学习的过程中&#xff0c;经常会遇到需要记录临时信息或提醒自己的情况。这时&#xff0c;设置便签在电脑桌面上就成为了一种非常便捷的方法。那么有一个问题&#xff0c;电脑桌…

2.8、下拉刷新与上拉加载

页面的下拉刷新与上拉加载功能在移动应用中十分常见,例如,新闻页面的内容刷新和加载。这两种操作的原理都是通过响应用户的触摸事件,在顶部或者底部显示一个刷新或加载视图,完成后再将此视图隐藏。 实现思路 以下拉刷新为例,其实现主要分成三步: 监听手指按下事件,记录…

每天学点儿python(1)---print,input和注释

print函数 print语法格式 print(*objects, sep , end\n, filesys.stdout) sep参数默认为 一个空格 end&#xff08;输出末尾&#xff09;参数默认为 回车换行 file默认为 标准输出&#xff08;一般指屏幕&#xff09; 所以&#xff0c;如果想输出各个字段不用空格隔开&a…

vue3+threejs新手从零开发卡牌游戏(七):创建卡组

在开始前先优化下之前的代码&#xff1a; 在之前hand/p1.vue中为了定位 utils文件夹下新建common.ts&#xff0c;将一些公用方法提取出来放在这里&#xff1a; 在game/Cards.ts中&#xff0c;我们调整下卡牌的厚度&#xff0c;由原来的0.02改为0.005&#xff0c;原因是之前的…