Giter Club home page Giter Club logo

rancher-swarm-weave's Introduction

rancher-swarm-weave

In this tutorial we’re going to show you how to provision a Docker Warm cluster with Rancher and how to visualize and monitor the cluster with Weave Scope.

Rancher server setup

In order to install the Rancher server you'll need a Linux box with Docker 17.06 or later. Deploy Rancher server with this command:

docker run -dp 8080:8080 --name=rancher --restart=unless-stopped rancher/server

Once the container is up you can access the Rancher UI from your browser on port 8080. The first thing you should do is to setup authentication. Navigate to the Access control section, chose the local authority for the Rancher Management interface and create an admin user with a password.

Docker Swarm setup

In order to provision Docker Swarm with Rancher you have to create a new environment. In Rancher UI select Manage Environments from the dropdown of environments, click on Add Environment and select an environment template that has Swarm as the orchestration.

env

After the Swarm environment has been created, you can navigate to the environment by selecting the name of the environment in the environment’s dropdown. For Swarm to work correctly you'll have to create 3 hosts. From the Infrastructure dropdown select Hosts and click on Add Host.

When creating the hosts make sure they are in the same network and the host OS kernel has the IP_VS_NFCT module enabled. Using Ubuntu 16.04 LTS will the mainline kernel should work fine. You can check if the host OS is compatible with Docker Swarm by running the Moby check-config.sh script.

Once the hosts have been added, Rancher will automatically start the deployment of the infrastructure services including the Swarm components and the Portainer containers. You can see the progress of the deployment by accessing Infrastructure Hosts from the menu.

hosts

When the health checks of all hosts are passing you can access Portainer from the Swarm dropdown. In Portainer UI you can see the Swarm cluster members by selecting Swarm from the left side menu.

portainer

Weave Scope setup

Now that you have a Docker Swarm cluster up and running you can start monitoring it with Weave Scope. You'll need a Weave Could service token, if you don't have a Weave token go to Weave Cloud and sign up for a Weave Cloud account.

In order to visualize the Swarm cluster with Weave Cloud you have to deploy the Weave Scope container on each Swarm node. Like the Rancher infrastructure services, Scope needs to run with privileged mode and because Swarm services don't support privileged mode you'll have to use a one-shot service that will provision each node with a Scope container.

In Rancher UI navigate to Swarm CLI and create the scope-launcher global service with the following command:

docker service create --name scope-launcher --mode global --detach \
    --restart-condition none \
    --mount type=bind,src=/var/run/docker.sock,dst=/var/run/docker.sock \
    weaveworks/scope-swarm-launcher \
    scope launch --service-token=<WEAVE-CLOUD-TOKEN>

In Rancher UI navigate to Infrastructure containers and look for weavescope, you should see 3 containers running, one on each host:

scope_list

The launcher will install Scope on each server and will exit. Using --restart-condition none we instruct Docker Swarm not to restart the service after it exits.

launcher_list

With --mode global we make sure Scope will be automatically deployed on new servers as you add them to the swarm.

Once the Scope containers are running on all hosts you can login into Weave Cloud and inspect your cluster.

scope

With Weave Cloud Scope you can see your Rancher hosts, Docker containers and services in real-time. You can view metrics, tags and metadata of the running processes, containers or hosts. It’s the idea tool to visualize your Docker Swarm clusters and troubleshoot problems that may arise. Scope offers remote access to the Swarm’s nods and containers making it easy to diagnose issues in real-time.

rancher-swarm-weave's People

Contributors

stefanprodan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.