From b40f257179d85b7fa2d681809ac024967d7ed955 Mon Sep 17 00:00:00 2001 From: Yuce Tekol Date: Wed, 16 May 2018 17:00:22 +0300 Subject: [PATCH 1/4] Added Docker cluster tutorial --- docs/tutorials.md | 82 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) diff --git a/docs/tutorials.md b/docs/tutorials.md index 39e345dbd..acdf3d72a 100644 --- a/docs/tutorials.md +++ b/docs/tutorials.md @@ -238,6 +238,88 @@ curl -k --ipv4 https://02.pilosa.local:10502/index/sample-index/query -d 'Bitmap Check out our [Administration Guide](https://www.pilosa.com/docs/latest/administration/) to learn more about making the most of your Pilosa cluster and [Configuration Documentation](https://www.pilosa.com/docs/latest/configuration/) to see the available options to configure Pilosa. +### Setting Up a Docker Cluster + +In this tutorial, we will be setting up a 2-node Pilosa cluster using Docker containers. The instructions below require Docker 1.13 or better. + +Let's first create a virtual network to attach our containers. We are going to name our network `pilosanet`: + +``` +docker network create pilosanet +``` + +Let's run the first Pilosa node and attach it to that virtual network. We set the first node as the cluster coordinator and use its address as the gossip seed. And also set the server address to `pilosa1`: +``` +docker run -it --rm --name pilosa1 -p 10101:10101 --network="pilosanet" pilosa/pilosa:latest server --bind pilosa1 --cluster.coordinator=true --gossip.seeds=pilosa1:14000 +``` + +Let's run the second Pilosa node and attach it to the virtual network as well. Note that we set the address of the gossip seed to the address of the first node: +``` +docker run -it --rm --name pilosa2 -p 10102:10101 --network="pilosanet" pilosa/pilosa:latest server --bind pilosa2 --gossip.seeds=pilosa1:14000 +``` + +Let's test that the nodes in the cluster connected with each other: +``` +curl localhost:10101/status +``` + +That should return something like: +``` +{"state":"NORMAL","nodes":[{"id":"2e8332d0-1fee-44dd-a359-e0d6ecbcefc1","uri":{"scheme":"http","host":"pilosa1","port":10101},"isCoordinator":true},{"id":"8c0dbcdc-9503-4265-8ad2-ba85a4bb10fa","uri":{"scheme":"http","host":"pilosa2","port":10101},"isCoordinator":false}]}``` +``` + +And similarly for the second node: +``` +curl localhost:10102/status +``` + +Outputs: + +``` +{"state":"NORMAL","nodes":[{"id":"123146fd-f25a-414b-9eb7-4619e8001858","uri":{"scheme":"http","host":"pilosa1","port":10101},"isCoordinator":true},{"id":"4dc45f41-6f9c-4417-ad0e-67522bfeef89","uri":{"scheme":"http","host":"pilosa2","port":10101},"isCoordinator":false}]} +``` + +The corresponding [Docker Compose](https://docs.docker.com/compose/) file is below: + +```yaml +version: '2' +services: + pilosa1: + image: pilosa/pilosa:v0.9.0 + ports: + - "10101:10101" + environment: + - PILOSA_CLUSTER_COORDINATOR=true + - PILOSA_GOSSIP_SEEDS=pilosa1:14000 + networks: + - pilosanet + entrypoint: + - /pilosa + - server + - --bind + - "pilosa1:10101" + pilosa2: + image: pilosa/pilosa:v0.9.0 + environment: + - PILOSA_GOSSIP_SEEDS=pilosa1:14000 + networks: + - pilosanet + entrypoint: + - /pilosa + - server + - --bind + - "pilosa2:10101" +networks: + pilosanet: +``` + +#### What's Next? + +Check out our [Administration Guide](https://www.pilosa.com/docs/latest/administration/) to learn more about making the most of your Pilosa cluster and [Configuration Documentation](https://www.pilosa.com/docs/latest/configuration/) to see the available options to configure Pilosa. + +Refer to the [Docker documentation](https://docs.docker.com) to see your options about running Docker containers. + + ### Using Integer Field Values From f3eed9de2a8d5f451ecd249b52925ceff639fe23 Mon Sep 17 00:00:00 2001 From: Yuce Tekol Date: Wed, 16 May 2018 17:24:32 +0300 Subject: [PATCH 2/4] docker cluster tutorial updates --- docs/tutorials.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/docs/tutorials.md b/docs/tutorials.md index acdf3d72a..6faeb57b1 100644 --- a/docs/tutorials.md +++ b/docs/tutorials.md @@ -242,7 +242,12 @@ Check out our [Administration Guide](https://www.pilosa.com/docs/latest/administ In this tutorial, we will be setting up a 2-node Pilosa cluster using Docker containers. The instructions below require Docker 1.13 or better. -Let's first create a virtual network to attach our containers. We are going to name our network `pilosanet`: +Let's first be sure that the Pilosa image is up to date: +``` +docker pull pilosa/pilosa:latest +``` + +Then, create a virtual network to attach our containers. We are going to name our network `pilosanet`: ``` docker network create pilosanet @@ -285,7 +290,7 @@ The corresponding [Docker Compose](https://docs.docker.com/compose/) file is bel version: '2' services: pilosa1: - image: pilosa/pilosa:v0.9.0 + image: pilosa/pilosa:latest ports: - "10101:10101" environment: @@ -299,7 +304,7 @@ services: - --bind - "pilosa1:10101" pilosa2: - image: pilosa/pilosa:v0.9.0 + image: pilosa/pilosa:latest environment: - PILOSA_GOSSIP_SEEDS=pilosa1:14000 networks: @@ -320,7 +325,6 @@ Check out our [Administration Guide](https://www.pilosa.com/docs/latest/administ Refer to the [Docker documentation](https://docs.docker.com) to see your options about running Docker containers. - ### Using Integer Field Values #### Introduction From 059810b99fb1f24558a33891c1aec01b46841331 Mon Sep 17 00:00:00 2001 From: Yuce Tekol Date: Thu, 17 May 2018 05:12:28 +0300 Subject: [PATCH 3/4] Docker cluster update --- docs/tutorials.md | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/docs/tutorials.md b/docs/tutorials.md index 6faeb57b1..1d047e370 100644 --- a/docs/tutorials.md +++ b/docs/tutorials.md @@ -264,26 +264,24 @@ docker run -it --rm --name pilosa2 -p 10102:10101 --network="pilosanet" pilosa/p ``` Let's test that the nodes in the cluster connected with each other: -``` +``` request curl localhost:10101/status ``` That should return something like: -``` -{"state":"NORMAL","nodes":[{"id":"2e8332d0-1fee-44dd-a359-e0d6ecbcefc1","uri":{"scheme":"http","host":"pilosa1","port":10101},"isCoordinator":true},{"id":"8c0dbcdc-9503-4265-8ad2-ba85a4bb10fa","uri":{"scheme":"http","host":"pilosa2","port":10101},"isCoordinator":false}]}``` +``` response +{"state":"NORMAL","nodes":[{"id":"2e8332d0-1fee-44dd-a359-e0d6ecbcefc1","uri":{"scheme":"http","host":"pilosa1","port":10101},"isCoordinator":true},{"id":"8c0dbcdc-9503-4265-8ad2-ba85a4bb10fa","uri":{"scheme":"http","host":"pilosa2","port":10101},"isCoordinator":false}]} ``` And similarly for the second node: -``` +``` request curl localhost:10102/status ``` Outputs: - +``` response +{"state":"NORMAL","nodes":[{"id":"2e8332d0-1fee-44dd-a359-e0d6ecbcefc1","uri":{"scheme":"http","host":"pilosa1","port":10101},"isCoordinator":true},{"id":"8c0dbcdc-9503-4265-8ad2-ba85a4bb10fa","uri":{"scheme":"http","host":"pilosa2","port":10101},"isCoordinator":false}]} ``` -{"state":"NORMAL","nodes":[{"id":"123146fd-f25a-414b-9eb7-4619e8001858","uri":{"scheme":"http","host":"pilosa1","port":10101},"isCoordinator":true},{"id":"4dc45f41-6f9c-4417-ad0e-67522bfeef89","uri":{"scheme":"http","host":"pilosa2","port":10101},"isCoordinator":false}]} -``` - The corresponding [Docker Compose](https://docs.docker.com/compose/) file is below: ```yaml From b4aa9013a46e7614fc197e17d444edb7169f19a1 Mon Sep 17 00:00:00 2001 From: Yuce Tekol Date: Thu, 17 May 2018 05:26:46 +0300 Subject: [PATCH 4/4] Updated Docker cluster tutorial --- docs/tutorials.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/docs/tutorials.md b/docs/tutorials.md index 1d047e370..08a05b4ed 100644 --- a/docs/tutorials.md +++ b/docs/tutorials.md @@ -267,8 +267,6 @@ Let's test that the nodes in the cluster connected with each other: ``` request curl localhost:10101/status ``` - -That should return something like: ``` response {"state":"NORMAL","nodes":[{"id":"2e8332d0-1fee-44dd-a359-e0d6ecbcefc1","uri":{"scheme":"http","host":"pilosa1","port":10101},"isCoordinator":true},{"id":"8c0dbcdc-9503-4265-8ad2-ba85a4bb10fa","uri":{"scheme":"http","host":"pilosa2","port":10101},"isCoordinator":false}]} ``` @@ -277,8 +275,6 @@ And similarly for the second node: ``` request curl localhost:10102/status ``` - -Outputs: ``` response {"state":"NORMAL","nodes":[{"id":"2e8332d0-1fee-44dd-a359-e0d6ecbcefc1","uri":{"scheme":"http","host":"pilosa1","port":10101},"isCoordinator":true},{"id":"8c0dbcdc-9503-4265-8ad2-ba85a4bb10fa","uri":{"scheme":"http","host":"pilosa2","port":10101},"isCoordinator":false}]} ```