This topic describes how to install OceanBase Database when the host is online or offline.
Prerequisites
Optional. The following software packages are obtained as instructed in Prepare for the installation. Note that you need only the
obdeploy-master.zipsoftware package for online installation.oceanbase-ce-libs-3.1.0-1.el7.x86_64.rpm
oceanbase-ce-3.1.0-1.el7.x86_64.rpm
obdeploy-master.zip
The sshpass utility is installed on the host in which you want to deploy OceanBase Cloud Platform (OCP) Community Edition. If the utility is not installed on the host, run
yum -y install sshpassas the root user to install the utility.
Procedure
Online installation
Obtain the *-example.yaml configuration file required for the deployment of OceanBase Database.
*-example.yaml files are a series of configuration files for the deployment of OceanBase Database. In this topic, single-node OceanBase Database is used as an example. To deploy single-node OceanBase Database, you must obtain the
mini-single-example.yamlconfiguration file by using one of the following methods:Method 1: Download the file.
Upload the
obdeploy-master.zipfile to the/root/directory as the root user, and run the following commands to decompress the file. Themini-single-example.yamlfile is decompressed to the/root/obdeploy-master/example/directory.yum -y install unzip unzip obdeploy-master.zipMethod 2: Create the file.
Run the following commands as the root user to create a file named
mini-single-example.yamlin the/root/obdeploy-master/example/directory.mkdir -p /root/obdeploy-master/example/ touch /root/obdeploy-master/example/mini-single-example.yamlCopy corresponding content in *-example.yaml to the new file.
Modify the mini-single-example.yaml file.
Run the
vi /root/obdeploy-master/example/mini-single-example.yamlcommand, and press i to enter the Insert mode, so as to modify the content of the file. Example:user: username: ****** password: ****** oceanbase-ce: servers: - xxx.xxx.xxx.xxx global: home_path: /home/admin/observer devname: bond0 mysql_port: 2881 rpc_port: 2882 zone: zone1 cluster_id: 1 memory_limit: 50G system_memory: 10G 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 schema_history_expire_time: 1d net_thread_count: 4 major_freeze_duty_time: Disable minor_freeze_times: 10 enable_separate_sys_clog: 0 enable_merge_by_turn: FALSE datafile_disk_percentage: 20 syslog_level: INFO enable_syslog_wf: false enable_syslog_recycle: true max_syslog_file_count: 4 root_password: ********Parameters in the file:
username: the user who installs OceanBase Database, which is admin as planned.
password: the password of the admin user.
servers: the IP address of the host in which you want to install OceanBase Database.
home_path: the installation directory of OceanBase Database. Make sure that the admin user has the read and write permissions on this directory.
data_dir: the data storage directory of OceanBase Database. Make sure that the admin user has the read and write permissions on this directory.
redo_dir: the clog directory of OceanBase Database. Make sure that the admin user has the read and write permissions on this directory.
devname: the network interface controller (NIC) used by OceanBase Database. The NIC must be mounted to the host.
memory_limit: the maximum memory that the OBServer can use.
system_memory: the size of memory assigned by the OBServer to the SYS tenant.
cpu_count: the number of CPU cores used by OceanBase Database.
root_password: the password of the root user of the SYS tenant, which is used to log on to OceanBase Database as the root@sys user.
Run the
:wqcommand to save the modification and exit.
Run the following command to deploy the OceanBase cluster named test:
obd cluster deploy test -c ./example/mini-single-example.yamlRun the following command to start the cluster:
obd cluster start testConnect to the OceanBase database from a client and check whether the database is installed.
If you use an OBClient, run the following command: obclient -h192.168.0.1 -uroot@sys -P2881
If you use a MySQL client, run the following command: mysql -h192.168.0.1 -uroot@sys -P2881
Offline installation
Run the following command as the root user to delete the remote repository:
rm -fr ~/.obd/mirror/remote/*.repoUpload the following software packages to any directory as the root user:
oceanbase-ce-libs-3.1.0-1.el7.x86_64.rpm
oceanbase-ce-3.1.0-1.el7.x86_64.rpm
Run the following command to load the uploaded software packages to the local image:
obd mirror clone *.rpm