学习OB ,这是OB 的第二期,还是那句话,让人家用枪逼着上路,不如自己自找出路,今天安装。基于OB并不是一个想装就能装的数据库,OB的同学给我们这些想用的人,来了一套一键安装的版本。其中文档中明确了,我们这样使用和安装的问题,但我们就是要试用一下,所以必然就这样了。尤其昨天听了一耳朵 OceanBase新数据库版本的发布会,其中有几句话。
1 OceanBase 完全可以无改动代码迁移MySQL 5.7 到OB
2 OceanBase 新版本支持内嵌redis功能缓存数据库
3 OceanBase 整体的各种性能提高 ,插入性能提高20%
行吧,OceanBase的文档比较全,学起来书,文档,各种群的信息,相信快速学习OceanBase客观因素都准备好了,剩下主观就看个人的造化了。
方案一:部署 OceanBase 演示环境
此方案适用于仅有一台机器时,快速搭建一个可用的 OceanBase 数据库环境。部署的 OceanBase 数据库环境具备数据库的基本功能,可以有效地帮助您了解 OceanBase 数据库;但是该环境不具备任何分布式能力及高可用特性,不建议长期使用
对我们使用了方案1,演示环境。解压后,整体的压缩文件了661MB
-rw-------. 1 root root 2.8K May 2 19:28 anaconda-ks.cfg
-rw-------. 1 root root 8 May 2 19:59 .bash_history
-rw-r--r--. 1 root root 18 Dec 28 2013 .bash_logout
-rw-r--r--. 1 root root 176 Dec 28 2013 .bash_profile
-rw-r--r--. 1 root root 176 Dec 28 2013 .bashrc
drwx------. 3 root root 18 May 2 19:59 .cache
drwxr-xr-x. 3 root root 18 May 2 19:59 .config
-rw-r--r--. 1 root root 100 Dec 28 2013 .cshrc
drwxr-xr-x. 6 root root 88 Mar 28 20:46 oceanbase-all-in-one
-rw-r--r--. 1 root root 661M Apr 23 00:09 oceanbase-all-in-one-4.3.0.1-100000242024032211.el7.x86_64.tar.gz
-rw-------. 1 root root 2.1K May 2 19:28 original-ks.cfg
-rw-r--r--. 1 root root 129 Dec 28 2013 .tcshrc
-rw-------. 1 root root 67 May 2 19:59 .Xauthority
[root@localhost oceanbase-all-in-one]# ll -ah
total 16K
drwxr-xr-x. 6 root root 88 Mar 28 20:46 .
dr-xr-x---. 5 root root 4.0K May 2 20:51 ..
drwxr-xr-x. 2 root root 58 Mar 28 20:45 bin
drwxr-xr-x. 3 root root 17 Mar 28 20:46 obclient
drwxr-xr-x. 4 root root 28 Mar 28 20:45 obd
-rw-r--r--. 1 root root 666 Mar 28 20:45 README.md
drwxr-xr-x. 2 root root 4.0K Mar 28 20:46 rpms
-rw-r--r--. 1 root root 27 Mar 28 20:45 VERSION
[root@localhost oceanbase-all-in-one]# cd bin
[root@localhost bin]# ls
env.sh install.sh uninstall.sh
[root@localhost bin]# ll -ah
total 12K
drwxr-xr-x. 2 root root 58 Mar 28 20:45 .
drwxr-xr-x. 6 root root 88 Mar 28 20:46 ..
-rw-r--r--. 1 root root 238 Mar 28 20:45 env.sh
-rwxr-xr-x. 1 root root 2.2K Mar 28 20:45 install.sh
-rwxr-xr-x. 1 root root 235 Mar 28 20:45 uninstall.sh
然后我们进入文档中指定的安装目录的位置,直接运行安装目录中的要运行的./install.sh,在安装中没有任何的提示或问题,很快就安装,并且告知了,如果要知晓相关安装的整个的过程,可以去
obd display-trace 7759d5fa-0900-11ef-a1f1-000c292fc016 来查看当前的整体安装的过程。
If you want to view detailed obd logs, please run: obd display-trace 7759d5fa-0900-11ef-a1f1-000c292fc016
Disable remote ok
Trace ID: 78f964ac-0900-11ef-9761-000c292fc016
If you want to view detailed obd logs, please run: obd display-trace 78f964ac-0900-11ef-9761-000c292fc016
add auto set env logic to profile: /root/.bash_profile
#########################################################################################
Install Finished
=========================================================================================
Setup Environment: source ~/.oceanbase-all-in-one/bin/env.sh
Quick Start: obd demo
Use Web Service to install: obd web
Use Web Service to upgrade: obd web upgrade
More Details: obd -h
=========================================================================================
[root@localhost bin]#
但是在安装时遇到一些问题,大家可以注意ERROR的部分,当然这里OB的安装的部分是要给点赞的,他会告诉你处理的方案,按照ERROR中给出的的提示,以及给出的命令,将需要进行的前期条件进行了补偿后,安装成功了,同时如obd demo命令既是安装命令也是检测命令和修补的命令,在安装不成功中可以一直的运行他去逐渐完善不能安装的错误。 这里有OB 提示比如open files ,hard nproc 等部分的系统参数需要调整,并给出了命令
`echo -e "* soft nproc 120000\n* hard nproc 120000" >> /etc/security/limits.d/nproc.conf
echo -e "* soft nofile 20000\n* hard nofile 20000" >> /etc/security/limits.d/nofile.conf
Load cluster param plugin ok
Open ssh connection ok
Check before start observer x
[ERROR] OBD-1007: (127.0.0.1) The value of the ulimit parameter "open files" must not be less than 20000 (Current value: 1024), Please execute `echo -e "* soft nofile 20000\n* hard nofile 20000" >> /etc/security/limits.d/nofile.conf` as root in 127.0.0.1. if it dosen't work, please check whether UsePAM is yes in /etc/ssh/sshd_config.
[ERROR] OBD-1007: (127.0.0.1) The value of the ulimit parameter "max user processes" must not be less than 120000 (Current value: 63344), 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.
[WARN] OBD-1007: (127.0.0.1) The recommended number of core file size is unlimited (Current value: 0)
[WARN] OBD-1007: (127.0.0.1) The recommended number of stack size is unlimited (Current value: 8192)
[WARN] OBD-1017: (127.0.0.1) The value of the "vm.max_map_count" must be within [327600, 1310720] (Current value: 65530, Recommended value: 655360)
[WARN] OBD-1017: (127.0.0.1) The value of the "fs.file-max" must be greater than 6573688 (Current value: 1552260, Recommended value: 6573688)
[WARN] OBD-1012: (127.0.0.1) clog and data use the same disk (/)
Check before start obagent ok
Check before start obproxy ok
Check before start prometheus ok
Check before start grafana ok
See https://www.oceanbase.com/product/ob-deployer/error-codes .
Trace ID: 4a36d9aa-0901-11ef-9d9a-000c292fc016
If you want to view detailed obd logs, please run: obd display-trace 4a36d9aa-0901-11ef-9d9a-000c292fc016
[root@localhost bin]# reboot
Check before start obagent ok
Check before start prometheus ok
Check before start obproxy ok
Check before start grafana ok
Start observer ok
observer program health check ok
Connect to observer 127.0.0.1:2881 ok
Initialize oceanbase-ce ok
Start obagent ok
obagent program health check ok
Connect to Obagent ok
Start promethues ok
prometheus program health check ok
Connect to Prometheus ok
Initialize prometheus ok
Start obproxy ok
obproxy program health check ok
Connect to obproxy ok
Initialize obproxy-ce ok
Start grafana ok
grafana program health check ok
Connect to grafana ok
Initialize grafana ok
Wait for observer init ok
+---------------------------------------------+
| observer |
+-----------+---------+------+-------+--------+
| ip | version | port | zone | status |
+-----------+---------+------+-------+--------+
| 127.0.0.1 | 4.3.0.1 | 2881 | zone1 | ACTIVE |
+-----------+---------+------+-------+--------+
obclient -h127.0.0.1 -P2881 -uroot -Doceanbase -A
+--------------------------------------------------------------+
| obagent |
+-----------+--------------------+--------------------+--------+
| ip | mgragent_http_port | monagent_http_port | status |
+-----------+--------------------+--------------------+--------+
| 127.0.0.1 | 8089 | 8088 | active |
+-----------+--------------------+--------------------+--------+
+--------------------------------------------------+
| prometheus |
+-----------------------+------+----------+--------+
| url | user | password | status |
+-----------------------+------+----------+--------+
| http://127.0.0.1:9090 | | | active |
+-----------------------+------+----------+--------+
+---------------------------------------------+
| obproxy |
+-----------+------+-----------------+--------+
| ip | port | prometheus_port | status |
+-----------+------+-----------------+--------+
| 127.0.0.1 | 2883 | 2884 | active |
+-----------+------+-----------------+--------+
obclient -h127.0.0.1 -P2883 -uroot -Doceanbase -A
+-----------------------------------------------------------------+
| grafana |
+-----------------------------------+-------+------------+--------+
| url | user | password | status |
+-----------------------------------+-------+------------+--------+
| http://127.0.0.1:3000/d/oceanbase | admin | JuqNCmkiR2 | active |
+-----------------------------------+-------+------------+--------+
demo running
Trace ID: 8b053b50-0908-11ef-a1a4-000c292fc016
If you want to view detailed obd logs, please run: obd display-trace 8b053b50-0908-11ef-a1a4-000c292fc016
最终安装成功,并且给出了连接的方式以及一些核心的信息,和TRACE整个安装的日志的方案。这里也使用过一些其他的国产数据库,建议可以参考OB在这里做的好的部分。然后通过命令直接将安装成功后,进行连接。
[root@localhost ~]# obclient -h127.0.0.1 -P2883 -uroot -Doceanbase -A
Welcome to the OceanBase. Commands end with ; or \g.
Your OceanBase connection id is 292552706
Server version: OceanBase_CE 4.3.0.1 (r100000242024032211-0193a343bc60b4699ec47792c3fc4ce166a182f9) (Built Mar 22 2024 13:19:48)
Copyright (c) 2000, 2018, OceanBase and/or its affiliates. All rights reserved.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
obclient [oceanbase]> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| LBACSYS |
| mysql |
| oceanbase |
| ocs |
| ORAAUDITOR |
| SYS |
| test |
+--------------------+
8 rows in set (0.006 sec)
obclient [oceanbase]>
今天就先到这里,临时工会后续持续对于OB的一些部分进行学习和记录。
后续希望能加快学习OceanBase的速度,因为有还有更大的秘密等着呢!
本文分享自 AustinDatabases 微信公众号,前往查看
如有侵权,请联系 cloudcommunity@tencent.com 删除。
本文参与 腾讯云自媒体同步曝光计划 ,欢迎热爱写作的你一起参与!