一、介绍
Checkpoint/Restore in Userspace(CRIU)是一个软件,可让您在正在运行的容器或独立应用程序中设置检查点,并将它的状态保存到磁盘中。您可以在重启时同时使用保存的数据来恢复容器。
二、操作
1. 环境准备
# 确保 criu 工具存在
which criu # 有输出具体路径代表系统有这个工具
# 如果没有的话,安装
yum/dnf install -y criu # centos/almalinux 安装
2. 创建基于 Python 服务器
cat counter.py
#!/usr/bin/python3
import http.server
counter = 0
class handler(http.server.BaseHTTPRequestHandler):
def do_GET(s):
global counter
s.send_response(200)
s.send_header('Content-type&#