具体步骤
下载企业版安装包,具体地址官网去下
安装包转到你服务器具体位置
-
解压
tar -xzf oceanbase-standalone-all-in-one-4.2.5.3-xxxxxxxxxxxxxxxxxx.el7.x86_64.tar.gz
-
切到目录
cd oceanbase-standalone-all-in-one/bin/
-
执行OBD命令
./install_obd.sh
-
直接OB交互式安装
./install_ob.sh
-
交互式安装如下(写了注意点的都是需要注意的)
Enter the IP (Default: 10.255.255.254) (only support local IP): Valid local IP: 10.255.255.254 注意点,这里需要输入服务器密码 Enter the current user password : Trace ID: c760ed20-230a-11f0-8f11-00155d3ce480 If you want to view detailed obd logs, please run: obd display-trace c760ed20-230a-11f0-8f11-00155d3ce480 get system config ok +------------------------------------------------------------------+ | System Parameter Change List | +----------------+------------------+---------------+--------------+ | ip | need_change_var | current_value | target_value | +----------------+------------------+---------------+--------------+ | 10.255.255.254 | vm.max_map_count | 262144 | 655360 | | 10.255.255.254 | fs.file-max | 65535 | 6573688 | | 10.255.255.254 | nofile | 200000 | 655350 | +----------------+------------------+---------------+--------------+ Trace ID: c89c684a-230a-11f0-bc25-00155d3ce480 If you want to view detailed obd logs, please run: obd display-trace c89c684a-230a-11f0-bc25-00155d3ce480 Do you want to modify the parameters above? (y/n) (Default: y) get system config ok 10.255.255.254: ( vm.max_map_count,fs.file-max,nofile ) have been successfully modified! Trace ID: d954a12a-230a-11f0-8c40-00155d3ce480 If you want to view detailed obd logs, please run: obd display-trace d954a12a-230a-11f0-8c40-00155d3ce480 Do you want to quit the script and manually restart the machine to apply the optimizations? (y/n) (Default: n) Enter the cluster name (Default: standalone; allowed characters: letters, numbers, and underscores): Enter the OB SQL port (Default: 2881): Enter the OB RPC port (Default: 2882): Enter the obshell port (Default: 2886): 注意点,这里进行设置系统用户密码,root账号 Enter the OB root password (Default: LJfh9Jb1lYJkQhpKz3T0): 注意点,再次确认输入系统用户密码 Confirm the OB root password: Enter the OB cpu count (Default: 12): Enter the OB memory limit (Configurable Range[6, 13], Default: 13, Unit: G): 注意点,下面三个为数据库的数据文件位置可以指定位置,不然就默认 Enter the OB installation directory (Default: /root/standalone): /home/oceanbase/standalone Enter the OB data directory (Default: /data/1/standalone): /home/oceanbase/data Enter the OB log directory (Default: /data/log1/standalone): /home/oceanbase/log The data_dir and redo_dir are using the same disk. Enter the OB datafile maxsize (Configurable Range[26, 172], Default: 172, Unit: G): Enter the OB log disk size (Configurable Range[26, 29], Default: 29, Unit: G): Do you want to create tenant for your business workload? (y/n)(Default: y): Tenant: sys conifguration: 2C/1G/3G(CPU/Memory/Log disk) system_memory configuration(Unit: G): 5 注意点,输入租户名称,如果默认就是test Enter the tenant name (Default: test; allowed characters: letters, numbers, and underscores): RMT Please select the tenant mode (enter the corresponding number): 1) MySQL 2) Oracle 注意点,确认兼容模式 Please enter your choice [1/2] (default 1):2 Enter the tenant cpu (Configurable Range[1, 10], Default: 10): Enter the tenant memory (Configurable Range[1, 7], Default: 7, Unit: G): Enter the tenant log disk size(Configurable Range[21, 25], Default: 25, Unit: G): Do you want to enable encryption for password security? (y/n) (Default: n): 注意点,是否安装一些监控组件,我是拒绝安装了 Do you need to install the monitoring components (OBAgent, Prometheus, Grafana)? (y/n) (Default: y): n Monitoring Component will not be installed. 安装信息如下 #Saved configurations: cluster name: standalone mysql port: 2881 rpc port: 2882 obshell port: 2886 cpu count: 12 memory limit: 13G home path: /home/oceanbase/standalone data dir: /home/oceanbase/data log dir: /home/oceanbase/log datafile maxsize: 172G log disk size: 29G tenant name: RMT tenant cpu: 10 tenant memory: 7G tenant log disk size: 25G Are you sure these configurations are correct? (y/n) (Default: y): Configuration confirmed. start cluster... install oceanbase-standalone-4.2.5.3 for local ok Cluster param config check ok Open ssh connection ok +----------------------------------------------------------------------------------------------------+ | Packages | +----------------------+---------+------------------------+------------------------------------------+ | Repository | Version | Release | Md5 | +----------------------+---------+------------------------+------------------------------------------+ | oceanbase-standalone | 4.2.5.3 | 103000152025033110.el8 | 305669b55281773f5c53ff4e44ff9f7bed9f7bc0 | +----------------------+---------+------------------------+------------------------------------------+ Repository integrity check ok Load param plugin ok Open ssh connection ok Initializes observer work home ok Parameter check ok Remote oceanbase-standalone-4.2.5.3-103000152025033110.el8-305669b55281773f5c53ff4e44ff9f7bed9f7bc0 repository install ok Remote oceanbase-standalone-4.2.5.3-103000152025033110.el8-305669b55281773f5c53ff4e44ff9f7bed9f7bc0 repository lib check !! Try to get lib-repository install oceanbase-standalone-libs-4.2.5.3 for local ok Remote oceanbase-standalone-libs-4.2.5.3-103000152025033110.el8-84315910ce45d91ed361867215964369044185c0 repository install ok Remote oceanbase-standalone-4.2.5.3-103000152025033110.el8-305669b55281773f5c53ff4e44ff9f7bed9f7bc0 repository lib check ok standalone deployed Get local repositories ok Load cluster param plugin ok Open ssh connection ok [WARN] OBD-1007: (10.255.255.254) The recommended number of open files is 655350 (Current value: 200000) [WARN] OBD-1007: (10.255.255.254) The recommended number of core file size is unlimited (Current value: 0) [WARN] OBD-1007: (10.255.255.254) The recommended number of stack size is unlimited (Current value: 8192) [WARN] OBD-2000: (10.255.255.254) not enough memory. (Free: 13G, Need: 13G) [WARN] OBD-1012: (10.255.255.254) clog and data use the same disk (/) cluster scenario: None Start observer ok observer program health check ok Connect to observer 10.255.255.254:2881 ok oceanbase bootstrap ok obshell start ok obshell program health check ok obshell bootstrap ok Connect to observer 10.255.255.254:2881 ok Wait for observer init ok +--------------------------------------------------+ | oceanbase-standalone | +----------------+---------+------+-------+--------+ | ip | version | port | zone | status | +----------------+---------+------+-------+--------+ | 10.255.255.254 | 4.2.5.3 | 2881 | zone1 | ACTIVE | +----------------+---------+------+-------+--------+ 注意点,生成的连接信息如下,系统账户 obclient -h10.255.255.254 -P2881 -uroot@sys -p'Aa123123' -Doceanbase -A cluster unique id: b2305841-4e90-5a2d-9881-a4281e578ecc-19674fce60e-03050204 standalone running Trace ID: 88c1753e-230b-11f0-8ccc-00155d3ce480 If you want to view detailed obd logs, please run: obd display-trace 88c1753e-230b-11f0-8ccc-00155d3ce480 create tenant... Get local repositories ok Open ssh connection ok Connect to observer 10.255.255.254:2881 ok Create tenant RMT ok Create user in oracle tenant is not supported and --password is not supported Trace ID: 01386e96-230c-11f0-8040-00155d3ce480 If you want to view detailed obd logs, please run: obd display-trace 01386e96-230c-11f0-8040-00155d3ce480 You can access the RMT tenant using the following command.: For security reasons, kindly reset the root password immeditely once the tenant has been successfully created. 注意点,生成的连接信息如下,系统租户 obclient -h10.255.255.254 -P2881 -uSYS@RMT If this cluster is for production use, please import a commercial license in time.
成功信息如下
image.png
基本命令操作
注意绿色的连接信息(这里为你的租户信息)
obclient -h10.255.255.254 -P2881 -uSYS@RMT
租户信息默认是没有密码,如需增加密码
ALTER USER "SYS" IDENTIFIED BY "Aa123123";
查看数据库兼容模式
SHOW VARIABLES LIKE 'ob_compatibility_mode'
查看所有租户模式
SELECT TENANT_NAME, COMPATIBILITY_MODE FROM DBA_OB_TENANTS;
查看集群
obd cluster list
重启机器
obd cluster restart 机器名
修改使用租户直连 RMT为租户名
ALTER TENANT RMT SET VARIABLES ob_tcp_invited_nodes='%';
注意点
-
open_files 参数配置,ubuntu 根据网上一些信息,还有安装提供进行设置参数,好像不生效,只能使用临时,当前Session有效
查看 ulimit -a 临时修改 openfile参数 ulimit -n 200000
编辑 ~/.bashrc 或 ~/.profile 通过用户配置文件手动配置
echo "ulimit -n 65535" | sudo tee -a ~/.bashrc
- 还有如果是自己创建租户,需要自己设置资源单元、资源池、以及为租户进行关联
其他
1.查看部署集群 状态 running 启动
obd cluster list
2.重新直连 需要重启oceanbase
obd cluster 机器名
3.直连 默认root
--系统
obclient -h172.18.65.62 -uroot@sys -P2881 -p -Doceanbase
obclient -h192.168.105.203 -uroot@sys -P2881 -p -Doceanbase
--租户
obclient -h10.255.255.254 -P2883 -uSYS@RMT -p'Aa123123' -A
--修改连接使用租户登录
ALTER TENANT RMT SET VARIABLES ob_tcp_invited_nodes='%';
obclient -h172.18.65.62 -P2881 -usys@RMT#cluster -A