Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Second node doesn't connect to master node
#1
Hello Everyone,

I am having an issue where my second node will not connect to the master node. When I try to connect the second node there seems to be a conflict and the master node will start to disconnect and reconnect. 

I followed https://skywug.net/forum/Thread-Raspberr...TNET-READY and then realized that the commands to start the nodes were incorrect according to the GitHub so I then used https://github.com/skycoin/skywire as my guide.

I have no issues with the master node running by itself and connecting to it through the web. So I am not quite sure what is going on with the second node. I imagine I am missing something simple but I cannot seem to figure it out through either guides I followed.

Hardware: 
2x Raspberry Pi 3 B+

Network: 
Master Node - 192.168.86.11
Second Node - 192.168.86.12


Masternode Commands:

Code:
nohup $GOPATH/bin/skywire-manager -web-dir ${GOPATH}/src/github.com/skycoin/skywire/static/skywire-manager > /dev/null 2>&1 &sleep 3

nohup $GOPATH/bin/skywire-node -connect-manager -manager-address :5998 -manager-web :8000 -discovery-address discovery.skycoin.net:5999-034b1cd4ebad163e457fb805b3ba43779958bba49f2c5e1e8b062482904bacdb68 -address :5000 -web-port :6001 > /dev/null 2>&1 &cd /

Second Node Commands:

Code:
nohup $GOPATH/bin/skywire-node -connect-manager -manager-address 192.168.86.11:5998 -manager-web 192.168.86.11:8000 -discovery-address discovery.skycoin.net:5999-034b1cd4ebad163e457fb805b3ba43779958bba49f2c5e1e8b062482904bacdb68 -address :5000 -web-port :6001 > /dev/null 2>&1 &cd /
Reply
#2
(04-08-2019, 12:33 AM)Stosh15x Wrote: Hello Everyone,

I am having an issue where my second node will not connect to the master node. When I try to connect the second node there seems to be a conflict and the master node will start to disconnect and reconnect. 

I followed https://skywug.net/forum/Thread-Raspberr...TNET-READY and then realized that the commands to start the nodes were incorrect according to the GitHub so I then used https://github.com/skycoin/skywire as my guide.

I have no issues with the master node running by itself and connecting to it through the web. So I am not quite sure what is going on with the second node. I imagine I am missing something simple but I cannot seem to figure it out through either guides I followed.

Hardware: 
2x Raspberry Pi 3 B+

Network: 
Master Node - 192.168.86.11
Second Node - 192.168.86.12


Masternode Commands:

Code:
nohup $GOPATH/bin/skywire-manager -web-dir ${GOPATH}/src/github.com/skycoin/skywire/static/skywire-manager > /dev/null 2>&1 &sleep 3

nohup $GOPATH/bin/skywire-node -connect-manager -manager-address :5998 -manager-web :8000 -discovery-address discovery.skycoin.net:5999-034b1cd4ebad163e457fb805b3ba43779958bba49f2c5e1e8b062482904bacdb68 -address :5000 -web-port :6001 > /dev/null 2>&1 &cd /

Second Node Commands:

Code:
nohup $GOPATH/bin/skywire-node -connect-manager -manager-address 192.168.86.11:5998 -manager-web 192.168.86.11:8000 -discovery-address discovery.skycoin.net:5999-034b1cd4ebad163e457fb805b3ba43779958bba49f2c5e1e8b062482904bacdb68 -address :5000 -web-port :6001 > /dev/null 2>&1 &cd /


Try this command


Code:
nohup $GOPATH/bin/node -connect-manager -manager-address 192.168.86.11:5998 -manager-web 192.168.86.11:8000 -discovery-address discovery.skycoin.net:5999-034b1cd4ebad163e457fb805b3ba43779958bba49f2c5e1e8b062482904bacdb68 -address :5000 -web-port :6001 > /dev/null 2>&1 &cd /
Reply
#3
(04-09-2019, 08:12 PM)skyguy Wrote: Try this command

Code:
nohup $GOPATH/bin/node -connect-manager -manager-address 192.168.86.11:5998 -manager-web 192.168.86.11:8000 -discovery-address discovery.skycoin.net:5999-034b1cd4ebad163e457fb805b3ba43779958bba49f2c5e1e8b062482904bacdb68 -address :5000 -web-port :6001 > /dev/null 2>&1 &cd /

Thank you skyguy for looking into this!

That command doesn't work because $GOPATH/bin/node isn't a valid binary file. The files were renamed to skywire-manager and skywire-node

Your command was the original command found in the https://skywug.net/forum/Thread-Raspberr...TNET-READY guide which is why I had to use the https://github.com/skycoin/skywire guide
Reply
#4
(04-10-2019, 02:32 PM)Stosh15x Wrote:
(04-09-2019, 08:12 PM)skyguy Wrote: Try this command

Code:
nohup $GOPATH/bin/node -connect-manager -manager-address 192.168.86.11:5998 -manager-web 192.168.86.11:8000 -discovery-address discovery.skycoin.net:5999-034b1cd4ebad163e457fb805b3ba43779958bba49f2c5e1e8b062482904bacdb68 -address :5000 -web-port :6001 > /dev/null 2>&1 &cd /

Thank you skyguy for looking into this!

That command doesn't work because $GOPATH/bin/node isn't a valid binary file. The files were renamed to skywire-manager and skywire-node

Your command was the original command found in the https://skywug.net/forum/Thread-Raspberr...TNET-READY guide which is why I had to use the https://github.com/skycoin/skywire guide

What happens if you output to the screen? Try your original command without writing the output to dev null


Code:
nohup $GOPATH/bin/skywire-node -connect-manager -manager-address 192.168.86.11:5998 -manager-web 192.168.86.11:8000 -discovery-address discovery.skycoin.net:5999-034b1cd4ebad163e457fb805b3ba43779958bba49f2c5e1e8b062482904bacdb68 -address :5000 -web-port :6001
Reply
#5
(04-10-2019, 08:47 PM)skyguy Wrote: What happens if you output to the screen? Try your original command without writing the output to dev null


Code:
nohup $GOPATH/bin/skywire-node -connect-manager -manager-address 192.168.86.11:5998 -manager-web 192.168.86.11:8000 -discovery-address discovery.skycoin.net:5999-034b1cd4ebad163e457fb805b3ba43779958bba49f2c5e1e8b062482904bacdb68 -address :5000 -web-port :6001

It writes to the nohup.out file. Once I read through this file it looks like both nodes have the same public key. Are they supposed to? If not how do I change it?
Reply
#6
(04-10-2019, 10:49 PM)Stosh15x Wrote:
(04-10-2019, 08:47 PM)skyguy Wrote: What happens if you output to the screen? Try your original command without writing the output to dev null


Code:
nohup $GOPATH/bin/skywire-node -connect-manager -manager-address 192.168.86.11:5998 -manager-web 192.168.86.11:8000 -discovery-address discovery.skycoin.net:5999-034b1cd4ebad163e457fb805b3ba43779958bba49f2c5e1e8b062482904bacdb68 -address :5000 -web-port :6001

It writes to the nohup.out file. Once I read through this file it looks like both nodes have the same public key. Are they supposed to? If not how do I change it?

You can generate new keys by removing all the sub folders in the skywire folder (discovery / node / ss). Not sure if yours are in /root/.skywire or a different directory?

After launch the node command again, your new keys will be created

I use the following bash script to start my nodes - /usr/local/sbin/skywire-start

*Modify to match your directory structure 

Code:
#!/bin/bash
# Start script for skywire manager and node

# Set GO PATH
export GOPATH=/root/go

# Skywire Manager Start
cd $GOPATH/bin
exec ./manager -web-dir ${GOPATH}/src/github.com/skycoin/skywire/static/skywire-manager > /dev/null 2>&1 &

# Skywire Node Start
exec ./node -connect-manager -manager-address 192.168.0.2:5998 -manager-web 192.168.0.2:8000 -discovery-address discovery.skycoin.net:5999-034b1cd4ebad163e457fb805b3ba43779958bba49f2c5e1e8b062482904bacdb68 -address :5000 -web-port :6001 > /dev/null 2>&1 &

I then run it as a service in /etc/systemd/system - skywire.service

Code:
[Unit]
Description=Skywire Service
After=network-online.target

[Service]
User=root
Group=root
Type=forking
ExecStart=/usr/local/sbin/skywire-start

[Install]
WantedBy=multi-user.target

To activate the service, run the following command "systemctl enable skywire.service", followed by "systemctl start skywire.service"

Check that the node and manager are running using the ps command

Code:
ps -ef |grep node

Code:
ps -ef |grep manager


If they are working correctly, I'll send you the instructions and scripts for the monitor node
Reply
#7
(04-11-2019, 05:05 AM)skyguy Wrote: You can generate new keys by removing all the sub folders in the skywire folder (discovery / node / ss). Not sure if yours are in /root/.skywire or a different directory?

After launch the node command again, your new keys will be created

I use the following bash script to start my nodes - /usr/local/sbin/skywire-start

*Modify to match your directory structure 

Code:
#!/bin/bash
# Start script for skywire manager and node

# Set GO PATH
export GOPATH=/root/go

# Skywire Manager Start
cd $GOPATH/bin
exec ./manager -web-dir ${GOPATH}/src/github.com/skycoin/skywire/static/skywire-manager > /dev/null 2>&1 &

# Skywire Node Start
exec ./node -connect-manager -manager-address 192.168.0.2:5998 -manager-web 192.168.0.2:8000 -discovery-address discovery.skycoin.net:5999-034b1cd4ebad163e457fb805b3ba43779958bba49f2c5e1e8b062482904bacdb68 -address :5000 -web-port :6001 > /dev/null 2>&1 &

I then run it as a service in /etc/systemd/system - skywire.service

Code:
[Unit]
Description=Skywire Service
After=network-online.target

[Service]
User=root
Group=root
Type=forking
ExecStart=/usr/local/sbin/skywire-start

[Install]
WantedBy=multi-user.target

To activate the service, run the following command "systemctl enable skywire.service", followed by "systemctl start skywire.service"

Check that the node and manager are running using the ps command

Code:
ps -ef |grep node

Code:
ps -ef |grep manager


If they are working correctly, I'll send you the instructions and scripts for the monitor node

So your trick with deleting the items in the .skywire directory worked for getting a new key and it also stopped the conflict between the two nodes. However the manager still does not see the second node. Am I supposed to manually tell the master node that the second node exists? Or does the second node need to be whitelisted before the master will see it?

Also thank you for the script. I will implement that as soon as I can get this working.
Reply
#8
(04-11-2019, 10:56 PM)Stosh15x Wrote:
(04-11-2019, 05:05 AM)skyguy Wrote: You can generate new keys by removing all the sub folders in the skywire folder (discovery / node / ss). Not sure if yours are in /root/.skywire or a different directory?

After launch the node command again, your new keys will be created

I use the following bash script to start my nodes - /usr/local/sbin/skywire-start

*Modify to match your directory structure 

Code:
#!/bin/bash
# Start script for skywire manager and node

# Set GO PATH
export GOPATH=/root/go

# Skywire Manager Start
cd $GOPATH/bin
exec ./manager -web-dir ${GOPATH}/src/github.com/skycoin/skywire/static/skywire-manager > /dev/null 2>&1 &

# Skywire Node Start
exec ./node -connect-manager -manager-address 192.168.0.2:5998 -manager-web 192.168.0.2:8000 -discovery-address discovery.skycoin.net:5999-034b1cd4ebad163e457fb805b3ba43779958bba49f2c5e1e8b062482904bacdb68 -address :5000 -web-port :6001 > /dev/null 2>&1 &

I then run it as a service in /etc/systemd/system - skywire.service

Code:
[Unit]
Description=Skywire Service
After=network-online.target

[Service]
User=root
Group=root
Type=forking
ExecStart=/usr/local/sbin/skywire-start

[Install]
WantedBy=multi-user.target

To activate the service, run the following command "systemctl enable skywire.service", followed by "systemctl start skywire.service"

Check that the node and manager are running using the ps command

Code:
ps -ef |grep node

Code:
ps -ef |grep manager


If they are working correctly, I'll send you the instructions and scripts for the monitor node

So your trick with deleting the items in the .skywire directory worked for getting a new key and it also stopped the conflict between the two nodes. However the manager still does not see the second node. Am I supposed to manually tell the master node that the second node exists? Or does the second node need to be whitelisted before the master will see it?

Also thank you for the script. I will implement that as soon as I can get this working.

Add the following scripts and service on the monitor node

skywire-start script in /usr/local/sbin. Update binary name to match your convention

Code:
#!/bin/bash
# Start script for skywire monitor and node

# Set GO PATH
export GOPATH=/root/go

# Skywire Manager Start
cd $GOPATH/bin
exec ./manager -web-dir ${GOPATH}/src/github.com/skycoin/skywire/static/skywire-manager > /dev/null 2>&1 &

# Skywire Node Start
exec ./node -connect-manager -manager-address :5998 -manager-web :8000 -discovery-address discovery.skycoin.net:5999-034b1cd4ebad163e457fb805b3ba43779958bba49f2c5e1e8b062482904bacdb68  -address :5000 -web-port :6001 > /dev/null 2>&1 &

skywire.service script in /etc/systemd/system

Code:
[Unit]
Description=Skywire Service
After=network-online.target

[Service]
User=root
Group=root
Type=forking
ExecStart=/usr/local/sbin/skywire-start

[Install]
WantedBy=multi-user.target

Then run "systemctl enable skywire.service", followed by "systemctl start skywire.service" to activate
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)