基於CentOS系統安裝OceanBase資料庫
一、OceanBase介紹
二、OceanBase安裝操作
[root@oceanbase ~]# cat /etc/redhat-release CentOS Linux release 7.9.2009 (Core)
1、透過 YUM 軟體源下載並安裝 OBD
# yum install -y yum-utils # yum-config-manager --add-repo # yum install -y ob-deploy
[root@obd ~]# yum install -y yum-utils Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile Package yum-utils-1.1.31-54.el7_8.noarch already installed and latest version Nothing to do [root@obd ~]# yum-config-manager --add-repo Loaded plugins: fastestmirror adding repo from: grabbing file to /etc/yum.repos.d/OceanBase.repo repo saved to /etc/yum.repos.d/OceanBase.repo [root@obd ~]# yum install -y ob-deploy Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile Package ob-deploy-1.2.1-9.el7.x86_64 already installed and latest version Nothing to do [root@obd ~]#
離線安裝 OBD 1. 下載 OBD 離線 RPM 安裝包。 2. 執行以下命令安裝 OBD。 # yum install -y ob-deploy-1.0.0-1.el7.x86_64.rpm # source /etc/profile.d/obd.sh
2、下載 OceanBase 資料庫配置檔案模板
oceanbase-ce: servers: # Please don't use hostname, only IP can be supported - 127.0.0.1 global: # The working directory for OceanBase Database. OceanBase Database is started under this directory. This is a required field. home_path: /xyb/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: lo 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: 8G # The maximum running memory for an observer system_memory: 4G # The reserved system memory. system_memory is reserved for general tenants. The default value is 30G. stack_size: 512K cpu_count: 16 cache_wash_threshold: 1G __min_full_resource_pool_memory: 268435456 workers_per_cpu_quota: 10 schema_history_expire_time: 1d # The value of net_thread_count had better be same as cpu's core number. net_thread_count: 4 sys_bkgd_migration_retry_num: 3 minor_freeze_times: 10 enable_separate_sys_clog: 0 enable_merge_by_turn: FALSE datafile_disk_percentage: 20 # The percentage of the data_dir space to the total disk space. This value takes effect only when datafile_size is 0. The default value is 90. syslog_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
3、部署 OceanBase 資料庫
obd cluster deploy <deploy_name> -c <deploy_config_file> -A
[root@obs ~]# obd cluster deploy xybobs -c mini-local-example.yaml Update OceanBase-community-stable-el7 ok Update OceanBase-development-kit-el7 ok Download oceanbase-ce-3.1.2-10000392021123010.el7.x86_64.rpm (46.45 M): 100% [##############] Time: 0:00:08 5.74 MB/s Package oceanbase-ce-3.1.2 is available. install oceanbase-ce-3.1.2 for local ok +-------------------------------------------------------------------------------------------+ | Packages | +--------------+---------+-----------------------+------------------------------------------+ | Repository | Version | Release | Md5 | +--------------+---------+-----------------------+------------------------------------------+ | oceanbase-ce | 3.1.2 | 10000392021123010.el7 | 7fafba0fac1e90cbd1b5b7ae5fa129b64dc63aed | +--------------+---------+-----------------------+------------------------------------------+ Repository integrity check ok Parameter check ok Open ssh connection ok Remote oceanbase-ce-3.1.2-7fafba0fac1e90cbd1b5b7ae5fa129b64dc63aed repository install ok Remote oceanbase-ce-3.1.2-7fafba0fac1e90cbd1b5b7ae5fa129b64dc63aed repository lib check !! [WARN] 127.0.0.1 oceanbase-ce-3.1.2-7fafba0fac1e90cbd1b5b7ae5fa129b64dc63aed require: libmariadb.so.3 Try to get lib-repository Download oceanbase-ce-libs-3.1.2-10000392021123010.el7.x86_64.rpm (155.22 K): 100% [########] Time: 0:00:00 6.76 MB/s Package oceanbase-ce-libs-3.1.2 is available. install oceanbase-ce-libs-3.1.2 for local ok Use oceanbase-ce-libs-3.1.2-94fff0ab31de053051dba66039e3185fa390cad5 for oceanbase-ce-3.1.2-7fafba0fac1e90cbd1b5b7ae5fa129b64dc63aed Remote oceanbase-ce-libs-3.1.2-94fff0ab31de053051dba66039e3185fa390cad5 repository install ok Remote oceanbase-ce-3.1.2-7fafba0fac1e90cbd1b5b7ae5fa129b64dc63aed repository lib check ok Cluster status check ok Initializes observer work home ok xybobs deployed [root@obs ~]#
4、啟動 OceanBase 資料庫
[root@obs ~]# obd cluster start xybobs Get local repositories and plugins ok Open ssh connection ok Load cluster param plugin ok Check before start observer ok [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 Cluster bootstrap ok Wait for observer init ok +---------------------------------------------+ | observer | +-----------+---------+------+-------+--------+ | ip | version | port | zone | status | +-----------+---------+------+-------+--------+ | 127.0.0.1 | 3.1.2 | 2881 | zone1 | active | +-----------+---------+------+-------+--------+ xybobs running [root@obs ~]#
5、連線OceanBase資料庫
# yum install -y obclient
[root@obs ~]# yum install -y obclient Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile Resolving Dependencies --> Running transaction check ---> Package obclient.x86_64 0:2.0.0-2.el7 will be installed --> Processing Dependency: libobclient >= 2.0.0 for package: obclient-2.0.0-2.el7.x86_64 --> Running transaction check ---> Package libobclient.x86_64 0:2.0.0-2.el7 will be installed --> Finished Dependency Resolution Dependencies Resolved ====================================================================================================================================== Package Arch Version Repository Size ====================================================================================================================================== Installing: obclient x86_64 2.0.0-2.el7 oceanbase.community.stable 40 M Installing for dependencies: libobclient x86_64 2.0.0-2.el7 oceanbase.community.stable 643 k Transaction Summary ====================================================================================================================================== Install 1 Package (+1 Dependent package) Total download size: 41 M Installed size: 188 M Downloading packages: (1/2): libobclient-2.0.0-2.el7.x86_64.rpm | 643 kB 00:00:00 (2/2): obclient-2.0.0-2.el7.x86_64.rpm | 40 MB 00:00:06 -------------------------------------------------------------------------------------------------------------------------------------- Total 6.6 MB/s | 41 MB 00:00:06 Running transaction check Running transaction test Transaction test succeeded Running transaction Installing : libobclient-2.0.0-2.el7.x86_64 1/2 Installing : obclient-2.0.0-2.el7.x86_64 2/2 Verifying : libobclient-2.0.0-2.el7.x86_64 1/2 Verifying : obclient-2.0.0-2.el7.x86_64 2/2 Installed: obclient.x86_64 0:2.0.0-2.el7 Dependency Installed: libobclient.x86_64 0:2.0.0-2.el7 Complete! [root@obs ~]#
[root@obs ~]# obclient -h192.168.200.88 -P2881 -uroot Welcome to the OceanBase. Commands end with ; or \g. Your MySQL connection id is 3221487658 Server version: 5.7.25 OceanBase 3.1.2 (r10000392021123010-d4ace121deae5b81d8f0b40afbc4c02705b7fc1d) (Built Dec 30 2021 02:47:29) Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MySQL [(none)]> show databases; +--------------------+ | Database | +--------------------+ | oceanbase | | information_schema | | mysql | | SYS | | LBACSYS | | ORAAUDITOR | | test | +--------------------+ 7 rows in set (0.007 sec) MySQL [(none)]> exit Bye
[root@obs ~]# su obs [obs@obs root]$ obclient -h192.168.200.88 -P2881 -uroot Welcome to the OceanBase. Commands end with ; or \g. Your MySQL connection id is 3221487837 Server version: 5.7.25 OceanBase 3.1.2 (r10000392021123010-d4ace121deae5b81d8f0b40afbc4c02705b7fc1d) (Built Dec 30 2021 02:47:29) Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. # 檢視資料庫 MySQL [(none)]> show databases; +--------------------+ | Database | +--------------------+ | oceanbase | | information_schema | | mysql | | SYS | | LBACSYS | | ORAAUDITOR | | test | +--------------------+ 7 rows in set (0.002 sec) MySQL [(none)]>
6、OceanBase 資料庫 常用命令
# obs幫助命令 [root@obs ~]# obd -h Usage: obd <command> [options] Available commands: cluster Deploy and manage a cluster. mirror Manage a component repository for OBD. repo Manage local repository for OBD. test Run test for a running deployment. update Update OBD. Options: --version show program's version number and exit -h, --help Show help and exit. -v, --verbose Activate verbose output. # 檢視obd管理的叢集列表 [root@obs ~]# obd cluster list +------------------------------------------------------+ | Cluster List | +--------+---------------------------+-----------------+ | Name | Configuration Path | Status (Cached) | +--------+---------------------------+-----------------+ | xybobs | /root/.obd/cluster/xybobs | running | +--------+---------------------------+-----------------+ # 檢視叢集狀態 [root@obs ~]# obd cluster display xybobs 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 | +-----------+---------+------+-------+--------+ | 127.0.0.1 | 3.1.2 | 2881 | zone1 | active | +-----------+---------+------+-------+--------+
三、安裝過程中的報錯資訊
[root@obs ~]# vim mini-local-example.yaml [root@obs ~]# obd cluster autodeploy xyb -c mini-local-example.yaml Update OceanBase-community-stable-el7 ok Update OceanBase-development-kit-el7 ok Download oceanbase-ce-3.1.2-10000392021123010.el7.x86_64.rpm (46.45 M): 100% [####] Time: 0:00:06 7.88 MB/s Package oceanbase-ce-3.1.2 is available. install oceanbase-ce-3.1.2 for local ok Cluster param config check ok Open ssh connection ok Generate observer configuration x [ERROR] (127.0.0.1) / not enough disk space. (Avail: 14.9G, Need: 64.1G). Use `redo_dir` to set other disk for clog
[root@obs ~]# obd cluster start xybobs Get local repositories and plugins ok Open ssh connection ok Load cluster param plugin ok Check before start observer x [WARN] (127.0.0.1) clog and data use the same disk (/) [ERROR] 127.0.0.1 ens32 fail to ping 127.0.0.1. Please check configuration `devname` [root@obs ~]#
[root@obs ~]# obd cluster start xybobs Get local repositories and plugins ok Open ssh connection ok Load cluster param plugin ok Check before start observer x [ERROR] (127.0.0.1) not enough memory. (Free: 7.3G, Need: 8.0G) [WARN] (127.0.0.1) clog and data use the same disk (/) [root@obs ~]#
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/70003733/viewspace-2886133/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- nginx手動安裝基於類centos系統環境安裝NginxCentOS
- 安裝CentOS系統 --基於windowx的Hyper-vCentOS
- Centos7系統如何安裝MySQL5.7資料庫?CentOSMySql資料庫
- Linux環境下的Mysql資料庫入門-基於Centos系統LinuxMySql資料庫CentOS
- Linux系統安裝後的基礎優化-基於CentOS(5.8/6.4)Linux優化CentOS
- CentOS6.5安裝Redis資料庫CentOSRedis資料庫
- 《OceanBase 資料庫系統概念》首次釋出,系統精準定義 OceanBase !資料庫
- CentOS系統安裝NginxCentOSNginx
- CentOS系統安裝dockerCentOSDocker
- 基於裸裝置檔案格式安裝oracle資料庫Oracle資料庫
- Centos-8.2-安裝達夢資料庫CentOS資料庫
- 淘寶海量資料庫OceanBase系統架構資料庫架構
- Linux系統安裝——Centos 7.6安裝LinuxCentOS
- kickstart半自動安裝centos系統與pxe自動安裝centos系統CentOS
- CentOS 6.2下安裝基於Suricata + Barnyard 2 + Base 的⼊侵檢測系統CentOS
- Linux系統安裝01-centos7系統安裝LinuxCentOS
- CentOS 7.8作業系統安裝(用於生產)CentOS作業系統
- Centos系統安裝JenkinsCentOSJenkins
- CentOS 6.5系統安裝配置CentOS
- CentOS7離線安裝(rpm安裝)mysql資料庫CentOSMySql資料庫
- CentOS 7.4下安裝Oracle 11.2.0.4資料庫CentOSOracle資料庫
- centos下nosql資料庫的安裝詳解CentOSSQL資料庫
- CentOS下Mysql資料庫的安裝與配置CentOSMySql資料庫
- CentOS6.X系統安裝CentOS
- CentOS7.X系統安裝CentOS
- CentOS系統R安裝RODBC包CentOS
- CentOS7 安裝Oracle12c資料庫CentOSOracle資料庫
- Linux系統徹底解除安裝MySQL資料庫LinuxMySql資料庫
- linux系統和oracle資料庫安裝簡介LinuxOracle資料庫
- 【Jenkins】基於Windows系統安裝JenkinsJenkinsWindows
- Windows系統安裝Mariadb資料庫(zip包方式安裝)--九五小龐Windows資料庫
- 資料庫安裝以及基礎知識資料庫
- CentOS 6 安裝MAVEN及系統配置CentOSMaven
- CentOS 7.8安裝PostgreSQL(生產系統)CentOSSQL
- centos7系統安裝xrdp教程。CentOS
- Centos7系統安裝wgetCentOSwget
- 安裝Centos6.7的系統配置CentOS
- Linux系統安裝(CentOS6)LinuxCentOS