remove some docker environments
This commit is contained in:
@ -12,8 +12,6 @@ RUN mkdir /root/pkg && \
|
|||||||
cd /root/pkg && \
|
cd /root/pkg && \
|
||||||
yum install --downloadonly --downloaddir=. oceanbase-ce-${VERSION}.el7 oceanbase-ce-libs-${VERSION}.el7 obagent && \
|
yum install --downloadonly --downloaddir=. oceanbase-ce-${VERSION}.el7 oceanbase-ce-libs-${VERSION}.el7 obagent && \
|
||||||
rm -rf /usr/obd/mirror/remote/* && \
|
rm -rf /usr/obd/mirror/remote/* && \
|
||||||
obd mirror clone /root/pkg/*.rpm && obd mirror list local && \
|
|
||||||
rm -rf /root/pkg/* && \
|
|
||||||
yum clean all
|
yum clean all
|
||||||
|
|
||||||
COPY boot /root/boot/
|
COPY boot /root/boot/
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
# 如何使用Docker部署OceanBase
|
# 如何使用Docker部署OceanBase
|
||||||
|
|
||||||
OceanBase 提供了一个独立部署的测试镜像[oceanbase-ce](https://hub.docker.com/r/oceanbase/oceanbase-ce)。默认情况下,这个镜像会在当前容器环境中部署一个占用最大资源的数据库实例。不过可以使用环境变量MINI_MODE来部署一个mini模式的数据库实例。
|
OceanBase 提供了一个独立部署的测试镜像[oceanbase-ce](https://hub.docker.com/r/oceanbase/oceanbase-ce)。默认情况下,这个镜像会部署一个MINI_MODE OceanBase 实例。
|
||||||
|
|
||||||
**注意**
|
**注意**
|
||||||
|
|
||||||
@ -18,7 +18,7 @@ OceanBase 提供了一个独立部署的测试镜像[oceanbase-ce](https://hub.d
|
|||||||
|
|
||||||
在部署 oceanbase-ce 镜像之前,您需要确认以下信息:
|
在部署 oceanbase-ce 镜像之前,您需要确认以下信息:
|
||||||
|
|
||||||
- 确保您的机器至少提供 2 核 10GB 以上的资源。
|
- 确保您的机器至少提供 2 核 8GB 以上的资源。
|
||||||
- 您的机器已经安装以下程序:
|
- 您的机器已经安装以下程序:
|
||||||
|
|
||||||
应用程序 | 推荐版本 | 参考文档
|
应用程序 | 推荐版本 | 参考文档
|
||||||
@ -31,11 +31,11 @@ OceanBase 提供了一个独立部署的测试镜像[oceanbase-ce](https://hub.d
|
|||||||
运行以下命令,启动 OceanBase 的实例:
|
运行以下命令,启动 OceanBase 的实例:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# 根据当前容器情况部署最大规格的实例
|
# 部署最小规格实例
|
||||||
docker run -p 2881:2881 --name oceanbase-ce -d oceanbase/oceanbase-ce
|
docker run -p 2881:2881 --name oceanbase-ce -d oceanbase/oceanbase-ce
|
||||||
|
|
||||||
# 部署最小规格实例
|
# 根据当前容器情况部署最大规格的实例
|
||||||
docker run -p 2881:2881 --name oceanbase-ce -e MINI_MODE=1 -d oceanbase/oceanbase-ce
|
docker run -p 2881:2881 --name oceanbase-ce -e MINI_MODE=0 -d oceanbase/oceanbase-ce
|
||||||
```
|
```
|
||||||
|
|
||||||
启动预计需要 2-5 分钟。执行以下命令,如果返回 `boot success!`,则启动成功。
|
启动预计需要 2-5 分钟。执行以下命令,如果返回 `boot success!`,则启动成功。
|
||||||
@ -45,6 +45,8 @@ $ docker logs oceanbase-ce | tail -1
|
|||||||
boot success!
|
boot success!
|
||||||
```
|
```
|
||||||
|
|
||||||
|
启动成功后,容器中会启动一个oceanbase进程实例,可以使用root用户进行连接,不需要使用密码。
|
||||||
|
|
||||||
**注意:** 如果observer进程出现异常退出,容器不会自动退出。
|
**注意:** 如果observer进程出现异常退出,容器不会自动退出。
|
||||||
|
|
||||||
## 连接 OceanBase 实例
|
## 连接 OceanBase 实例
|
||||||
|
|||||||
@ -45,6 +45,8 @@ $ docker logs oceanbase-ce | tail -1
|
|||||||
boot success!
|
boot success!
|
||||||
```
|
```
|
||||||
|
|
||||||
|
After started, there is an oceanbase instance. You can connect to the oceanbase by root user without password.
|
||||||
|
|
||||||
## Connect to an OceanBase instance
|
## Connect to an OceanBase instance
|
||||||
|
|
||||||
oceanbase-ce image contains obclient (OceanBase Database client) and the default connection script `ob-mysql`.
|
oceanbase-ce image contains obclient (OceanBase Database client) and the default connection script `ob-mysql`.
|
||||||
|
|||||||
@ -39,9 +39,12 @@ function exit_while_error() {
|
|||||||
function remove_disk_check_logic_in_obd() {
|
function remove_disk_check_logic_in_obd() {
|
||||||
# make sure obd copy the plugin code
|
# make sure obd copy the plugin code
|
||||||
obd cluster list
|
obd cluster list
|
||||||
start_check_file='/root/.obd/plugins/oceanbase/3.1.0/start_check.py'
|
start_check_files=('/root/.obd/plugins/oceanbase/3.1.0/start_check.py' '/root/.obd/plugins/oceanbase/4.0.0.0/start_check.py')
|
||||||
sed -i "s/critical('(%s) %s not enough disk space\. (Avail/alert('(%s) %s not enough disk space\. (Avail/g" $start_check_file
|
for start_check_file in ${start_check_files[@]}
|
||||||
sed -i "s/critical(EC_OBSERVER_NOT_ENOUGH_DISK_4_CLOG/alert(EC_OBSERVER_NOT_ENOUGH_DISK_4_CLOG/g" $start_check_file
|
do
|
||||||
|
sed -i "s/critical('(%s) %s not enough disk space\. (Avail/alert('(%s) %s not enough disk space\. (Avail/g" $start_check_file
|
||||||
|
sed -i "s/critical(EC_OBSERVER_NOT_ENOUGH_DISK_4_CLOG/alert(EC_OBSERVER_NOT_ENOUGH_DISK_4_CLOG/g" $start_check_file
|
||||||
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
# We should decide whether the observer's data exists and
|
# We should decide whether the observer's data exists and
|
||||||
@ -70,18 +73,19 @@ else # nothing here, bootstrap
|
|||||||
sed -i "s|@OB_HOME_PATH@|${OB_HOME_PATH}|g" $TMPFILE
|
sed -i "s|@OB_HOME_PATH@|${OB_HOME_PATH}|g" $TMPFILE
|
||||||
sed -i "s|@OB_MYSQL_PORT@|${OB_MYSQL_PORT}|g" $TMPFILE
|
sed -i "s|@OB_MYSQL_PORT@|${OB_MYSQL_PORT}|g" $TMPFILE
|
||||||
sed -i "s|@OB_RPC_PORT@|${OB_RPC_PORT}|g" $TMPFILE
|
sed -i "s|@OB_RPC_PORT@|${OB_RPC_PORT}|g" $TMPFILE
|
||||||
sed -i "s|@OB_ROOT_PASSWORD@|${OB_ROOT_PASSWORD}|g" $TMPFILE
|
sed -i "s|@OB_CLUSTER_NAME@|${OB_CLUSTER_NAME}|g" $TMPFILE
|
||||||
|
|
||||||
[ "${OB_DATA_DIR}" ] && echo " data_dir: ${OB_DATA_DIR}" >> $TMPFILE
|
[ "${OB_DATA_DIR}" ] && echo " data_dir: ${OB_DATA_DIR}" >> $TMPFILE
|
||||||
[ "${OB_REDO_DIR}" ] && echo " redo_dir: ${OB_REDO_DIR}" >> $TMPFILE
|
[ "${OB_REDO_DIR}" ] && echo " redo_dir: ${OB_REDO_DIR}" >> $TMPFILE
|
||||||
echo "create boot dirs and deploy ob cluster ..."
|
echo "create boot dirs and deploy ob cluster ..."
|
||||||
mkdir -p $OB_HOME_PATH
|
mkdir -p $OB_HOME_PATH
|
||||||
|
|
||||||
#obd mirror clone /root/pkg/*.rpm \
|
obd mirror clone /root/pkg/*.rpm \
|
||||||
#&& obd mirror list local
|
&& obd mirror list local
|
||||||
|
|
||||||
remove_disk_check_logic_in_obd
|
remove_disk_check_logic_in_obd
|
||||||
obd cluster autodeploy "${OB_CLUSTER_NAME}" -c $TMPFILE \
|
obd devmode enable \
|
||||||
|
&& obd cluster autodeploy "${OB_CLUSTER_NAME}" -c $TMPFILE \
|
||||||
&& obd cluster tenant create "${OB_CLUSTER_NAME}" -n ${OB_TENANT_NAME} \
|
&& obd cluster tenant create "${OB_CLUSTER_NAME}" -n ${OB_TENANT_NAME} \
|
||||||
&& obclient -h127.1 -uroot@${OB_TENANT_NAME} -A -P${OB_MYSQL_PORT} < init_tenant_user.sql \
|
&& obclient -h127.1 -uroot@${OB_TENANT_NAME} -A -P${OB_MYSQL_PORT} < init_tenant_user.sql \
|
||||||
&& mv -f $TMPFILE ${OB_HOME_PATH}/boot.yaml \
|
&& mv -f $TMPFILE ${OB_HOME_PATH}/boot.yaml \
|
||||||
@ -99,5 +103,5 @@ else
|
|||||||
echo "Please check the log file ${OB_HOME_PATH}/log/observer.log"
|
echo "Please check the log file ${OB_HOME_PATH}/log/observer.log"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
exec /sbin/init
|
exec tail -f /dev/null
|
||||||
|
|
||||||
|
|||||||
@ -1,8 +1,7 @@
|
|||||||
MINI_MODE=${MINI_MODE:-false}
|
MINI_MODE=${MINI_MODE:-true}
|
||||||
EXIT_WHILE_ERROR=${EXIT_WHILE_ERROR:-true}
|
EXIT_WHILE_ERROR=${EXIT_WHILE_ERROR:-true}
|
||||||
OB_HOME_PATH=${OB_HOME_PATH:-"/root/ob"}
|
OB_HOME_PATH="/root/ob"
|
||||||
OB_MYSQL_PORT=${OB_MYSQL_PORT:-"2881"}
|
OB_MYSQL_PORT="2881"
|
||||||
OB_RPC_PORT=${OB_RPC_PORT:-"2882"}
|
OB_RPC_PORT="2882"
|
||||||
OB_ROOT_PASSWORD=${OB_ROOT_PASSWORD:-""}
|
OB_CLUSTER_NAME="obcluster"
|
||||||
OB_CLUSTER_NAME=${OB_CLUSTER_NAME:-"obcluster"}
|
OB_TENANT_NAME="test"
|
||||||
OB_TENANT_NAME=${OB_TENANT_NAME:-"test"}
|
|
||||||
|
|||||||
@ -1,43 +1,24 @@
|
|||||||
oceanbase-ce:
|
oceanbase-ce:
|
||||||
servers:
|
servers:
|
||||||
|
# Please don't use hostname, only IP can be supported
|
||||||
- 127.0.0.1
|
- 127.0.0.1
|
||||||
global:
|
global:
|
||||||
home_path: @OB_HOME_PATH@ # default: /root/ob
|
# The working directory for OceanBase Database. OceanBase Database is started under this directory. This is a required field.
|
||||||
|
home_path: @OB_HOME_PATH@
|
||||||
devname: lo
|
devname: lo
|
||||||
mysql_port: @OB_MYSQL_PORT@ # default: 2881
|
mysql_port: @OB_MYSQL_PORT@
|
||||||
rpc_port: @OB_RPC_PORT@ # default: 2882
|
rpc_port: @OB_RPC_PORT@
|
||||||
zone: zone1
|
zone: zone1
|
||||||
cluster_id: 1
|
cluster_id: 1
|
||||||
memory_limit: 6G
|
# please set memory limit to a suitable value which is matching resource.
|
||||||
system_memory: 3G
|
memory_limit: 6G # The maximum running memory for an observer
|
||||||
stack_size: 512K
|
system_memory: 1G # The reserved system memory. system_memory is reserved for general tenants. The default value is 30G.
|
||||||
|
datafile_size: 5G # Size of the data file.
|
||||||
|
log_disk_size: 5G # The size of disk space used by the clog files.
|
||||||
cpu_count: 16
|
cpu_count: 16
|
||||||
cache_wash_threshold: 1G
|
production_mode: true
|
||||||
__min_full_resource_pool_memory: 268435456
|
syslog_level: INFO # System log level. The default value is INFO.
|
||||||
workers_per_cpu_quota: 10
|
enable_syslog_wf: false # Print system logs whose levels are higher than WARNING to a separate log file. The default value is true.
|
||||||
schema_history_expire_time: 1d
|
enable_syslog_recycle: true # Enable auto system log recycling or not. The default value is false.
|
||||||
net_thread_count: 4
|
max_syslog_file_count: 4 # The maximum number of reserved log files before enabling auto recycling. The default value is 0.
|
||||||
sys_bkgd_migration_retry_num: 3
|
appname: @OB_CLUSTER_NAME@
|
||||||
minor_freeze_times: 100
|
|
||||||
enable_separate_sys_clog: 0
|
|
||||||
enable_auto_leader_switch: FALSE
|
|
||||||
enable_one_phase_commit: FALSE
|
|
||||||
weak_read_version_refresh_interval: 5s
|
|
||||||
trace_log_slow_query_watermark: 1s
|
|
||||||
large_query_threshold: 1s
|
|
||||||
clog_sync_time_warn_threshold: 1s
|
|
||||||
syslog_io_bandwidth_limit: 10M
|
|
||||||
enable_sql_audit: FALSE
|
|
||||||
enable_perf_event: FALSE
|
|
||||||
clog_max_unconfirmed_log_count: 5000
|
|
||||||
autoinc_cache_refresh_interval: 86400s
|
|
||||||
cpu_quota_concurrency: 2
|
|
||||||
datafile_size: 5G
|
|
||||||
syslog_level: WARN
|
|
||||||
enable_syslog_recycle: TRUE
|
|
||||||
max_syslog_file_count: 2
|
|
||||||
enable_early_lock_release: false tenant=all
|
|
||||||
default_compress_func: lz4_1.0
|
|
||||||
root_password: @OB_ROOT_PASSWORD@
|
|
||||||
clog_disk_utilization_threshold: 95
|
|
||||||
clog_disk_usage_limit_percentage: 98
|
|
||||||
|
|||||||
@ -2,10 +2,10 @@ oceanbase-ce:
|
|||||||
servers:
|
servers:
|
||||||
- 127.0.0.1
|
- 127.0.0.1
|
||||||
global:
|
global:
|
||||||
home_path: @OB_HOME_PATH@ # default: /root/ob
|
home_path: @OB_HOME_PATH@
|
||||||
devname: lo
|
devname: lo
|
||||||
mysql_port: @OB_MYSQL_PORT@ # default: 2881
|
mysql_port: @OB_MYSQL_PORT@
|
||||||
rpc_port: @OB_RPC_PORT@ # default: 2882
|
rpc_port: @OB_RPC_PORT@
|
||||||
root_password: @OB_ROOT_PASSWORD@ # default: null
|
datafile_size: 20G
|
||||||
datafile_size: 10G
|
log_disk_size: 20G
|
||||||
clog_disk_usage_limit_percentage: 98 # default: 80
|
appname: @OB_CLUSTER_NAME@
|
||||||
|
|||||||
@ -3,15 +3,10 @@ CWD=$(cd `dirname $0`;pwd)
|
|||||||
cd "${CWD}"
|
cd "${CWD}"
|
||||||
source _env
|
source _env
|
||||||
|
|
||||||
PASSCMD=""
|
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
sys)
|
sys)
|
||||||
LOGIN_USER="root@sys"
|
LOGIN_USER="root@sys"
|
||||||
DB="oceanbase"
|
DB="oceanbase"
|
||||||
if [[ "${OB_ROOT_PASSWORD}x" != "x" ]]; then
|
|
||||||
PASSCMD=-p${OB_ROOT_PASSWORD}
|
|
||||||
fi
|
|
||||||
;;
|
;;
|
||||||
root)
|
root)
|
||||||
DB="oceanbase"
|
DB="oceanbase"
|
||||||
|
|||||||
@ -48,7 +48,7 @@ obagent:
|
|||||||
# The RPC port for observer. The default value is 2882. When a depends exists, OBD gets this value from the oceanbase-ce of the depends. The value is the same as the rpc_port in oceanbase-ce.
|
# The RPC port for observer. The default value is 2882. When a depends exists, OBD gets this value from the oceanbase-ce of the depends. The value is the same as the rpc_port in oceanbase-ce.
|
||||||
# rpc_port: 2882
|
# rpc_port: 2882
|
||||||
# Cluster name for OceanBase Database. When a depends exists, OBD gets this value from the oceanbase-ce of the depends. The value is the same as the appname in oceanbase-ce.
|
# Cluster name for OceanBase Database. When a depends exists, OBD gets this value from the oceanbase-ce of the depends. The value is the same as the appname in oceanbase-ce.
|
||||||
# cluster_name: obcluster
|
cluster_name: @OB_CLUSTER_NAME@
|
||||||
# Cluster ID for OceanBase Database. When a depends exists, OBD gets this value from the oceanbase-ce of the depends. The value is the same as the cluster_id in oceanbase-ce.
|
# Cluster ID for OceanBase Database. When a depends exists, OBD gets this value from the oceanbase-ce of the depends. The value is the same as the cluster_id in oceanbase-ce.
|
||||||
# cluster_id: 1
|
# cluster_id: 1
|
||||||
# Zone name for your observer. The default value is zone1. When a depends exists, OBD gets this value from the oceanbase-ce of the depends. The value is the same as the zone name in oceanbase-ce.
|
# Zone name for your observer. The default value is zone1. When a depends exists, OBD gets this value from the oceanbase-ce of the depends. The value is the same as the zone name in oceanbase-ce.
|
||||||
|
|||||||
Reference in New Issue
Block a user