Skip to content

yTek01/YugabyteDB-on-Docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Yugabyte Cluster Database Deployment using Docker Compose file

This is a repository that shows you how to set up your Yugabyte Database using Docker Compose file.

alt text

  1. Clone the Github repo with the docker-compose file.
git clone https://github.com/yTek01/YugabyteDB-on-Docker.git
  1. Start the Cluster I have included a single node in the YAML file, but you can include another node/container in the same YAML to make this a two node cluster.
docker-compose -f ./docker-compose.Yugabyte.yaml up -d
  1. Test the APIs Clients can now connect to the YSQL API at localhost:5433 and the YCQL API at localhost:9042. The yb-master admin service is available at http://localhost:7000.

  2. Connect to YSQL YCQL and YSQL APIs are enabled by default on the cluster.

docker exec -it yb-tserver-n1 /home/yugabyte/bin/ysqlsh -h yb-tserver-n1
  1. Connect to YCQL
docker exec -it yb-tserver-n1 /home/yugabyte/bin/ycqlsh yb-tserver-n1
  1. Create Keyspaces and Tables with the CQL API.
CREATE KEYSPACE Cassandrakeyspace; \
CREATE TABLE Cassandrakeyspace.foo(bar INT PRIMARY KEY); \
DESCRIBE Cassandrakeyspace.foo;
  1. Copy and load the sample data into YugabyteDB docker cp load_data.sql yb-tserver-n1:/home/yugabyte/

  2. Connect to the YSQL

docker exec -it yb-tserver-n1 /home/yugabyte/bin/ysqlsh -h yb-tserver-n1
  1. Load the data into the database.
\i load_data.sql
  1. Connect to YSQL, with the new user and database connection.
docker exec -it yb-tserver-n1 /home/yugabyte/bin/ysqlsh -h yb-tserver-n1 -U postgres -d dvdrental
  • List all the tables in the dvdrental database.
\dt
  • Check the actors table.
SELECT * FROM public.actor;

About

This is a repository that shows you how to set up your Yugabyte Database using Docker Compose file.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published