Dgraph Ratel problem with virtual box and Bridged Networking

Hello.
I have some problem with dgraph ratel.
OS Windows 10 1909 18363.657
VirtualBox 6.1.4 r136177
Ubuntu Server 18.04

gigihont@ubn:~$ dgraph version
[Decoder]: Using assembly version of decoder

Dgraph version   : v2.0.0-rc1
Dgraph SHA-256   : 447ca408b0e56702568f25ceab89eb712090f5f19f06752b70b9a28ca1260cd6
Commit SHA-1     : a4af81a36
Commit timestamp : 2020-02-14 17:05:06 -0800
Branch           : HEAD
Go version       : go1.13.7

I using type to connection “Bridged Networking” in virtual box.

I started zero, alpha and ratel

My ip addr is:

gigihont@ubn:~$ ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 08:00:27:a2:e5:bc brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.97/24 brd 192.168.1.255 scope global dynamic enp0s3
       valid_lft 64870sec preferred_lft 64870sec
    inet6 fe80::a00:27ff:fea2:e5bc/64 scope link
       valid_lft forever preferred_lft forever
dgraph zero --my=192.168.1.97:5080 -w zeroSingle | tee -a Zero_output.txt
dgraph alpha --my=192.168.1.97:7080 --lru_mb=3512 --zero=192.168.1.97:5080 -p serverS/p -w serverS/w -o 0 | tee -a Server_output.txt
dgraph-ratel

gigihont@ubn:~$ sudo netstat -plnt
[sudo] password for gigihont:
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      2618/nginx: master
tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      623/systemd-resolve
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      793/sshd
tcp6       0      0 :::8000                 :::*                    LISTEN      3677/dgraph-ratel
tcp6       0      0 :::6080                 :::*                    LISTEN      2076/dgraph
tcp6       0      0 :::7080                 :::*                    LISTEN      3493/dgraph
tcp6       0      0 :::8080                 :::*                    LISTEN      3493/dgraph
tcp6       0      0 :::80                   :::*                    LISTEN      2618/nginx: master
tcp6       0      0 :::22                   :::*                    LISTEN      793/sshd
tcp6       0      0 :::9080                 :::*                    LISTEN      3493/dgraph
tcp6       0      0 :::5080                 :::*                    LISTEN      2076/dgraph
gigihont@ubn:~$ nmap 192.168.1.97

Starting Nmap 7.60 ( https://nmap.org ) at 2020-02-27 18:54 UTC
Nmap scan report for ubn (192.168.1.97)
Host is up (0.00012s latency).
Not shown: 994 closed ports
PORT     STATE SERVICE
22/tcp   open  ssh
80/tcp   open  http
5080/tcp open  onscreen
8000/tcp open  http-alt
8080/tcp open  http-proxy
9080/tcp open  glrpc

Nmap done: 1 IP address (1 host up) scanned in 0.10 seconds

When I try to use ratel, it can’t connect to the server

Go client works fine.

What is the URL in “Enter Dgraph server URL:”? (Ratel)

gigihont@ubn:~$ dgraph-ratel -addr=192.168.1.97
Error parsing Dgraph server address: host is empty

I use command:
dgraph-ratel

The URL must be like:

192.168.1.97:8080

oh, I’m not talking about this. I’m talking about Ratel. What address have you added in the panel “ Enter Dgraph server URL: ”?

gigihont@ubn:~$ dgraph-ratel -addr=192.168.1.97:8080
Error parsing Dgraph server address: parse 192.168.1.97:8080: first path segment in URL cannot contain colon

Don’t start ratel with this addr command (don’t even need it). And that’s not the point. What only matters is the address in the UI. Not in the command that starts the UI.

You have it pointed to 192.168.1.97:8000 which is the same address of Ratel UI. Instead, you should use 192.168.1.97:8080 which is the Dgraph HTTP API. Just switch this and you good to go.

1 Like

Oh, It works perfect.

1 Like