Steps to create the vitess cluster on 3 physical/virtual machines.

844 views
Skip to first unread message

amit.a...@iacpublishinglabs.com

unread,
Aug 1, 2016, 4:51:14 PM8/1/16
to vitess
Hi,

We are planning to implement vitess on 3 physical/virtual machine (Not local and not on kubernete).
I am following the process as mentioned in http://vitess.io/getting-started/local-instance.html

A) Install dependencies on all 3 nodes
  1. Install GO 1.5+ 
  2. Install MYSQL
  3. Zookeeper 3.3.5 is included by default.
  4. Install the following tools needed to build and run vitess.
  5. Install the openkdk-7-jre
B) Build Vitess on all 3 nodes

  1. cd $WORKSPACE;git clone https://github.com/youtube/vitess.git src/github.com/youtube/vitess;cd src/github.com/youtube/vitess
  2. export MYSQL_FLAVOR=MySQL56
  3. export VT_MYSQL_ROOT=/data/db
  4. Run mysql_config
  5. ./bootstrap.sh;. ./dev.env;make build
C) Start a Vitess Cluster (Not sure all 3 nodes or any one is good).
      
  1. Check System setting.
  2. Configure environment variables
  3. Start zookeeper ./zk-up.sh
  4. Start vtctld ./vtctld-up.sh
  5. Start vttablets ./vttablet-up.sh
  6. Initialize Mysql databases.
  7. Create a table
  8. Take a backup
  9. Inititalize Vitess routing schema.
  10. Start vtgate.
My questions are.

  1. Do we need to run  ./bootstrap.sh;. ./dev.env;make build on all 3 physical/vm servers?
  2. All script (zk-up.sh, vtctld-up.sh, vttablet-up.sh and vtgate-up.sh) calls env.sh which have server details if I am changing those localhost to individual server name that is good enough to take care of rest of the things?
  3. All above mentioned scripts need to run on just one node or all 3 nodes?
Please include the steps if I am missing them and are necessary to create the vitess cluster on 3 physical/vm machines?


Thanks,
Amit

Mohammad Heydari

unread,
Aug 2, 2016, 8:50:39 AM8/2/16
to vitess
I did the same and I wrote my own scripts to control the cluster, though there has to be a better way to set it up by using just binaries instead of bootstrapping the whole development environment.

amit.a...@iacpublishinglabs.com

unread,
Aug 2, 2016, 11:23:45 AM8/2/16
to vitess
Hi Mohammad,

Can you please do let me know what all steps you did on all 3 servers and what is on one to initiate installation?

Thanks,
Amit

Anthony Yeh

unread,
Aug 2, 2016, 9:28:41 PM8/2/16
to vit...@googlegroups.com
This is a great idea for a guide we should write: walkthrough of running on 3 machines. We should also provide a script to package up only what you'll need to run, after finishing a build. I've made a note to think more about those ideas.

In the meantime, here are some pointers:

You shouldn't need to run bootstrap.sh or dev.env everywhere - only on one machine that you use to do the build. Once you finish 'make build' on that machine, here's my first attempt at the list of directories you'll need to package up and copy to the other machines:

$VTROOT/bin
$VTROOT/config (note this is a symlink to $VTTOP/config)
$VTROOT/dist/vt-zookeeper-3.4.6
$VTTOP/web/vtctld

Instead of running dev.env, you should just set a few environment variables according to how you unpack your files:

VTROOT
VTDATAROOT
VT_MYSQL_ROOT

The examples/local scripts are only meant to be a source for you to make your own scripts suited to your environment. They would also need modifications to run on multiple machines, so I would add another set of scripts if I write that guide.

Some things that would need to be changed are:

ZooKeeper server addresses:

Note that although you need to configure ZK addresses, you don't need to configure addresses for vttablets because they publish their own addresses to the rest of Vitess (vtgate, vtctld) via ZooKeeper. In other words, you just point everything in Vitess at ZK, and then they can all find each other automatically.

For zk-* and vttablet-* scripts, you would modify them to only start one zkid and one tablet uid. You would set each machine to run a different zkid/uid.

For a simple setup, you only need one vtgate and one vtctld. You can add and remove these as needed for load balancing.

There may be some more things that I haven't thought of just now, but until I get time to work on a full guide, please give this a shot and let me know if you run into any problems.

Anthony

--
You received this message because you are subscribed to the Google Groups "vitess" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vitess+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

amit.a...@iacpublishinglabs.com

unread,
Aug 3, 2016, 6:20:19 PM8/3/16
to vitess
Thanks Anthony for your respone.
I will try your suggestion and let you know how it goes.

Amit

Kui Yue

unread,
Dec 11, 2016, 10:21:05 AM12/11/16
to vitess
I followed this idea, too, to build a 3-machine cluster. Somehow the two replica both reports unhealthy. one is "unhealthy: reported replication lag: 61334.160904041 higher than unhealthy threshold: 7200". The other is, unhappy: 2h0m0s behind on replication.  How could solve this?

Thanks.
-Kui




On Tuesday, August 2, 2016 at 6:28:41 PM UTC-7, Anthony Yeh wrote:

Shrenik Parekh

unread,
Oct 5, 2018, 5:23:13 PM10/5/18
to vitess
Hi Amti,

I got stuck after bootstrap.sh for GOPATH root and GOROOT. I have installed go on Linux at /usr/local/go and Vitess installed at /vt/src/vitess.io. I tried different absolute path for variable GOPATH and GOROOT but I am not able to execute dev.run and make build. I would appreciate if you can elaborate steps for dev.run, make build, location to run dev.run, location to run make build and setting variable GOPATH and GOROOT.

Thanks
Shrenik
Reply all
Reply to author
Forward
0 new messages