Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions examples/compose/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,20 @@ 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.
```
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.
```
Expand Down
3 changes: 3 additions & 0 deletions examples/compose/vttablet-up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down