Skip to content

Commit

Permalink
feat: add docker cluster
Browse files Browse the repository at this point in the history
  • Loading branch information
earayu committed Nov 6, 2024
1 parent ef05c33 commit a4123bb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/wescale_wesql_performance_docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ jobs:
- name: Compile source
timeout-minutes: 30
run: |
pwd
ls -alF examples/wesql-server/vtdataroot
whoami
make failpoint-enable
make build
make failpoint-disable
Expand All @@ -49,7 +46,7 @@ jobs:
TAIL_PID=$!
echo "Waiting for WeScale to be ready..."
if timeout 10 bash -c 'until nc -z localhost 15306; do sleep 2; echo "Waiting for port 15306..."; done'; then
if timeout 60 bash -c 'until nc -z localhost 15306; do sleep 2; echo "Waiting for port 15306..."; done'; then
echo "Port 15306 is now available"
# 停止 tail
kill $TAIL_PID
Expand Down
10 changes: 3 additions & 7 deletions examples/wesql-server/start_mysql_server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ DATA_DIR="$(pwd)/vtdataroot/mysql"
CONFIG_FILE="$DATA_DIR/my.cnf"
IMG="mysql/mysql-server:8.0.32"

# 获取当前用户的 UID 和 GID
USER_ID=$(id -u)
GROUP_ID=$(id -g)

# 创建数据目录和日志目录(如果不存在)
mkdir -p "$DATA_DIR/data"
mkdir -p "$DATA_DIR/log"
Expand All @@ -33,12 +29,12 @@ log-error=/data/mysql/log/mysqld-error.log
EOL
fi

# 设置目录所有权
chown -R $USER_ID:$GROUP_ID "$DATA_DIR"
# 设置目录权限
chmod -R 777 "$DATA_DIR"
chmod 644 "$CONFIG_FILE"

# 运行 Docker 容器
docker run -itd --name $CONTAINER_NAME \
--user $USER_ID:$GROUP_ID \
-p $HOST_PORT:$CONTAINER_PORT \
-v "$DATA_DIR":/data/mysql \
-v "$CONFIG_FILE":/etc/my.cnf \
Expand Down

0 comments on commit a4123bb

Please sign in to comment.