Rate This Document
Findability
Accuracy
Completeness
Readability

(Optional) Creating Docker Containers

If you need to set up a Docker-based environment, create Docker containers as instructed in this section. Otherwise, skip this section.

This document uses four instances in a Docker-based environment with bond4 and IPVLAN configurations for testing and verification. Create four Docker containers with the following specifications: 2 CPU cores and 10 GB memory, with one container allocated per NUMA node. Create Docker containers based on the actual number of instances.

  1. Install Docker by referring to Docker Installation Guide.
  2. Create Docker containers.
    docker run --cpus=2 --cpuset-cpus=0-79 --cpuset-mems=0 -m 10g --net=ipvlan_network --cap-add CAP_SYS_ADMIN \ 
    --privileged=true -itd --name redis-docker-ipvlan-numa0-1 \ 
    -v /home:/home -v /usr:/usr -v /mnt:/mnt -v /lib/modules:/lib/modules -v /data:/data -v /etc:/etc \ 
    openeuler-22.03-lts-sp4 /bin/bash 
      
    docker run --cpus=2 --cpuset-cpus=80-159 --cpuset-mems=1 -m 10g --net=ipvlan_network --cap-add CAP_SYS_ADMIN \ 
    --privileged=true -itd --name redis-docker-ipvlan-numa1-1 \ 
    -v /home:/home -v /usr:/usr -v /mnt:/mnt -v /lib/modules:/lib/modules -v /data:/data -v /etc:/etc \ 
    openeuler-22.03-lts-sp4 /bin/bash 
      
    docker run --cpus=2 --cpuset-cpus=160-239 --cpuset-mems=2 -m 10g --net=ipvlan_network --cap-add CAP_SYS_ADMIN \ 
    --privileged=true -itd --name redis-docker-ipvlan-numa2-1 \ 
    -v /home:/home -v /usr:/usr -v /mnt:/mnt -v /lib/modules:/lib/modules -v /data:/data -v /etc:/etc \ 
    openeuler-22.03-lts-sp4 /bin/bash 
      
    docker run --cpus=2 --cpuset-cpus=240-319 --cpuset-mems=3 -m 10g --net=ipvlan_network --cap-add CAP_SYS_ADMIN \ 
    --privileged=true -itd --name redis-docker-ipvlan-numa3-1 \ 
    -v /home:/home -v /usr:/usr -v /mnt:/mnt -v /lib/modules:/lib/modules -v /data:/data -v /etc:/etc \ 
    openeuler-22.03-lts-sp4 /bin/bash

    Container creation parameters:

    • cpus: number of CPU cores used by a container. In this document, two cores are used for testing.
    • cpuset-cpus: number of cores on each NUMA node. For example, each NUMA node of the test machine in this document has 80 cores. A Redis instance is created on each NUMA node.
    • cpuset-mems: NUMA node where container running memory is located. In this document, the running memory is located in the NUMA node where the CPU is running.
    • m: maximum memory size used by the container. The value is 10 GB in this document.
    • net: container's network type. In this document, an IPVLAN is used. For details, see (Optional) Creating an IPVLAN. If the networking environment is not IPVLAN, change the value based on the site requirements.