TcaplusDB Container Environment Deployment

1. Version Introduction

TcaplusDB Local (Container Version) is a version made available to users for local development and debugging (downloadable version based on Docker deployment). Compared with the Tencent Cloud TcaplusDB version, the local version can facilitate users to debug code in the development environment that cannot connect to the cloud environment, and has no difference in functions from the Tencent Cloud version. This file mainly describes how to deploy the TcaplusDB local Docker environment in the local development environment.

If you encounter problems during deployment, you can consult the FAQ list first. If there is no solution in the list, you can contact the TcaplusDB team to help solve problems.

2. Compatibility Description

It has been tested for compatibility in the following environments. It is recommended to deploy the local version of TcaplusDB in an environment that has been tested for compatibility.

Environments that have completed compatibility test
Windows10 + WSL2 (CentOS 7)
MAC + Parallels + Debian
CentOS 7
TLinux1.2/TLinux2.2

TcaplusDB Local version is required to run in the Linux environment as a Docker container. If the system is Windows or MAC, run the Linux virtual machine or WSL (Windows) on these systems first, and then run the Docker container in the virtual machine.

When deploying the TcaplusDB Local version in an environment without compatibility test, some unknown compatibility problems may occur.

3. Performance Description

Host specification Support QPS
4-core 8 G memory 2000
8-core 16 G memory 4000
>= 16-core 32 G memory 8000

Description:

  1. Since the number of tables is related to the number of shards in tcapsvr, a maximum of 512 tables can be created when only one group of machines is installed by default.

  2. Supported QPS are test values based on default table engine parameters bnum=7500000#xmsiz=12000000#xikmsiz=3000000#kmapow=6#kfapow=6#vmapow=6#vfapow=6#lnum=2, 1 kb data read and write, and 10 GB data scale, rather than the upper limit.

4. Environment Requirements

  • The deployment machine should have at least 4 cores of CPU, at least 8 G of total memory, and at least 6 G of free memory before starting the TcaplusDB Local container.

  • The recommended disk space for the deployment machine is 100 GB, and the available disk space for storing the Docker container should be greater than 50 GB.

  • Docker needs to be installed in advance to deploy the machine. See Appendix 1 for the installation method.

  • The user who creates a Docker container must have permission to execute docker commands through sudo.

  • The deployment machine should have SELinux turned off.

  • If the deployment machine is Windows+WSL2, vsyscall should be set correctly. See Appendix 3 for the setting method.

  • If the deployment machine is Debian (or Debian virtual machine), vsyscall should be set correctly. See Appendix 4 for the setting method.

5. Version Download

See Docker Image Download.

6. Version Deployment

6.1. Version Deployment in Linux Environment

6.1.1. Check and prepare the deployment environment

Download the environment scan script.

wget https://tcaplus-tools-1301716906.cos.ap-guangzhou.myqcloud.com/tcaplus_tools.sh

Run the environment scan script to scan for environment resources and check whether the TcaplusDB Local version meets the minimum operating requirements.

sh tcaplus_tools.sh check_environment

Example of environment scan results:

Environment Information: 
    OS                        : Tencent tlinux release 2.2 (Final)
    CPU Arch                  : x86_64
    CPU Cores                 : 8
    Memory Total (MB)         : 15787
    Memory Free (MB)          : 1025
    Memory Cached (MB)        : 4542
    Disk Free (MB)            : 15787
    Docker Version            : Docker version 18.09.7, build 2d0083d
    LDD Version               : ldd (GNU libc) 2.17
    GCC Version               : gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-4)
    G++ Version               : g++ (GCC) 4.8.5 20150623 (Red Hat 4.8.5-4)
    Go Lang Version           : Not found
    Java Version              : Not found
    Python Version            : Python 2.7.5
    SELinux Setting           : Disabled

Reference values of indicators in the environment scan results:

Indicator Reference value
OS See Version Compatibility descriptions
CPU Arch x86_64
CPU Cores >= 4
Memory Total (MB) >= 8192 (8G)
Memory Free (MB) >= 6144 (6G)
Disk Free (MB) >= 51200 (50G)
Docker Version It is suggested >= Docker 1.13.1 or >= Docker CE 18.09.7.
See Appendix 1 for the installation method.
SELinux Settings Disabled
For details about how to disable the function, see Appendix 2

Some processes of TcaplusDB rely on mdadm, which needs to be manually installed if it is not installed by default on the deployment machine.

#centos
yum install -y mdadm
#debian
apt-get update
apt-get install -y mdadm

6.1.2. Check whether Docker is started

Log in to the deployment machine.

Check whether the Docker service is installed and started normally. See Appendix 1 for the installation method of Docker.

# Check the Docker service status and check whether the service has been started
sudo service docker status

# Start the Docker service command
sudo service docker start

6.1.3. Import Local image

Import the TcaplusDB Local image to the local Docker image library.

sudo docker load -i tcaplusdb-local-3.55.1.tar.gz

View the local Docker image library to check whether the image is successfully imported.

sudo docker images

If the image information is displayed in the local Docker image library, the Docker image is imported successfully.

REPOSITORY                                               TAG                 IMAGE ID            CREATED             SIZE
tcaplusdb-local                                          3.55.1              bb42e8ecff11        3 days ago          8.43GB

6.1.4. Create a Local container

Example of container creation command:

sudo docker run -itd --memory=8g --storage-opt size=50G --shm-size=2G --privileged -e TCAPLUS_CONTAINER_PUBLIC_IP="x.x.x.x" -e TCAPLUS_CONTAINER_OMS_PASSWORD='***' -p 80:80 -p 9999:9999 -p 13755-13765:13755-13765 --name test tcaplusdb-local:3.55.1

Description of container startup parameters:

Parameter Description
--shm-size=2G [Optional] Specify the shared memory size of the container, with a minimum requirement of 2 G. When the shared memory is not specified or it is detected that the shared memory is less than 2G when the container is started, it will be forced to be set to the minimum value of 2 G.
--privileged [Required] Specify to start the container in privileged mode. The startup of TcaplusDB Local involves the modification of some system parameters. If the container is not started in privileged mode, the startup will fail.
--name test [Required] Specify the container name. The name can be used as a parameter for viewing container logs and starting or stopping the container.
-e TCAPLUS_CONTAINER_PUBLIC_IP="x.x.x.x" [Optional] Specify the IP address that the TcaplusDB container provides services to. This IP address needs to be set if TcaplusDB is to be accessed from outside the container. This value is generally the external IP address of the host.
-e TCAPLUS_CONTAINER_OMS_PASSWORD="*" [Required] Specify the login password of tcaplus for the TcaplusDB OMS user. For security reasons, the TcaplusDB container does not provide a default login password, which needs to be specified by the user when the container is started.
[Note] After the TcaplusDB service is started, users can log in to the TcaplusDB OMS page through the tcaplus username and password.
-p 80:80 -p 9999:9999 -p 13755-13765:13755-13765 [Optional] When running the container in bridge network mode, a mapping relationship between the port in the container and the port of the host needs to be established through - p if service is to be accessed through the port of the host outside the container.
[Note] At present, ports that need to be exposed in the Local version of TcaplusDB are mainly 80, 9999, 13755-13765. See Appendix 5 for ports monitored by TcaplusDB.
tcaplusdb-local:3.55.1 [Required] Image name and tag.
--cpus=4 [Optional] If necessary, this parameter can be used to specify the number of CPU cores that can be used by the container. The parameter value should be greater than or equal to 4.
--memory=8G [Optional] If necessary, this parameter can be used to specify the available memory size of the container. The parameter value should be greater than or equal to 8 G.
--storage-opt size=50G [Optional] If necessary, this parameter can be used to specify the available disk size of the container. The parameter value should be greater than or equal to 50 G.
[Note] For some Docker versions, the disk size available to the container is 10 G by default. If the disk size is used up soon after the service runs for a period of time, you need to increase the disk size by modifying this parameter.
--network User defined network name [Optional] In some environments, the host network segment may conflict with the container default network segment. At this time, the customized Docker network should be created and used by the container specified by this parameter to avoid network conflicts.
[Note] Docker containers usually default to 192.168 or 172.17 container network segments. When the host happens to be in these network segments, a Docker network should be created that is different from the host network segment. For example, if the host network segment is 172.17, a Docker network that is on network segment 192.168 can be created, and specify this network when creating containers. For details of the Docker network creation method, see Appendix 6.

For more container parameters and descriptions, see:

sudo docker run --help

The TcaplusDB service is automatically started after the container is created. In this case, you can run the "docker logs" command to view service startup logs to learn about service startup progress and status. The service usually takes about 60 seconds to start.

When "Run Success" is displayed at the end of the container startup log, the service has been started successfully and the service is available.

sudo docker logs container name

6.1.5. Enter the Local container

If you need to enter the container to view information or locate faults, run the following command.

sudo docker exec -it container name /bin/bash

6.1.6. Close the Local container

If you need to temporarily close the container to release resources, run the following command to close the container.

sudo docker container stop --time=120 container name

Note: Since the TcaplusDB process needs a certain time to exit, if it is forced to close, the data engine file will be damaged, thus affecting the restart of the container. Here, you need to specify that the specified closing timeout is 120 seconds to prevent the TcaplusDB process from being forcibly killed by the Docker before normal close and exit (the Docker's default closing timeout is 10 seconds. If the container is not closed and exited after the timeout, it will be forcibly closed).

6.1.7. Start the Local container

For the closed container, if you want to start the service again, run the following command to start it.

sudo docker container start container name

6.2. Version Deployment in Windows 10 Environment

6.2.1. Special Notes

Deployment depends on Powershell to run relevant commands. It is important to execute PowerShell as an administrator to avoid prompting permission problems.

Dependency Description Download address
Windows10 Build Version >= 18362, which can be viewed by running thevercommand on the CMD terminal of Win10
WSL2 Windows Subsystem for Linux 2, Microsoft's Linux deployment plan, which can be upgraded to WSL2 if you were previously using WSL1
Linux Kernel Update Package Update package for Linux kernel components for WSL2 Download
CentOS7 Distro Linux Kernel for WSL2, the system carrier of docker service Download
Docker-Desktop Docker management platform on Windows, combined with WSL2 to manage images and containers Download

6.2.2. Deploy WSL2

For details about WSL2, see Microsoft Official Website. For details about WSL2 deployment, see Official Website. The following describes the specific process. If the user already has a WSL1 environment, please go to "Upgrade WSL1 to WSL2 part"

Step 1: Enable WSL2 components

You can use the command to open PowerShell as an administrator and run the following command:

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart

Step 2: Enable virtualization features

WSL2 depends on the virtualization feature and the Hyper-v feature at the same time. It needs to be enabled to open

  • Enable virtualization features
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
  • Enable Hyper-v features
dism.exe  /online /enable-feature /featurename:Microsoft-Hyper-V  /all /norestart

# It is critical and needs to be executed. If not executed, a BIOS problem will be reported
bcdedit /set hypervisorlaunchtype auto

Step 3: Restart the computer

After configuring the virtualization feature, restart the computer for it to take effect.

Step 4: Install the Linux kernel update package

Double click the Linux Kernel Update Package downloaded above to install it.

Step 5: Set WSL2 to support low version CentOS images, such as Centos6

Create a new file .wslconfig in the C:\Users\\directory, for example: C:\Users\JasonLiu**, and add the following:

[wsl2]
kernelCommandLine = vsyscall=emulate

Step 6 Set the default WSL version number. Open PowerShell as an administrator and run the following command:

wsl --set-default-version 2

If the setting is successful, there is no problem.

6.2.3. Upgrade WSL1 to WSL2

If you have enabled the WSL function and use WSL1, the upgrade is similar. Except step 1, the upgrade can be set according to steps 2, 3, 4, 5 and 6 above. For the existing Linux Distro, you can modify the version of the Distro to WSL2. For example, the name of the existing Distro is CentOS7. The modification method is as follows:

wsl --set-version CentOS7 2

6.2.4. Deploy CentOS7 Distro

The TcaplusDB image works well with the CentOS7 series. You can deploy a CentOS7 kernel. Download CentOS7 Distro according to the above resource preparation stage. Download it to the specified directory and unzip it. Right click to install as an administrator. Set Centos7 as the default Distro, open PowerShell as an administrator, and run:

wsl --set-default CentOS7

Check the current Distro status:

wsl -l -v

6.2.5. Deploy Docker Desktop

Click the Docker-Desktop downloaded in the resource preparation stage to install it. During installation, it will prompt "Enable WSL2", and you can select it directly. For details, see Official Deployment Document.

  • If wsl2 is not selected during installation, open Settings of Docker-Desktop after installation and check whether "Use the WSL2 based engine" is selected in General.
  • You can view the currently installed Distro on the "Resources" section of the "Settings" of Docker Desktop. It will automatically associate all the installed Distros. In addition to associating the default Distro, you can also choose to associate other Distros.

After the Docker Desktop is installed, you can view the status through wsl - l - v:

PS C:\Windows\system32> wsl -l -v
  NAME                   STATE           VERSION
* CentOS7                Running         2
  docker-desktop         Running         2
  docker-desktop-data    Running         2

From the above information, the default Distro is CentOS7, and there are two default Distros: docker-desktop, docker-desktop-data.

6.2.6. Import Local image

Confirm that the default Linux of WSL2 is CentOS7. If not, refer to "CentOS7 Distro Deployment" above. Open PowerShell as administrator and run:

docker load -i tcaplusdb-local-3.60.1.tar.gz

After importing, check whether the image is OK.

PS C:\Windows\system32> docker images
REPOSITORY        TAG       IMAGE ID       CREATED       SIZE
tcaplusdb-local   3.60.1    xxxxxxxxxxxx   2 hours ago   8.43GB

6.2.7. Create a Local container

In the WSL + Docker environment, WSL cannot directly access the IP address in the container, so the TCAPLUS_CONTAINER_PUBLIC_IP parameter must be specified when the WSL is deployed, and the parameter value of TCAPLUS_CONTAINER_DEPLOY_MODE must be specified as WSL, otherwise the Tcaplus service inside the container will not be accessible outside the container.

#TCAPLUS_CONTAINER_PUBLIC_IP is the ip of the specified proxy. The way to obtain it is to enter the CentOS7 distro environment and use ifconfig to get the ip of eth0,
docker run -itd --privileged  -e TCAPLUS_CONTAINER_PUBLIC_IP="192.168.53.2" -e TCAPLUS_CONTAINER_OMS_PASSWORD='***' -e TCAPLUS_CONTAINER_DEPLOY_MODE="WSL" -p 8080:80 -p 13755-13765:13755-13765 -p 9999:9999 --shm-size=3G --name test tcaplusdb-local:3.60.1

The above container creation command also exposes the ports in the container to the host:

  • 80: The port of the Web operation and maintenance platform is exposed as 8080, which can be directly accessed through the browser through localhost: 8080
  • 13755-13765: Port of tcaplusdb proxy
  • 9999: The tcaplusdb directory service address port is the port used for app connection

View the created container:

[root@ballenwen-PC4 e]# docker ps
CONTAINER ID   IMAGE                    COMMAND                  CREATED         STATUS        PORTS                                                        NAMES
4a6ce2b1811c   tcaplusdb-local:3.60.1   "sh /data/tcaplus/tc…"   2 seconds ago   Up 1 second   0.0.0.0:13755-13765->13755-13765/tcp, 0.0.0.0:8080->80/tcp   test

After the container is created, enter the container and wait 20 to 60 s for the tcaplus process to automatically start. You can run the following:

tcaplus_docker 172.17.0.2 root> ps -ef | grep tcaplus
root         1     0  0 21:32 pts/0    00:00:00 sh /data/tcaplus/tcaplus_run.sh
root       883     1  0 21:32 ?        00:00:00 /data/tcaplus/tsf4g_release/apps/tconnd/bin/tconnd --id=1.1.3 --use-bus --bus-key=1688 --conf-file=../cfg/tconnd/tconnd.xml --tlogconf=../cfg/tconnd/tconnd_log.xml --daemon start
root       899     1  0 21:32 ?        00:00:00 /data/tcaplus/tsf4g_release/apps/tcenterd/bin/tcenterd --id=1.1.1 --use-bus --bus-key=1688 --tlogconf=../cfg/tcenterd/tcenterd_log.xml --conf-file=../cfg/tcenterd/tcenterd.xml -D start
root       923     1  2 21:32 ?        00:00:01 /data/tcaplus/tsf4g_release/apps/tcm/bin/tcmcenter --id=1.1.2 --use-bus --timer=10 --bus-key=1688 --bus-beat-gap=60 --conf-file=../cfg/tcm/tcmcenter.xml --tlogconf=../cfg/tcm/tcmcenter_log.xml --conf-format=3 -D start
root       940     1  3 21:32 ?        00:00:02 /data/tcaplus/tsf4g_release/apps/tagent/bin/tagent --id=1.2.1 --tlogconf=../cfg/tagent/tagent_log.xml --conf-file=../cfg/tagent/tagent.xml -D start
root       962     1  0 21:32 pts/0    00:00:00 /data/tcaplus/tcaplus_service/bin/tbusd --epoll-wait=1 --use-tsm --idle-sleep=1 --conf-file=../cfg/tbusd/tbusd.xml --tlogconf=../cfg/tbusd/tbusd_log.xml --no-bus --daemon --id=0.0.0.1 --business-id=0 -D start
root      1320  1318  0 21:32 ?        00:00:00 /opt/lampp/bin/rotatelogs /data/tcaplus/oms/tcapoms/www/log/error/error_log_%Y%m%d 86400 480
root      1324  1318  0 21:32 ?        00:00:00 /opt/lampp/bin/rotatelogs /data/tcaplus/oms/tcapoms/www/log/accesslogs/access_log_%Y%m%d 86400
tcaplus   1712  1318  0 21:32 ?        00:00:00 /opt/lampp/bin/httpd -k start -E /opt/lampp/logs/error_log -DSSL -DPHP
tcaplus   1713  1318  0 21:32 ?        00:00:00 /opt/lampp/bin/httpd -k start -E /opt/lampp/logs/error_log -DSSL -DPHP
tcaplus   1714  1318  0 21:32 ?        00:00:00 /opt/lampp/bin/httpd -k start -E /opt/lampp/logs/error_log -DSSL -DPHP
tcaplus   1715  1318  0 21:32 ?        00:00:00 /opt/lampp/bin/httpd -k start -E /opt/lampp/logs/error_log -DSSL -DPHP
tcaplus   1716  1318  0 21:32 ?        00:00:00 /opt/lampp/bin/httpd -k start -E /opt/lampp/logs/error_log -DSSL -DPHP
tcaplus   1717  1318  0 21:32 ?        00:00:00 /opt/lampp/bin/httpd -k start -E /opt/lampp/logs/error_log -DSSL -DPHP
tcaplus   1718  1318  0 21:32 ?        00:00:00 /opt/lampp/bin/httpd -k start -E /opt/lampp/logs/error_log -DSSL -DPHP
tcaplus   1719  1318  0 21:32 ?        00:00:00 /opt/lampp/bin/httpd -k start -E /opt/lampp/logs/error_log -DSSL -DPHP
tcaplus   1720  1318  0 21:32 ?        00:00:00 /opt/lampp/bin/httpd -k start -E /opt/lampp/logs/error_log -DSSL -DPHP
root      1895     1  5 21:32 ?        00:00:02 /data/tcaplus/tcaplus_service/bin/1_2_1_1/swiftd --use-tsm --idle-sleep=1 --conf-file=../../cfg/access_1_2_1_1/swift_tcaproxy.xml --conf-format=3 --tlogconf=../../cfg/access_1_2_1_1/tcaproxy_log.xml -D --id=1.2.1.1 --bus-key=2088 --business-id=0 -D start
root      1898     1  4 21:32 ?        00:00:02 /data/tcaplus/tcaplus_service/bin/1_3_1_1/swiftd --use-tsm --idle-sleep=1 --conf-file=../../cfg/access_1_3_1_1/swift_tcaproxy.xml --conf-format=3 --tlogconf=../../cfg/access_1_3_1_1/tcaproxy_log.xml -D --id=1.3.1.1 --bus-key=2088 --business-id=0 -D start
root      1914     1 31 21:32 ?        00:00:16 /data/tcaplus/tcaplus_service/bin/1_1_2_1/tcapsvr --use-tsm --idle-sleep=1 --nthread=8 --bus-check-gap=0 --threadChannelSize=20480000 --conf-file=../../cfg/storage_1_1_2_1/tcapsvr.xml --conf-format=3 --tlogconf=../../cfg/storage_1_1_2_1/tcapsvr_log.xml --daemon --id=1.1.2.1 --bus-key=2088 --business-id=0 -D start
root      1931     1 30 21:32 ?        00:00:15 /data/tcaplus/tcaplus_service/bin/1_1_2_2/tcapsvr --use-tsm --idle-sleep=1 --nthread=8 --bus-check-gap=0 --threadChannelSize=20480000 --conf-file=../../cfg/storage_1_1_2_2/tcapsvr.xml --conf-format=3 --tlogconf=../../cfg/storage_1_1_2_2/tcapsvr_log.xml --daemon --id=1.1.2.2 --bus-key=2088 --business-id=0 -D start
root      1938     1  4 21:32 ?        00:00:02 /data/tcaplus/tcaplus_service/bin/1_3_8_1/swiftd --use-tsm --idle-sleep=1 --conf-file=../../cfg/tcaprestproxy_1_3_8_1/swift_tcaprestproxy.xml --conf-format=3 --tlogconf=../../cfg/tcaprestproxy_1_3_8_1/tcaprestproxy_log.xml -D --id=1.3.8.1 --business-id=0 -D start
root      1944     1  4 21:32 ?        00:00:02 /data/tcaplus/tcaplus_service/bin/tcapdir/swiftd --use-tsm --idle-sleep=1 --conf-file=../../cfg/tcapdir/tcapdir_swift.xml --tlogconf=../../cfg/tcapdir/tcapdir_log.xml -D --id=1.0.4.1 --business-id=0 -D start
root      2000     1 29 21:32 ?        00:00:14 /data/tcaplus/tcaplus_service/bin/1_2_5_1/tcapdb --use-tsm --idle-sleep=1 --nthread=8 --threadChannelSize=10000000 --timer=3000 --conf-file=../../cfg/tcapdb_1_2_5_1/tcapdb_cfg.xml --conf-format=3 --tlogconf=../../cfg/tcapdb_1_2_5_1/tcapdb_log.xml -D --id=1.2.5.1 --bus-key=2088 --business-id=0 -D start
root      2253  2140  0 21:33 pts/1    00:00:00 grep tcaplus

If creating a container fails, check for the following reasons:

  • Check machine resources: The available disk size is above 50 G, and the available memory is 4 to 6 G
  • Check system parameters: Whether to create C:\Users\.wslconfig
  • View container creation logs: docker logs

6.2.8. Close the Local container

If you need to temporarily close the container to release resources, run the following command to close the container.

sudo docker container stop --time=120 container name

Note: Since the TcaplusDB process needs a certain time to exit, if it is forced to close, the data engine file will be damaged, thus affecting the restart of the container. Here, you need to specify that the specified closing timeout is 120 seconds to prevent the TcaplusDB process from being forcibly killed by the Docker before normal close and exit (the Docker's default closing timeout is 10 seconds. If the container is not closed and exited after the timeout, it will be forcibly closed).

7. Version Test

After the version deployment is completed, you can connect to TcaplusDB through SDK, OMS, etc. for data reading and writing or cluster management.

TcaplusDB Local version creates test services, game zones and tables by default. You can log in to TcaplusDB OMS to view relevant information.

7.1. Connect through OMS

For this section, refer to: Using the TcaplusDB OMS Console.

The login address of OMS is http://\:\. Where host is TCAPLUS CONTAINER PUBLIC_ IP (if specified) or IP of the host. Port is the port number mapped from port 80 of the container to the host.

The default user name for logging in to OMS is tcaplus, and the password is the parameter value of the TCAPLUS_CONTAINER_OMS_PASSWORD specified when starting the container.

7.2. Connect through SDK

For this section, please refer to: TcaplusDB TDR Table C++SDK Instructions

8. FAQ

8.1. Container Startup Log: Failed to write channels, for shmctl

Reason:

The shared memory size of the container is set too small. The default shared memory size of some Docker versions is 32 M, while the minimum value required for the TcaplusDB container is 2 G.

Solution:

  1. Use images of the latest 3.53.1 version or a later version.

  2. When starting the container, the shared memory size of the specified container can be displayed through -- shm size=2G.

8.2. Failed to Start the Container in Debian System, with the Container Exit Code = 139

Reason:

The current exit code of 139 is mostly a problem with the vsyscall setting of the master

Solution:

  1. For the method of setting vsyscall in Debian, refer to http://helpcenter.onlyoffice.com/installation/mail-enabling-vsyscall.aspx;

  2. For the method of setting vsyscall in Windows WSL2, refer to https://zhuanlan.zhihu.com/p/256317180

8.3. The SSH, PWD and Other Commands and Services in the Container Are Unavailability, Resulting in the Unavailability of Some Functions of TcaplusDB

Reason:

Most of the reasons for the current situation are that the SELinux mandatory security policy is enabled on the host, resulting in the unavailability of SSH, PWD and other commands or services in the container. The immediate impact is that some of the functions of TcaplusDB that depend on these commands and services are unavailable, such as table clearing.

Solution:

Close the SELinux mandatory security policy of the host.

  1. Close temporarily.

    setenforce 0
    
  2. Close permanently. Edit the /etc/selinux/config file, set SELINUX=Disabled, and restart the computer.

8.4. The Host Network Segment Conflicts with the Docker Container Network Segment, Resulting in the Client Being Unable to Vonnect to the Service

Reason:

In some environments, there may be conflicts between the host network segment and the container default network segment. The Docker container is usually 192.168 or 172.17 by default. When the host happens to be in these network segments, TcaplusDB will treat the request sent from the host as an intranet request and return the IP in the container to the client as the service IP. In some environments (such as WSL), the host cannot directly access the IP in the container, so the service status is normal, but the client cannot connect to the server.

Solution:

Create a Docker network that is on a different network segment from the host. For example, if the host network segment is 172.17, create a Docker network that is on network segment 192.168 and specify this network when creating containers. The method of creating a Docker network is as follows.

Run the following command to create a Docker network.

sudo docker network create --driver=bridge --subnet=192.168.10.0/24 subnet_192_168_10
  • 192.168.10.0/24 indicates the Docker network segment and mask.

  • subnet 192 168_ 10 is the Docker network name, which is followed by network in the container creation command.

8.5. When deploying the WSL environment, the containers created before the restart cannot be accessed externally after the subsystem restarts

Reason:

After the WSL subsystem restarts, the IP assigned by the system to the subsystem changes, but the previously started containers are configured with the original subsystem IP as the Public IP of the container, so external access to the container cannot continue through the original subsystem IP.

Solution:

Use Tcaplus Docker to change the Public IP address of the container to the new subsystem IP address. The detailed steps are as follows:

  • Download the Tcaplus Docker tool script.
wget https://tcaplus-tools-1301716906.cos.ap-guangzhou.myqcloud.com/tcaplus_tools.sh
  • Modify the public IP of the container
sh tcaplus_tools.sh change_container_public_ip <container name> <new IP>

8.6. After adding a table to OMS, the command is not executed but is waiting for the queue to execute.

Solution:

  1. View transactions that are not pending and executing, and if necessary, other transactions have completed or ended.

  2. The tcapcenter has been started for more than 3 minutes. The tcapcenter starts to execute transactions 3 minutes after it is started.

  3. If 1 and 2 are excluded, you can restart the tcaplus center process in the container. Restart method:

    1. Enter the tcaplus docker container: docker exec - it container name /bin/bash

    2. Switch to tcaplus user: su - tcaplus

    3. Switch to/data/tcaplus/tcaplus Service/bin/directory: cd/data/tcaplus/tcaplus service/bin/

    4. Start tcm console: ./start_tcmconsole.sh

    5. Execute the restart command on the tcm console: restart 1.0.9.1

8.7. Container startup error: docker: Error response from daemon: --storage-opt is supported only for overlay over xfs with 'pquota' mount option

Reason:

The current disk mounting method does not support specifying how many disks to use

Solution:

Remove this parameter from the startup command. This parameter is not required -- storage opt size=50G

8.8. BIOS Problems

Problem description:

Please enable the Virtual Machine Platform Windows feature and ensure virtualization is enabled in the BIOS

Solution: Enable Hyper-v, use bcdedit to set virtual features for automatic registration, and reset the BIOS configuration

dism.exe  /online /enable-feature /featurename:Microsoft-Hyper-V  /all /norestart

bcdedit /set hypervisorlaunchtype auto

8.9. Container Creation Failure

Problem description: The container automatically exits after being created. It is found that WSL2 requires additional configuration parameters for Centos6.x image. Solution:

# Create a file in the user directory
c:\users\<username>.wslconfig

# Fill the file with the following
[wsl2]
kernelCommandLine = vsyscall=emulate

8.10. The Container Created before Restart Cannot Be Accessed Externally after Restart of Subsystem.

Use Tcaplus Docker to change the Public IP address of the container to the new subsystem IP address. The detailed steps are as follows:

Download the Tcaplus Docker tool script.

wget https://tcaplus-tools-1301716906.cos.ap-guangzhou.myqcloud.com/tcaplus_tools.sh

Modify the Public IP of the container.

sh tcaplus_tools.sh change_container_public_ip <container name> <new IP>

9. Limitations on Use

Distributed indexes can be created, but clusters cannot be created.

10. Appendix

10.1. Installing Docker

Docker is generally installed through system commands, such as yum and apt-get. Take CentOS7 for example. The installation method is as follows:

# CentOS 7 environment, CVM instance
yum install -y docker

# Debian 8.2 environment
apt-get update
apt-get install -y docker-ce containerd.io

# CentOS 8 environment, CVM instance, installed with dnf
dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo
dnf repolist -v
dnf list docker-ce --showduplicates | sort -r
dnf install docker-ce --nobest

Note: During the installation of Docker, pay attention to the configuration of the image source. It can be configured as a domestic image source by referring to relevant online documents.

After installing Docker, you can use the Docker command to check whether the installation is successful.

If the installation is successful, execute the following command to start the docker service.

# Start the Docker service
sudo service docker start

10.2. Closing SELinux

Check SELinux status.

getenforce

Close temporarily.

setenforce 0

Close permanently. Edit the /etc/selinux/config file, set SELINUX=Disabled, and restart the computer.

10.3. Setting vsyscall (Windows+WSL2)

In the system disk - User - \< user name > directory of Windows 10, modify the .wslconfig file (for example, C:\Users\test.wslconfig). If you do not have this file, you need to create it first.

Modify/add the following:

[wsl2]
kernelCommandLine = vsyscall=emulate

10.4. Setting vsyscall (Debian)

See Descriptions.

10.5. Monitoring Ports and Descriptions in the Container

Port Component Description
21 SFTP FTP Service Port A new FTP is built to solve the problem of slow packet transfer function of TCM
80 TcapOMS TcaplusDB OMS HTTP Service Port
443 TcapOMS TcaplusDB OMS HTTPS Service Port
3306 MySQL MySQL Service Port
4500 Tcapdb TcaplusDB Tcapdb Service Port
6000 Tcapcenter TcaplusDB Center Service Port
8899 Tcenterd Tcenterd Service Port
9010 Tconnd Tconnd Service Port
9017 Tbuspp Tbuspp Service Port
9020 Tbuspp Tbuspp Service Port
9200 Elasticsearch Elasticsearch Service Port
9300 Elasticsearch Elasticsearch Service Port
9898 Tcapdir Tcapdir Service Port
9999 Tcapdir Tcapdir Service Port
13755 Tcaproxy Tcaproxy Service Port
13756 Tcaproxy Tcaproxy Service Port
31001 Tcaprestproxy Tcaprestproxy Service Port
36000 SSH SSH Service Port
45755 Tcapsvr Tcapsvr Service Port
45760 Tcapsvr Tcapsvr Service Port
46755 Tcapsvr Tcapsvr Service Port
46760 Tcapsvr Tcapsvr Service Port

10.6. Creating Docker Network

Run the following command to create a Docker network.

sudo docker network create --driver=bridge --subnet=192.168.10.0/24 subnet_192_168_10
  • 192.168.10.0/24 indicates the Docker network segment and mask.

  • subnet 192 168_ 10 is the Docker network name, which is followed by network in the container creation command.

results matching ""

    No results matching ""