分为两部分
一安装oceanbase服务
准备工作
mkdir -p /data/1 /data/log1
chown -R admin.admin /data/1 /data/log1/
偷偷说:其实这步我忘记执行,也没影响我安装
oceanbase程序是很占内存的在安装时我们要先下载好安装包:
然后放在能记住的位置
安装包怎么下载地址:https://www.oceanbase.com/softwarecenter
版本没什么好说的 选择适合自己的就行 4.0及以后的安装更为方便
选择你喜欢的方式解压
tar -zxvf {你的压缩包路径}
解压好就会有一个 oceanbase-all-in-one进去后有个bin目录,里面有准备好的install.sh脚本
然后 运行它
./install.sh
注意路径
出现上图就说明成功了
然后找一个能记住的地址写进去一个config文件
这个文件内容可以复制官网的
也可以复制我的
我把我的配置分享在下面
## Only need to configure when remote login is required
#user:
# username: root
# password: oceanbase
# 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:
# 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: /yuyou/oceanbase/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: 6G # The maximum running memory for an observer
system_memory: 1G # The reserved system memory. system_memory is reserved for general tenants. The default value is 30G.
datafile_size: 8G # Size of the data file.
log_disk_size: 4G # The size of disk space used by the clog files.
cpu_count: 16
production_mode: false
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.
# observer cluster name, consistent with obproxy's cluster_name
appname: obcluster
# root_password: oceanbase
# proxyro_password: # proxyro user pasword, consistent with obproxy's observer_sys_password, can be empty
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-ce
servers:
- 127.0.0.1
global:
listen_port: 2883 # External port. The default value is 2883.
prometheus_listen_port: 2884 # The Prometheus port. The default value is 2884.
home_path: /yuyou/oceanbase/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
enable_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: obcluster
skip_proxy_sys_private_check: true
enable_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.
# observer_sys_password: # 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.
前期安装比较重要的参数就是
datafile_size: 8G # Size of the data file.
log_disk_size: 4G # The size of disk space used by the clog files.
这两个将决定你能不能安装成功
有个简单的运算方法
datafile_size + log_disk_size + 4 < 你系统剩余空间
可以使用
df -h
查看你自己的系统空间 系统空间时分区的 如:
看看你的区还有没有足够的空间
然后就可命令进行部署一个集群
obd cluster deploy obytt100 -c obytt100.yaml
如果不提醒你 系统空间不足 那就能安装成功
这就是安装成功的样子(obytt100 running)
然后可以进去看一下
obclient -h127.1 -P 2883 -uroot@sys#obytt100 -e "show databases"
第一次进会让你输入密码,这里直接回车就行了
第一部分安装就结束了
第二部分就是链接本地的navicat
第一次连的时候会提醒你密码错误,之前咱们已经在命令行进入oceanbase数据库了,先别退出
查看服务器里的初始数据库都是有什么
show databases;
进入mysql数据库,user表就在mysql数据库里
use mysql;
修改root的密码
ALTER USER root IDENTIFIED BY 'oceanbase';
直接修改就行了 然后再用navicat连上 完事。