简体   繁体   中英

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

I found out about Vitess which let you shard MySQL database. I want to use the docker image of both MariaDB and Vitess but I'm not quite sure what to do next. I'm using CentOS 7.

I installed the images

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

Log inside the vitess image

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

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

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

./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.

Is there any MySQL or PostgreSQL sharding solution more easily installable? Or how can I set this up?

(Docker noob here sorry)

Thanks!

If you need multiple container orchestrated, best bet is to use docker-compose . You can define all the application dependencies as separate containers and network them to be accessible from each other.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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