This topic describes how to upgrade OCP by using the graphical interface of obd.
Prerequisites
Before you start, make sure that the current OCP version to be upgraded is V4.0.3 or later.
Considerations
When you upgrade OCP deployed in a Docker container, you must take note of the following:
Make sure that all OCP containers are in a normal state. If there are multiple OCP containers, keep only one container running and stop the others.
A started OCP container should have the
ocp-all-in-onefield in its name. If it does not, rename the container.If OCP was originally deployed on multiple nodes using Docker, you need to expand OCP after the upgrade. For details, see Step 3: Scale out OCP.
Procedure
Note
OBLOADER supports upgrading OCP Enterprise Edition and OCP Community Edition. This topic describes how to upgrade OCP Community Edition.
Step 1: Download the installation package
Note
If the OCP to be upgraded is deployed as a Docker container, you need to download and install the ocp-all-in-one package into the running OCP container.
Download the installation package
Go to OceanBase Download Center, search for OceanBase Cloud Platform, download the required installation package based on your actual situation, and upload the installation package to any directory on the OBDA control machine.
If you cannot obtain the required version of the installation package from the download center, contact technical support for assistance.
Decompress the installation package
In the directory where the installation package is located, execute the following command to decompress it:
[admin@test001 ~]$ tar -xzf ocp-all-in-one-*.tar.gz(Optional) Uninstall the original obd
If the obd is installed using the All in One package, you can execute the following command to uninstall the current obd.
[admin@test001 ~]$ cd ocp-all-in-one/bin && bash uninstall.shStart the installation program
In the
bindirectory of the ocp-all-in-one installation directory, execute theinstall.shscript to start the obd installation program.[admin@test001 bin]$ bash install.shThis script installs obd and copies all installation packages in the
rpmsdirectory of the installation directory to the local image library of obd, while closing the remote image library. After the execution is successful, the following output will be displayed. You can copy and execute thesource ~/.oceanbase-all-in-one/bin/env.shcommand in the output to apply the environment configuration.add auto set env logic to profile: /home/admin/.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 =========================================================================================
Step 2: Upgrade the OCP cluster
Start the upgrade
[admin@test001 ~]$ obd web upgradeThe output appears as follows. Access the IP address from the output in a browser to go to the Upgrade Wizard page, and then click Start Upgrade.
start OBD WEB in 0.0.0.0:8680 please open http://10.10.10.1:8680/#/updateWelcomeNote
The default port of the Web UI is 8680. Run the
obd web upgrade -p <PORT>command to specify the port of the Web UI, where the value ofPORTis in the range of [1025, 65535].In an Alibaba Cloud or other cloud environment, the system may output an intranet IP address if the public IP address cannot be obtained. You need to use the correct public IP address to access the web interface.
The
obd webcommand is bound to 0.0.0.0, which allows access to the GUI interface from any accessible IP address in a multi-adapter deployment.
Select the product to upgrade.
Select the OceanBase Cloud Platform module on the displayed Welcome to OceanBase Upgrade Wizard page and click Upgrade. This way, you can start to upgrade OCP.
Deployment Configuration
On the deployment configuration page, select the OCP cluster to be upgraded and the target version. The system automatically retrieves all cluster names managed by the OBDS service. From the Deployment Name drop-down list, select the cluster you want to upgrade. If the cluster to be upgraded is not currently managed by the OBDS service, for example, a Docker-deployed cluster, you can customize the cluster name. After the cluster is upgraded, the OBDS service will automatically take over the OCP cluster.
After the settings are complete, click Next to go to the Connectivity Test page.
Validate connectivity with MetaDB
When you upgrade an OCP cluster deployed by using Docker, you need to manually specify MetaDB parameters. If the OCP cluster to be upgraded is managed by obd, the system automatically retrieves MetaDB parameters. Verify whether the information in Connection Information is consistent with the expected parameters of the destination environment. After verifying that the MetaDB connection information is correct, enter Access Password and click Verify. The system verifies whether MetaDB can be connected.
Configure the operating system user
After you verify the MetaDB connectivity, you need to specify an operating system user for automated configuration.
ParameterDescriptionUser Name The user that is provided must have sudo privileges for the host operating system to allow the installation process to perform automated configuration. SSH port The default port is 22, but you can use a custom port number. Password Enter the password of Username. You can skip this option if no password is required for the host. After you configure this option, click Verify to test the connectivity. After the configuration is completed, click Next to proceed to the Environment Pre-check page.
Configuration confirmation
OCP will obtain related configurations from the MetaDB configurations and update the platform management service (COP Server) and all host agent services (OCP Agent) managed by the platform management service to ensure the consistency of the management features.
Confirm whether the upgrade contents specified in the Installation and Configuration and Upgrade Configuration Information fields meet the expected requirements. You can click Previous to modify the upgrade contents if any issues are found. After the contents are verified, click Next to start the environment check before the upgrade.
Pre-check environment
If the checks pass, click Next to proceed with the upgrade of OCP. If any checks fail, the system allows you to either fix or ignore the failed items.
If you select Repair, after the fix is complete, click Recheck. The system will restart the pre-check process for the environment.
If you choose to ignore them, click Ignore All Failed Checks. All failed check items will be marked as Ignored, and you can click Next to start the OCP upgrade.
Note
Ignoring all failed checks could result in an upgrade failure. We recommend that you fix any failed checks before proceeding to the next step.
Upgrade OCP
During the O&M process of an OCP cluster, you can view detailed upgrade logs in the Upgrade Logs module.
If the OCP upgrade is successful, you can view the login information of OCP, including URL, username, and password, in the Upgrade Log.
If the OCP upgrade fails, check the log to find out the reason for the failure, and contact technical support. After the failure reasons are located and the issues are fixed, click Upgrade Again to re-execute the failed upgrade steps.
Notice
The OCP upgrade process may take some time. Please be patient.
(Optional) Step 3: Scale out OCP
Prepare the configuration file for scaling out OCP.
[admin@test001 ~]$ vim ocp-scale-out.yamlThe content of the file is as follows. The servers.name configuration cannot be repeated in the original OCP cluster:
ocp-server-ce: servers: - name: server2 ip: 10.10.10.2 - name: server3 ip: 10.10.10.3 server2: home_path: /home/admin/ocp soft_dir: /home/admin/ocp/software log_dir: /home/admin/ocp/logs port: 8080 memory_size: 8G server3: home_path: /home/admin/ocp soft_dir: /home/admin/ocp/software log_dir: /home/admin/ocp/logs port: 8080 memory_size: 8GExecute the scaling-out command.
[admin@test001 ~]$ obd cluster scale_out myocp -c ocp-scale-out.yamlIf the command is executed successfully, the output is as follows:
Open ssh connection ok Get local repositories and plugins ok Repository integrity check ok Parameter check ok Open ssh connection ok Connect to observer 10.10.10.1:2881 ok Initializes observer work home ok Initializes obproxy work home ok Initializes ocp-server-ce work home ok ...... #Omitted for brevity Check before start ocp-server-ce ok Start ocp-server-ce ok ocp-server-ce program health check ok Execute ` obd cluster display myocp ` to view the cluster status Trace ID: a1491fa6-991e-11f0-8809-00163e4692be If you want to view detailed obd logs, please run: obd display-trace a1491fa6-991e-11f0-8809-00163e4692beVerify the scaling-out result.
Copy and execute the display command in the output of the scaling-out command to view the OCP cluster information.
obd cluster display myocpThe output is as follows, which contains two new OCP nodes:
Get local repositories and plugins ok Open ssh connection ok Connect to ocp-server-ce ok +------------------------------------------------------------+ | ocp-server-ce | +---------------------------+----------+------------+--------+ | url | username | password | status | +---------------------------+----------+------------+--------+ | http://10.10.10.1:8080 | admin | '********' | active | | http://10.10.10.2:8080 | admin | '********' | active | | http://10.10.10.3:8080 | admin | '********' | active | +---------------------------+----------+------------+--------+ Connect to observer 10.10.10.1:2881 ok Wait for observer init ok +-------------------------------------------------+ | oceanbase-ce | +---------------+---------+------+-------+--------+ | ip | version | port | zone | status | +---------------+---------+------+-------+--------+ | 10.10.10.1 | 4.3.5.3 | 2881 | zone1 | ACTIVE | +---------------+---------+------+-------+--------+ obclient -h10.10.10.1 -P2881 -uroot@sys -p'********' -Doceanbase -A cluster unique id: 96617816-cfc9-5cd7-a43e-0c8327f32c23-1997aa9d887-04050304 Connect to obproxy ok +-------------------------------------------------------------------+ | obproxy-ce | +---------------+------+-----------------+-----------------+--------+ | ip | port | prometheus_port | rpc_listen_port | status | +---------------+------+-----------------+-----------------+--------+ | 10.10.10.1 | 2883 | 2884 | 2885 | active | +---------------+------+-----------------+-----------------+--------+ obclient -h10.10.10.1 -P2883 -uroot@proxysys -p'********' -Doceanbase -A obshell program health check ok display obshell dashboard ok +----------------------------------------------------------+ | obshell Dashboard | +---------------------------+------+--------------+--------+ | url | user | password | status | +---------------------------+------+--------------+--------+ | http://10.10.10.1:2886 | root | '********' | active | +---------------------------+------+--------------+--------+ Trace ID: c25da2e0-9921-11f0-afb0-00163e4692be If you want to view detailed obd logs, please run: obd display-trace c25da2e0-9921-11f0-afb0-00163e4692be
