Add A WeScale Container on Local Machine
Start WeScale
Start WeScale Container
Once the WeSQL-Server is running, you can start the WeScale container. The WeScale container will connect to the WeSQL-Server and provide MySQL service at port 15306.
docker run -itd --network host --name wescale \
-w /vt/examples/wesql-server \
-e MYSQL_ROOT_USER=root \
-e MYSQL_ROOT_PASSWORD=passwd \
-e MYSQL_PORT=3306 \
-e MYSQL_HOST=127.0.0.1 \
apecloud/apecloud-mysql-scale:0.3.7 \
/vt/examples/wesql-server/init_single_node_cluster.sh
It may take a few seconds for the WeScale container to start. You can check the logs to see if the WeScale container has started successfully.
docker logs wescale
Connecting to WeScale
You can connect to WeScale using a MySQL client or driver.
docker run -it --network host --rm mysql mysql -h127.0.0.1 -P15306 -uroot -ppasswd
- replace the password
passwd
to the real password you set.
Run Sysbench
In the previous step, we've already connected to the WeSQL-Server and written the sysbench data. Therefore, there's no need to prepare again. You can now connect to the WeScale port directly for testing.
Run Sysbench On WeScale
docker run --network host --rm \
apecloud/customsuites:latest \
sysbench \
--db-driver=mysql \
--report-interval=2 \
--tables=4 \
--table-size=250000 \
--threads=8 \
--time=300 \
--mysql-host=127.0.0.1 \
--mysql-port=15306 \
--mysql-user=sbtest \
--mysql-password=password \
/usr/share/sysbench/oltp_read_write.lua \
run