After you initialize the MetaDB of OceanBase Developer Center (ODC), you need to obtain and run the ODC image on each node to install ODC.
Load the image
To obtain the ODC image on the host, select the required image from the following list and click Download .
After you obtain the image, run the following statement in the command-line tool to load it.
gunzip -c obodc-{$version}.tar.gz | docker load
Run the image
Run the following sample statements of the image in the command line tool.
#!/usr/bin/env bash
docker run -d -i -p 8989:8989 --cpu-period 100000 --cpu-quota 400000 --memory 8G --name "obodc"
-e "DATABASE_HOST=100.00.00.00"
-e "DATABASE_PORT=60805"
-e "DATABASE_USERNAME=db_user@tenant_name#cluster_name"
-e "DATABASE_PASSWORD=******"
-e "DATABASE_NAME=odc_metadb"
-e "ODC_PROFILE_MODE=alipay"
reg.docker.alibaba-inc.com/oceanbase/odc-server:{image_tag}
You can run the docker images statement to view {image_tag} on the host after you load the image. The following table describes other parameters.
| Parameter | Description |
|---|---|
| -p | Specifies the port mapping in the format of host port:container port. The port mapping in the example statement is 8989:8989. You can change the host port as needed. The container port is 8989 by default. |
| --cpu-period --cpu-quota | ---cpu-period specifies the interval of reallocating CPU resources to a container, in milliseconds. ---cpu-quota specifies the time to run the current container in the specified period, in milliseconds. You can use these two parameters in combination to specify the number of CPU cores to allocate to a container. The value of cpu-quota/cpu-period indicates the number of CPU cores that can be used by a Docker container. In the preceding example, the value of 400000/100000 indicates that the container can use at most 4 CPU cores. |
| --memory | Specifies the maximum memory size for the container. |
| --name | Specifies the name of the container. |
| DATABASE_HOST | Specifies the IP address of the MetaDB. |
| DATABASE_PORT | Specifies the port number of the MetaDB. |
| DATABASE_USERNAME | Specifies the username of the MetaDB. In OceanBase Database, the username is given in the db_user@tenant_name#cluster_name format. |
| DATABASE_PASSWORD | Specifies the username for connecting to the database. |
| DATABASE_NAME | Specifies the name of the MetaDB. |
| ODC_PROFILE_MODE | Specifies the mode, which is alipay by default. |
In addition to the preceding parameters, you can also use the following parameters when running the image:
| Parameter | Description |
|---|---|
| ODC_LOG_DIR | Specifies the log directory, which is /opt/odc/log by default. |
| OBCLIENT_WORK_DIR | Specifies the working directory of OBClient, which is /opt/odc/data by default. |
| ODC_JAR_FILE | Specifies the directory of JAR files, which is /opt/odc/lib/odc-web-starter-*.jar by default. |
| ODC_WORK_DIR | Specifies the working directory of ODC, which is /opt/odc/script by default. |
| ODC_JVM_HEAP_OPTIONS | Specifies the JVM stack memory. The default maximum value of the parameter -Xmx is 60% of available physical memory size. The startup script of ODC checks whether the available memory in the current environment reaches 2048 MB. To start ODC, the host or Docker container must have at least 3.4 GB of memory based on the 60% threshold of available memory. If the memory of the host or Docker container is less than 3.4 GB, you can specify the ODC_JVM_HEAP_OPTIONS parameter to bypass the available memory checking. For example, you can set the parameter to "-Xmx2048m -Xms2048m". |
| ODC_JVM_GC_OPTIONS | Specifies the garbage collection policy for JVM. Default policy: -XX:+UseG1GC -XX:+PrintAdaptiveSizePolicy -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCDateStamps -Xloggc:/opt/odc/log/gc.log -XX:+UseGCLogFileRotation -XX:GCLogFileSize=50M -XX:NumberOfGCLogFiles=5. |
| ODC_JVM_OOM_OPTIONS | Specifies the OutOfMemory policy for JVM, which is -XX:+ExitOnOutOfMemoryError by default. |
| ODC_JVM_EXTRA_OPTIONS | Specifies other JVM configuration parameters, which are null by default. |
| ODC_SERVER_PORT | Specifies the HTTP listening port for ODC Server, which is 8989 by default. |