Skip to content

Repository files navigation

DIST-APP

Sample implementation of gossip protocol

lint

$ brew install golangci-lint 
$ make lint

or

$ make go-lint-docker

Build

Mac

$ make mac_amd64_build

Linux

$ make linux_build

Docker Build

$ make linux_build

$ make docker_build
# using Dockerfile docker image will be build 
# and saved locally as distapp:0.0.1

Docker Deployment

$ make deploy 
# Note: this will deploy 3 instance (prefix with distapp*)

$ make destroy 
# Note: will stop and remove deployed 3 instances 
# (prefix with distapp*)

Cockroach DB deployment

Step 1. Create a bridge network

$ docker network create -d bridge roachnet

Step 2. Start the cluster

  1. Create a Docker volume for each container:
$ docker volume create roach1
$ docker volume create roach2
$ docker volume create roach3
  1. Start the first node:
$ docker run -d \
--name=roach1 \
--hostname=roach1 \
--net=roachnet \
-p 26257:26257 -p 8080:8080  \
-v "roach1:/cockroach/cockroach-data"  \
cockroachdb/cockroach:v22.1.6 start \
--insecure \
--join=roach1,roach2,roach3
  1. Start two more nodes:
$ docker run -d \
--name=roach2 \
--hostname=roach2 \
--net=roachnet \
-v "roach2:/cockroach/cockroach-data" \
cockroachdb/cockroach:v22.1.6 start \
--insecure \
--join=roach1,roach2,roach3

$ docker run -d \
--name=roach3 \
--hostname=roach3 \
--net=roachnet \
-v "roach3:/cockroach/cockroach-data" \
cockroachdb/cockroach:v22.1.6 start \
--insecure \
--join=roach1,roach2,roach3
$ docker exec -it roach1 ./cockroach init --insecure

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages