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
$ docker pull yugabytedb/yugabyte
Create a docker-compose.yaml file
version: '2'
services:
yb-master:
image: yugabytedb/yugabyte:latest
container_name: yb-master-n1
command: [ "/home/yugabyte/bin/yb-master",
"--fs_data_dirs=/mnt/disk0,/mnt/disk1",
"--master_addresses=yb-master-n1:7100",
"--replication_factor=1"]
ports:
- "7000:7000"
environment:
SERVICE_7000_NAME: yb-master
yb-tserver:
image: yugabytedb/yugabyte:latest
container_name: yb-tserver-n1
command: [ "/home/yugabyte/bin/yb-tserver",
"--fs_data_dirs=/mnt/disk0,/mnt/disk1",
"--tserver_master_addrs=yb-master-n1:7100"]
ports:
- "9042:9042"
- "6379:6379"
- "5433:5433"
- "9000:9000"
environment:
SERVICE_9042_NAME: cassandra
SERVICE_6379_NAME: redis
SERVICE_5433_NAME: postgresql
SERVICE_9000_NAME: yb-tserver
depends_on:
- yb-master
Start the cluster
$ docker-compose up -d
2. Setup the YEDIS API
$ 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
$ docker-compose down
当前内容版权归 YugabyteDB 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 YugabyteDB .