MariaDB MaxScale 是世界上最先进的数据库代理,它能够实现数据库负载均衡、读写分离、高可用性支持与故障自动切换,同时提供数据分片管理、安全访问控制及性能监控等功能,有效提升数据库系统的运行效率、稳定性与可扩展性,简化复杂数据库环境的管理与维护。
MariaDB MaxScale Docker image
This Docker image runs MariaDB MaxScale. Two image variants can be built:
- https://github.com/krallin/tini-based image running on https://rockylinux.org/
- Minimal image running on Red Hat Universal Base Image 8 Minimal
Building
make build-image MXS_VERSION=<mxs-version>
The resulting image type depends on the Git branch used: rocky8 for Tini-based images, rhel-ubi8 for RHEL-UBI-based images.
For example, to build an image with MaxScale 24.02.1 run make build-image MXS_VERSION=24.02.1.
Running
Pull the latest MaxScale image from docker hub:
docker pull mariadb/maxscale:latest
Run the MaxScale container as "mxs":
docker run -d --rm --name mxs mariadb/maxscale:latest
The default configuration for the container is minimal and only enables the REST API.
The REST API by default listens on port 8989. The default user is "admin" with password "mariadb". Accessing it from the docker host requires a port mapping specified on container startup. The example below shows general information via curl.
docker run -d --rm -p 8989:8989 --name mxs mariadb/maxscale:latest curl -u admin:mariadb http://localhost:8989/v1/maxscale
See https://mariadb.com/kb/en/mariadb-maxscale-2208-rest-api/ for more information about the REST API.
Configure via configuration file
Custom configuration can be given in an additional configuration file (e.g.
my-maxscale.cnf). The file needs to be mounted into /etc/maxscale.cnf.d/:
docker run -d --rm -p 8989:8989 --name mxs -v $PWD/my-maxscale.cnf:/etc/maxscale.cnf.d/my-maxscale.cnf mariadb/maxscale:latest
If the [maxscale]-section of the configuration file needs to be altered, the
new file should override the default configuration file.
docker run -d --rm -p 8989:8989 --name mxs -v $PWD/my-maxscale.cnf:/etc/maxscale.cnf mariadb/maxscale:latest
MaxScale 25.10 trial version
The MaxScale 25.10 trial image (25.10.2-trial) requires a licence key to run. Generate a https://mariadb.com/download-confirmation/maxscale-trial/, and write it to the maxscale-section in a MaxScale configuration file:
[maxscale] license_key=<license key contents>
Then, start the MaxScale container with the config file by running
docker run -d --rm -p 8989:8989 --name mxs -v $PWD/my-maxscale.cnf:/etc/maxscale.cnf mariadb/maxscale:25.10.2-trial.
Commandline Access
docker exec -it mxs bash
mariadb 命名空间的其他可用镜像:
更多相关 Docker 镜像与资源
以下是 mariadb/maxscale 相关的常用 Docker 镜像,适用于 不同场景 等不同场景:
镜像拉取方式
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
DockerHub 原生拉取命令
用户好评
来自真实用户的反馈,见证轩辕镜像的优质服务