-
Notifications
You must be signed in to change notification settings - Fork 0
Redis Server Docker
Tong XING edited this page Jun 11, 2020
·
6 revisions
Popcorn Linux Demo on Youtube displays the Redis Server Docker Container migration.
Pull the h-container redis docker image from docker hub, then run the image detach as a container.
docker pull 123toorc/hcontainer-redis:hcontainer
docker run --cap-add all -d -p 6379:6379 155fea01651c
-> 4927a9ad4109ce5561f8ad346372fa11084c1fb586f0022c44d70a1d4fd048f2
Directly run docker image to create a Container of redis.
--cap-add all : it will add all capabilities, no need for change config file
-p : it allow container map it port with host port
-d: Run in background, this args cause running image will create Container
Notify the process
cd hcontainer-tutorial
./docker-popcorn-notify 4927a9ad4109c aarch64
Checkpoint the Container on x86, create a checkpoint name as simple
docker checkpoint create 4927a9ad4109c simple
Recode checkpoint, and copy the recoded checkpoint to the ARM machine.
./scripts/recode.sh 4927a9ad4109c simple aarch64
scp -r /tmp/simple $target@arm_machine:~
ssh $target@arm_machine
On ARM machine, pull the hcontainer redis image and run it, then stop it and prepare for restore.
docker pull 123toorc/hcontainer-redis:hcontainer
# Instead, you also can use '$docker container create 0f548727d566' and alter in hostconfig file to add capabilities and config.v2.json to add port mapping, please have look of scripts/builder.sh
docker run --cap-add all -d -p 6379:6379 0f548727d566
-> 10877d6d99969b4bdc0a4fc1dc144615cb1e0d1bbbb727324adc7538f473b394
# Stop the running container then we restore it.
docker container stop 10877d6d99969b4bdc0a4fc1dc144615cb1e0d1bbbb727324adc7538f473b394
copy the recoded checkpoint transfer from the x86 machine to the container's checkpoints sub-directory and restore the container
cp -r /tmp/simple /var/liv/docker/containers/10877d6d99969b4bdc0a4fc1dc144615cb1e0d1bbbb727324adc7538f473b394/checkpoints
docker container start --checkpoint simple 10877d6d99969
docker ps
You can also use redis-cli to test it, before the migration insert some key-value and try to get the key-value pair after restore.
redis-cli -h <IP> -p <Port>