Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not make miner work with daemon running on another host #4209

Closed
Shekelme opened this issue Oct 7, 2020 · 1 comment
Closed

Can not make miner work with daemon running on another host #4209

Shekelme opened this issue Oct 7, 2020 · 1 comment

Comments

@Shekelme
Copy link

Shekelme commented Oct 7, 2020

Describe the bug
I was trying to deploy lotus daemon on dedicated server to free resources on my miner. According to this manual I configured my config.toml on daemon side in this way:

[API]
  ListenAddress = "/ip4/192.168.0.19/tcp/9200/http"

Here 192.168.0.19 is LAN IP of my daemon server and 9200 is the port choosen for miner-daemon interaction.
All other lines in config.toml are commented out. I did not touch RemoteListenAddress since it's only relevant for lotus-miner.
Note that previously, when daemon and miner were on same server, I didn't touch daemon's config at all. Everything was working well.
On miner side I exported the environment variable

FULLNODE_API_INFO=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJBbGxvdyI6WyJyZfFkIiwid3JpdGUiLCJzaWduIiwiYWRtaW4iXX0.pa8dg-5Q8-LT4ZiIOI_XXBRx5abdLNqgKI420uJri2E:/ip4/192.168.0.19/tcp/9200/http
According to the manual, these steps should be sufficient for successful interaction between the miner and the daemon over the network.
But I got this: the miner does not start. Error from miner log:

ERROR: failed to dial 12D3KooWFUj9tSg1GJ5rswTh6zXJ4g9K58nLupjTfwecjXD6hQdD: all dials failed
  * [/ip4/127.0.0.1/tcp/37041] dial tcp4 127.0.0.1:37041: connect: connection refused
  * [/ip6/::1/tcp/37579] dial tcp6 [::1]:37579: connect: connection refused
  * [/ip4/80.89.156.216/tcp/37041] dial tcp4 80.89.156.216:37041: connect: connection refused
  * [/ip4/192.168.0.19/tcp/37041] dial tcp4 0.0.0.0:12128->192.168.0.19:37041: i/o timeout
2020-10-07T02:49:04.558+0700    WARN    events  events/events.go:97     listenHeadChanges quit

Where did this port 37041 come from? Ok, I open this port on both servers and this is what happens: the miner starts, but not all requests are successful.

rabinovitch@burstmine:~$ lotus-miner sealing workers
Worker 0, host burstmine
        CPU:  [                                                                ] 0 core(s) in use
        RAM:  [|||||||                                                         ] 12% 15.52 GiB/125.7 GiB
        VMEM: [|||                                                             ] 4% 15.52 GiB/313.3 GiB
        GPU: GeForce RTX 2080 Ti, not used
rabinovitch@burstmine:~$ lotus-miner sealing jobs
ID  Sector  Worker  Hostname  Task  State  Time
rabinovitch@burstmine:~$ lotus-miner sectors list
ERROR: could not get API info: could not get api endpoint: API not running (no endpoint)
rabinovitch@burstmine:~$ lotus-miner actor control list
ERROR: could not get API info: could not get api endpoint: API not running (no endpoint)

lotus-miner storage list is not in this quote, but it was working too.
Since it was already deep at night, I switched to the old scheme and did not check further interaction between the miner and the remote daemon - it was difficult to do without the miner's monitoring commands.

To Reproduce
Try to organize the interaction between the miner and the remote daemon in accordance with the current documentation.

Expected behavior
After completing all the steps required by the instructions, the miner should interact with the remote daemon completely transparent to the user.

Version (run lotus version):
Remote daemon (master branch):

Daemon:  0.8.1+git.97087fe5+api0.16.0
Local: lotus version 0.8.1+git.97087fe5

Miner (v0.8.1 branch, only /lotus/extern/sector-storage/resources.go has been modified):

Daemon:  0.8.1+git.1ebad94d.dirty+api0.16.0
Local: lotus version 0.8.1+git.1ebad94d.dirty

Additional context
Perhaps I am missing or misunderstood something, maybe additionally the address and port should be configured in the [Libp2p] section of daemon's config.toml, but why was this not required earlier for the interaction between the demon and the miner? And now they work within the same host without additional configuration of the demon's config and everything is fine.

@Shekelme
Copy link
Author

Shekelme commented Oct 7, 2020

OK, finally it is working.
On daemon side config.toml looks like this:

# Default config:
[API]
  ListenAddress = "/ip4/192.168.0.19/tcp/9200/http"
  RemoteListenAddress = "192.168.0.19:9200"
  Timeout = "30s"
#
[Libp2p]
  ListenAddresses = ["/ip4/0.0.0.0/tcp/12129"]
#  AnnounceAddresses = ["/ip4/0.0.0.0/tcp/12129"]
# all other lines are commented too

May be not all of these lines are necessary, but let it work as is.
I think the issue can be closed, and the documentation updated, since it looks that we need to configure static port for daemon in case it runs on a different host than miner. And also it looks that we have to allow this port with ufw if it is in use.
Perhaps some of this is superfluous, I cannot check while there are tasks in progress. But it is working.

@Shekelme Shekelme closed this as completed Oct 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant