简体   繁体   English

如何使用两个Docker映像使用Vitess分片MySQL数据库?

[英]How can I shard MySQL database with Vitess using both Docker images?

I found out about Vitess which let you shard MySQL database. 我发现了有关Vitess的信息,可让您分片MySQL数据库。 I want to use the docker image of both MariaDB and Vitess but I'm not quite sure what to do next. 我想同时使用MariaDB和Vitess的docker镜像,但是我不确定下一步该怎么做。 I'm using CentOS 7. 我正在使用CentOS 7。

I installed the images 我安装了图像

docker pull mariadb
docker pull vitess/root
docker pull vitess/orchestrator

Log inside the vitess image 登录到Vitess图像内

sudo docker run -ti vitess/root bash

As the website said, make build 如网站所述,进行构建

make build

I set up the variables 我设置变量

export VTROOT=/vt
export VTDATAROOT=/vt/vtdataroot

The manual said it was in the home directory but in the image it's at root. 该手册说它在主目录中,但在镜像中它是根目录。

But after that I'm stuck. 但是在那之后我被困住了。 I laucnh zookeeper : ./zk-up.sh 我是动物园管理员:./ zk-up.sh

Starting zk servers... Waiting for zk servers to be ready... Started zk servers. ERROR: logging before flag.Parse: E0412
00:31:26.378586     132 syslogger.go:122] can't connect to syslog
W0412 00:31:26.382527     132 vtctl.go:80] cannot connect to syslog:
Unix syslog delivery error Configured zk servers.

Oops, okay, let's continue... 糟糕,我们继续...

./vtctld-up.sh for the web internace ./vtctld-up.sh用于网络实习

Starting vtctld...
Access vtctld web UI at http://88bdaff4e181:15000

Obviously I cannot access that link since it's in docker on a headless server 显然我无法访问该链接,因为它位于无头服务器中的docker中

./vttablet-up.sh suppose to bring up 3 vttablets, but MariaDB is in another docker, not yet started and if I open the file it is not apparent how to set it up. ./vttablet-up.sh假设要调出3个vttablets,但是MariaDB在另一个docker中,尚未启动,如果我打开文件,则不清楚如何设置它。

Is there any MySQL or PostgreSQL sharding solution more easily installable? 有没有更容易安装的MySQL或PostgreSQL分片解决方案? Or how can I set this up? 或者我该如何设置?

(Docker noob here sorry) (Docker noob抱歉)

Thanks! 谢谢!

If you need multiple container orchestrated, best bet is to use docker-compose . 如果您需要协调多个容器,最好的选择是使用docker-compose You can define all the application dependencies as separate containers and network them to be accessible from each other. 您可以将所有应用程序依赖项定义为单独的容器,并通过网络相互访问。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM