diff --git a/examples/compose/README.md b/examples/compose/README.md index da5d8df5e64..82a54e1acbc 100644 --- a/examples/compose/README.md +++ b/examples/compose/README.md @@ -10,6 +10,7 @@ To start Consul(which saves the topology config), vtctld, vtgate and a few vttab ``` vitess/examples/compose$ docker-compose up -d ``` +Note that the vtgate container will likely fail to start. ### Load the schema We need to create a few tables into our new cluster. To do that, we can run the `ApplySchema` command. @@ -17,6 +18,12 @@ We need to create a few tables into our new cluster. To do that, we can run the vitess/examples/compose$ ./lvtctl.sh ApplySchema -sql "$(cat create_test_table.sql)" test_keyspace ``` +### Complete starting the cluster +Now that schema has been loaded a second start will bring vtgate up as well. +``` +vitess/examples/compose$ docker-compose up -d +``` + ### Run the client to insert and read some data This will build and run the `client.go` file. It will insert and read data from the master and from the replica. ``` diff --git a/examples/compose/vttablet-up.sh b/examples/compose/vttablet-up.sh index 63510ddfecb..91a3c1870e5 100755 --- a/examples/compose/vttablet-up.sh +++ b/examples/compose/vttablet-up.sh @@ -16,6 +16,9 @@ fi init_db_sql_file="$VTROOT/init_db.sql" echo "GRANT ALL ON *.* TO 'root'@'%';" > $init_db_sql_file +echo "GRANT ALL ON *.* TO 'vt_dba'@'%';" >> $init_db_sql_file +echo "GRANT ALL ON *.* TO 'vt_app'@'%';" >> $init_db_sql_file +echo "GRANT ALL ON *.* TO 'vt_repl'@'%';" >> $init_db_sql_file if [ "$tablet_role" = "master" ]; then echo "CREATE DATABASE vt_$keyspace;" >> $init_db_sql_file