Ratel UI Setup with Docker Swarm

Is there documentation on how to setup the UI with Docker Swarm / HA

Creating network dgraph_dgraph
Creating service dgraph_zero
Creating service dgraph_alpha1
Creating service dgraph_alpha2
Creating service dgraph_alpha3
bmcclelland@:/data$ sudo docker service ls
ID             NAME            MODE         REPLICAS   IMAGE                  PORTS
igdu6ivpr6rs   dgraph_alpha1   replicated   0/1        dgraph/dgraph:latest   *:8080->8080/tcp, *:9080->9080/tcp
jly1hy5wni9q   dgraph_alpha2   replicated   0/1        dgraph/dgraph:latest   *:8081->8081/tcp, *:9081->9081/tcp
2tdcjhsoagdf   dgraph_alpha3   replicated   0/1        dgraph/dgraph:latest   *:8082->8082/tcp, *:9082->9082/tcp
nkw6kiu2p2jb   dgraph_zero     replicated   0/1        dgraph/dgraph:latest   *:5080->5080/tcp, *:6080->6080/tcp


It says the service created a network, but no  Service Name was listed?? 

I have this now in my browser

Dgraph browser is available for running separately using the dgraph-ratel binary

http request from http://localhost:8080

This instance of Dgraph will send anonymous reports of panics back to Dgraph Labs via Sentry. No confidential information is sent. These reports help improve Dgraph. To opt-out, restart your instance with the --telemetry “sentry=false;” flag. For more info, see How To Guides - Howto.
I0707 21:26:27.692344 57 init.go:110]

Dgraph version : v21.03.0
Dgraph codename : rocket
Dgraph SHA-256 : b4e4c77011e2938e9da197395dbce91d0c6ebb83d383b190f5b70201836a773f
Commit SHA-1 : a77bbe8ae
Commit timestamp : 2021-04-07 21:36:38 +0530
Branch : HEAD
Go version : go1.16.2
jemalloc enabled : true

For Dgraph official documentation, visit Get started with Dgraph
For discussions about Dgraph , visit
For fully-managed Dgraph Cloud ,

Licensed variously under the Apache Public License 2.0 and Dgraph Community License.
Copyright 2015-2021 Dgraph Labs, Inc.

It looks like I have it setup and running, just don’t know how to access the darn UI

any help is appreciated, as this is a brand new deployment for me

Specifically for Ratel you shall use this image in the link Docker Hub

1 Like

Hey Michel!!! Thanks for the reply, do I need to remove or stop services that were created from the other setups — will this break that Docker Pull ?

looks like I still have

7a9545f524c2   dgraph/dgraph:v21.03.0 

and also

ID             NAME            MODE         REPLICAS   IMAGE                  PORTS
igdu6ivpr6rs   dgraph_alpha1   replicated   0/1        dgraph/dgraph:latest   *:8080->8080/tcp, *:9080->9080/tcp
jly1hy5wni9q   dgraph_alpha2   replicated   0/1        dgraph/dgraph:latest   *:8081->8081/tcp, *:9081->9081/tcp
2tdcjhsoagdf   dgraph_alpha3   replicated   0/1        dgraph/dgraph:latest   *:8082->8082/tcp, *:9082->9082/tcp
nkw6kiu2p2jb   dgraph_zero     replicated   0/1        dgraph/dgraph:latest   *:5080->5080/tcp, *:6080->6080/tcp

I have the image downloaded, but not sure what that does for me…

I’m a bit new with docker/images or at least deploying them correctly

475f496e67f8: Pull complete
Digest: sha256:f34ac9708541c56dc922b40c537d7b113fead503bd788815da8da0a10a35038f
Status: Downloaded newer image for dgraph/ratel:latest
docker.io/dgraph/ratel:latest

Still displaying the same error

Dgraph browser is available for running separately using the dgraph-ratel binary

Available images showing


REPOSITORY      TAG        IMAGE ID       CREATED        SIZE
dgraph/dgraph   <none>     1043ca38d68e   2 weeks ago    155MB
dgraph/ratel    latest     98e9777f3b57   7 weeks ago    26.7MB
dgraph/dgraph   v21.03.0   740c1f56163c   3 months ago   154MB
hello-world     latest     d1165f221234   4 months ago   13.3kB

Hey @Blackbear710 , what helps is to know how did you run it. Show me the commands. Or the YAML, or better, the commands in the YAML.

wget https://github.com/dgraph-io/dgraph/raw/master/contrib/config/docker/docker-compose-multi.yml




# This file can be used to setup a Dgraph cluster with 3 Dgraph Alphas and 1 Dgraph Zero node on a
# Docker Swarm with replication.
# It expects three virtual machines with hostnames aws01, aws02, and aws03 to be part of the swarm.
# There is a constraint to make sure that each Dgraph Alpha runs on a particular host.

# Data would be persisted to a Docker volume called data-volume on the virtual machines which are
# part of the swarm.
# Run `docker stack deploy -c docker-compose-multi.yml` on the Swarm leader to start the cluster.

version: "3.2"
networks:
  dgraph:
services:
  zero:
    image: dgraph/dgraph:latest
    volumes:
      - data-volume:/dgraph
    ports:
      - 5080:5080
      - 6080:6080
    networks:
      - dgraph
    deploy:
      placement:
        constraints:
          - node.hostname == aws01
    command: dgraph zero --my=zero:5080 --replicas 3
  alpha1:
    image: dgraph/dgraph:latest
    hostname: "alpha1"
    volumes:
      - data-volume:/dgraph
    ports:
      - 8080:8080
      - 9080:9080
    networks:
      - dgraph
    deploy:
      placement:
        constraints:
          - node.hostname == aws01
    command: dgraph alpha --my=alpha1:7080 --zero=zero:5080
  alpha2:
    image: dgraph/dgraph:latest
    hostname: "alpha2"
    volumes:
      - data-volume:/dgraph
    ports:
      - 8081:8081
      - 9081:9081
    networks:
      - dgraph
    deploy:
      replicas: 1
      placement:
        constraints:
          - node.hostname == aws02
    command: dgraph alpha --my=alpha2:7081 --zero=zero:5080 -o 1
  alpha3:
    image: dgraph/dgraph:latest
    hostname: "alpha3"
    volumes:
      - data-volume:/dgraph
    ports:
      - 8082:8082
      - 9082:9082
    networks:
      - dgraph
    deploy:
      replicas: 1
      placement:
        constraints:
          - node.hostname == aws03
    command: dgraph alpha --my=alpha3:7082 --zero=zero:5080 -o 2
volumes:
  data-volume:

I just changed the aws hostnames to my own; as we do not do Cloud Deployments. This will be on Prem

Also @MichelDiz — Can we do this Without Docker?? That would be preferred

The Standalone Image came from

https://dgraph.io/tour/intro/2/#expand

Yes, if you are on Linux. But your issue is related to Docker Swarm, right?

I’m not seeing Ratel in the YAML.

There’s no Docker Swarm in the tour. oO

Well, just add

  ratel:
    image: dgraph/ratel:latest
    ports:
      - 8000:8000
    networks:
      - dgraph
    deploy:
      placement:
        constraints:
          - node.hostname == aws01
    command: dgraph-ratel

Or just use http://play.dgraph.io/

I got the Ratel Image running — just can’t get the UI up correctly. Probably something Docker/Network related

**play.dgraph.io/

this wouldn’t work unfortunately, as I need to build it on our Servers — its not to play around with

its hopefully for production

Do you mean you can’t connect to the cluster? check the IP. Docker Swarm works differently. Maybe you need to hit the host IP, or the virtual machine. The address alpha1:8080 won’t work outside of Docker context. As it is an internal services. And Ratel UI is running in your Browser, besides its service is in the container.

Just adding on to this in case this is not obvious. You will have to expose an endpoint of Dgraph Alpha HTTP(S) service. On a production scenario, this should never be accessible, so you would then need to go through an SSH jump host or a VPN to access a private internal-facing LB that hits the Dgraph Alpha service.

The Ratel is only a client, so it can run on a laptop, or if desired, from the private network as well. If
you can run curl https://alpha.example.com:8080/health (replace FQDN to IP or hostname you are using) works fine, then the same address will work with Ratel’s connection configuration.

1 Like

Gotta wait 5 Hours for my next reply, wompp womppp

@MichelDiz correct, I am sure it is some type of Docker / Network Issue

I’m kind of getting thrown into the fire but that’s alright, I don’t really know much about connecting to containers outside of the container, if that makes sense

I got " Why are they using Docker Swarm for this!!! See if you can get it working with Docker, if not, find a way to not use Docker Swarm"

It seems like I have it deployed, just networking /docker dependencies that I am not familiar with

I assume it has nothing to do with yalls YAML/Apps (I’m gonna add the Ratel YAML and remove the deploy constraints since its not aws)

Classic case of, its not you its me (but this time its actually just me) :rofl:

Also, there is a config that you should pay attention - this one https://dgraph.io/docs/deploy/dgraph-administration/#whitelisting-admin-operations
When you working with different networks you have to explicitly warn Dgraph about them.

1 Like

thanks for popping in Joaquin, I agree with this statement fully. I will just need to do some more research on configuring endpoints for docker/https so I am able to connect to Ratel UI

thanks, I just saw this recently as well, will be looking into that doc