Cannot connect to dgraph in VM from Host

Running latest nightly-build in a VM (HyperV)
but cannot connect from FF in host (Windows10-pro)

did try both - Server without and with “–bindall” - even thinking its not needed

root@ubu-16:/home/dgraph# dgraph zero --port_offset -2000 &
[1] 1285
root@ubu-16:/home/dgraph# Setting up grpc listener at: 0.0.0.0:5080
Setting up http listener at: 0.0.0.0:6080
2018/01/18 10:43:35 node.go:258: Group 0 found 0 entries
2018/01/18 10:43:35 raft.go:567: INFO: 1 became follower at term 0
2018/01/18 10:43:35 raft.go:315: INFO: newRaft 1 [peers: [], term: 0, commit: 0, applied: 0, lastindex: 0, lastterm: 0]
2018/01/18 10:43:35 raft.go:567: INFO: 1 became follower at term 1
Running Dgraph zero...
2018/01/18 10:43:35 node.go:127: Setting conf state to nodes:1
2018/01/18 10:43:38 raft.go:749: INFO: 1 is starting a new election at term 1
2018/01/18 10:43:38 raft.go:580: INFO: 1 became candidate at term 2
2018/01/18 10:43:38 raft.go:664: INFO: 1 received MsgVoteResp from 1 at term 2
2018/01/18 10:43:38 raft.go:621: INFO: 1 became leader at term 2
2018/01/18 10:43:38 node.go:301: INFO: raft.node: 1 elected leader 1 at term 2

root@ubu-16:/home/dgraph# dgraph server --memory_mb 4096 --zero localhost:5080 &
[2] 1296
root@ubu-16:/home/dgraph# 2018/01/18 10:45:18 groups.go:86: Current Raft Id: 0
2018/01/18 10:45:18 gRPC server started.  Listening on port 9080
2018/01/18 10:45:18 HTTP server started.  Listening on port 8080
2018/01/18 10:45:18 worker.go:99: Worker listening at address: [::]:7080
2018/01/18 10:45:18 pool.go:118: == CONNECT ==> Setting localhost:5080
2018/01/18 10:45:18 zero.go:322: Got connection request: addr:"localhost:7080"
2018/01/18 10:45:18 pool.go:118: == CONNECT ==> Setting localhost:7080
2018/01/18 10:45:18 zero.go:419: Connected
2018/01/18 10:45:18 groups.go:109: Connected to group zero. Connection state: member:<id:1 group_id:1 addr:"localhost:7080" > state:<counter:5 groups:<key:1 value:<members:<key:1 value:<id:1 group_id:1 addr:"localhost:7080" > > > > zeros:<key:1 value:<id:1 addr:"localhost:5080" leader:true > > maxRaftId:1 >
2018/01/18 10:45:18 draft.go:139: Node ID: 1 with GroupID: 1
2018/01/18 10:45:18 node.go:258: Group 1 found 0 entries
2018/01/18 10:45:18 draft.go:670: New Node for group: 1
2018/01/18 10:45:18 raft.go:567: INFO: 1 became follower at term 0
2018/01/18 10:45:18 raft.go:315: INFO: newRaft 1 [peers: [], term: 0, commit: 0, applied: 0, lastindex: 0, lastterm: 0]
2018/01/18 10:45:18 raft.go:567: INFO: 1 became follower at term 1
2018/01/18 10:45:18 groups.go:292: Asking if I can serve tablet for: _predicate_
2018/01/18 10:45:18 node.go:127: Setting conf state to nodes:1
2018/01/18 10:45:18 raft.go:749: INFO: 1 is starting a new election at term 1
2018/01/18 10:45:18 raft.go:580: INFO: 1 became candidate at term 2
2018/01/18 10:45:18 raft.go:664: INFO: 1 received MsgVoteResp from 1 at term 2
2018/01/18 10:45:18 raft.go:621: INFO: 1 became leader at term 2
2018/01/18 10:45:18 node.go:301: INFO: raft.node: 1 elected leader 1 at term 2
2018/01/18 10:45:18 mutation.go:155: Done schema update predicate:"_predicate_" value_type:STRING list:true

root@ubu-16:/home/dgraph# dgraph-ratel &
[3] 1312
root@ubu-16:/home/dgraph# 2018/01/18 10:45:28 Listening on port 8081...

in FF i use URL → http://192.168.0.67:8081/
and the page shows → Not connected (http://8080)

1 Like

While connecting from FF inside the VM works

@Kbrochier

A couple of questions for you.

  1. Does it say not connected after you changed the url to http://192.168.0.67:8080 in the browser?
  2. Is port 8080 exposed on the instance?

Inside the VM to connect to the host and the Internet the IP is set to 192.168.0.67 (by the DHCP in Windows-HyperV-virtual switch - which is a valid IP for the router outside the PC)

The dgraph-ratel inside the VM ist listening on port 8081
So from the browser i connect to http://192.168.0.67:8081
and set inside the dgraph-ratel webfrontend the serverconnection to port:8080

  • this did work until dgraph 1.0.1
  • now testing with dgraph 1.0.2 and the latest nightly-build it did not

Reason for these tests is to run a dgraph test environment in a server without a Monitor - eg inside a bigger multi-cpu server with various HyperV Ubuntu VM´s operated by Windows-Server
These servers have no display and the VM´s are managed by a remote Management-Console

For test the the dgraph-ratel application front end should be reached from other PC´s - both - from inside the LAN as well as from outside by a routed public-IP from the internet

Also in case we run out of local VM ressources its easy to transfer such a Ubuntu-VM into MS-Azure for a time limeted test in MS-Azure (very cost-effective for Big-Data tests with eg. Wikipedia-Dumps)

Here i tested it in a 2nd VM with IP 192.168.0.201 - same configuration > Ubuntu 16.04LTS


while running it on a local desktop inside the VM it works

1 Like

Can you try changing the Dgraph Server URL to 192.168.0.201:8080 and see if that works?

I think he’s using that way @pawan

Well, certainly this is forwarding problem.

You need to evaluate how the virtual machine’s network configuration is and how it is inside your “emulator”. For example, VirtualBox has the option of forwarding with the Host. When you use the same hardware there are recognition issues if you do not “native” forwarding with the VM emulator.

My claim would be wrong if you mention that even another computer on the same network with VM network access is having trouble accessing as well.

HyperV has a certain complexity for anyone who is familiar with simpler emulators when setting up virtual network card. I would suggest that you buy an off-board network card and use it as exclusive to the VM.

Or calmly analyze the HyperV settings for the Network.
by the way what is your local network configuration and what is the VM’s?

To see how they are try:

ipconfig in windows or ifconfig in Linux.

There are 3 different types of “Switches” in HyperV

  • extern - connects/publishes VM´s with host and internet
  • intern - connects/publishes VM´s with host only
  • private - connects only between VM´s

My setting is extern to allow connection from both: the host but also let me do some “apt”, “wget”, "curl etc
Setting of the switch


and in the VM i address the swich by the name of the switch
this returns me an IP by DHCP or i define an address in “/etc” - used DHCP

result

Problem is - it worked until dgraph 1.0.1

1 Like

Are you able to perform curl request to <ip:8080> from your machine? If you can, then this might be an issue with Ratel.

Also, some user mentioned that Ratel isn’t able to connect to Dgraph server if you have a trailing slash(/) in the url. Can you recheck the Dgraph server url for this?

OK thanx

  • i will try later - right now i set up the same environment on an other machine to compare both and will report

on 8080 it does answer

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

Ok, then its a browser or Dgraph Ratel issue. Can you see what is printed in the browser console when you change the url? Also, what browser are you using?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.