(Optional) Creating Docker Containers
If you need to set up a Docker-based environment, create Docker containers as instructed in this section. Skip this section if the physical machine or VM passthrough network environment is used to enable the features.
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.
- Install Docker. For details, see Docker Installation Guide.
- 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 from which the container's memory will be allocated. In this document, the container's memory runs on the same NUMA node as its assigned CPU cores.
- 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.
Parent topic: Setting Up the Environment and Networking