docker-compose

AttentionThis page documents an earlier version. Go to the latest (v2.1)version.

Use the popular docker-compose utility to create and manage YugabyteDB local clusters.

1. Create a single node cluster

Pull the container

Pull the container from docker hub registry

  1. $ docker pull yugabytedb/yugabyte

Create a docker-compose.yaml file

  1. version: '2'
  2. services:
  3. yb-master:
  4. image: yugabytedb/yugabyte:latest
  5. container_name: yb-master-n1
  6. command: [ "/home/yugabyte/bin/yb-master",
  7. "--fs_data_dirs=/mnt/disk0,/mnt/disk1",
  8. "--master_addresses=yb-master-n1:7100",
  9. "--replication_factor=1"]
  10. ports:
  11. - "7000:7000"
  12. environment:
  13. SERVICE_7000_NAME: yb-master
  14. yb-tserver:
  15. image: yugabytedb/yugabyte:latest
  16. container_name: yb-tserver-n1
  17. command: [ "/home/yugabyte/bin/yb-tserver",
  18. "--fs_data_dirs=/mnt/disk0,/mnt/disk1",
  19. "--tserver_master_addrs=yb-master-n1:7100"]
  20. ports:
  21. - "9042:9042"
  22. - "6379:6379"
  23. - "5433:5433"
  24. - "9000:9000"
  25. environment:
  26. SERVICE_9042_NAME: cassandra
  27. SERVICE_6379_NAME: redis
  28. SERVICE_5433_NAME: postgresql
  29. SERVICE_9000_NAME: yb-tserver
  30. depends_on:
  31. - yb-master

Start the cluster

  1. $ docker-compose up -d

2. Setup the YEDIS API

  1. $ docker exec -it yb-master-n1 /home/yugabyte/bin/yb-admin --master_addresses yb-master-n1:7100 setup_redis_table

Clients can now connect to the YCQL service at localhost:9042, to the YEDIS API at localhost:6379, and to the PostgreSQL(Beta) service at localhost:5433. The yb-master admin service is available at http://localhost:7000.

3. Test the various YugabyteDB APIs

Follow the instructions in the Quick Start section with Docker using the links below.

4. Stop the cluster

  1. $ docker-compose down