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'

3. services:
4. yb-master:
5. image: yugabytedb/yugabyte:latest
6. container_name: yb-master-n1
7. command: [ "/home/yugabyte/bin/yb-master",
8. "--fs_data_dirs=/mnt/disk0,/mnt/disk1",
9. "--master_addresses=yb-master-n1:7100",
10. "--replication_factor=1"]
11. ports:
12. - "7000:7000"
13. environment:
14. SERVICE_7000_NAME: yb-master

16. yb-tserver:
17. image: yugabytedb/yugabyte:latest
18. container_name: yb-tserver-n1
19. command: [ "/home/yugabyte/bin/yb-tserver",
20. "--fs_data_dirs=/mnt/disk0,/mnt/disk1",
21. "--tserver_master_addrs=yb-master-n1:7100"]
22. ports:
23. - "9042:9042"
24. - "6379:6379"
25. - "5433:5433"
26. - "9000:9000"
27. environment:
28. SERVICE_9042_NAME: cassandra
29. SERVICE_6379_NAME: redis
30. SERVICE_5433_NAME: postgresql
31. SERVICE_9000_NAME: yb-tserver
32. depends_on:
33. - 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