docker run -d --name my-nats \
  -p 4222:4222 -p 8222:8222 \
  nats

sudo docker run -d \
  --name my-etcd \
  -p 2379:2379 \
  -p 2380:2380 \
  quay.io/coreos/etcd:v3.6.0 \
  etcd \
    --name etcd-single \
    --data-dir /etcd-data \
    --initial-advertise-peer-urls http://0.0.0.0:2380 \
    --listen-peer-urls http://0.0.0.0:2380 \
    --advertise-client-urls http://0.0.0.0:2379 \
    --listen-client-urls http://0.0.0.0:2379 \
    --initial-cluster etcd-single=http://0.0.0.0:2380

docker run -d --name etcdkeeper -p 8080:8080 evildecay/etcdkeeper

sudo docker run -d \
  --name my-redis \
  -p 6379:6379 \
  -e REDIS_PASSWORD=fox379@@zyxi \
  redis:latest \
  --requirepass fox379@@zyxi


sudo docker run -d \
  --name mysql-server \
  -e MYSQL_ROOT_PASSWORD=fox379@@zyxi \
  -e MYSQL_DATABASE=game \
  -e MYSQL_USER=game \
  -e MYSQL_PASSWORD=fox379@@zyxi \
  -p 3306:3306 \
  mysql:8.0

sudo docker exec -it mysql-server mysql -ugame -pfox379@@zyxi

docker run -d \
  --name clickhouse-server \
  -p 8123:8123 \
  -p 9000:9000 \
  -p 9009:9009 \
  -e CLICKHOUSE_DB=game_log \
  -e CLICKHOUSE_USER=game \
  -e CLICKHOUSE_PASSWORD=fox379@@zyxi \
  clickhouse/clickhouse-server

// 进入clickhouse容器连到数据库 show databases;
sudo docker exec -it clickhouse-server clickhouse-client --user game --password fox379@@zyxi

-- 设置 trace_log 最大分区数（自动清理旧数据）
ALTER TABLE system.trace_log MODIFY SETTING old_parts_lifetime = 3600;  -- 1小时后删除旧分区
ALTER TABLE system.text_log MODIFY SETTING old_parts_lifetime = 3600;  -- 1小时后删除旧分区