Configure Node with more than one local IP (Mojo branch): Difference between revisions

From The DXSpider Documentation Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
Add the variable '''@main::localhost_names''' to allow other IP addresses to be treated in the same way as localhost in '''Configure node with Dynamic IP (Mojo branch)'''.
NOTE: You do <b>NOT</> need to fiddle with this unless you specifically have more than just the normal definitions of localhost. So for 'normal' nodes with one external interface, <b>YOU DO NOT NEED TO DO ANY OF THIS</b>.
 
If you need to configure a node with more than one local IP address, you can do this in the Mojo branch. This allows other IP addresses to be treated in the same way as localhost.
 
These can be set in the '''/spider/scripts/startup'''
 
The variable '''@main::localhost_names''' is used to achieve this.


You must include ALL the normal localhost names + any other interface names that you might want to include:
You must include ALL the normal localhost names + any other interface names that you might want to include:
<pre>
<pre>
  set/var @main::localhost_names qw(127.0.0.1 ::1 192.168.1.30 172.16.0.20)
  set/var @main::localhost_names ('127.0.0.1', '::1', '192.168.1.30', '172.16.0.20')
</pre>
</pre>
using the qw() construction is easier than:
 
You can simplify this by using the qw() option, like this ...
 
<pre>
<pre>
  set/var @main::localhost_names ('127.0.0.1', '::1', '192.168.1.30', '172.16.0.20')
  set/var @main::localhost_names qw(127.0.0.1 ::1 192.168.1.30 172.16.0.20)
</pre>
</pre>
but either will work. You can define as many IP addresses as you like and they can be IPV4 or 6.
but either will work. You can define as many IP addresses as you like and they can be IPV4 or 6.


These can be set in the '''/spider/scripts/startup'''


To know the Local IPs you can use:
To find the Local IPs you can use the command:
 
<pre>
<pre>
hostname -I
hostname -I
</pre>
</pre>


For this variable to work, you must run it the first time:
from the command line.
 
You can also update the cluster immediately from the console by adding the line:
 
<pre>
<pre>
  set/var @main::localhost_names qw(127.0.0.1 ::1 192.168.1.30 172.16.0.20)
  set/var @main::localhost_names qw(127.0.0.1 ::1 192.168.1.30 172.16.0.20)
</pre>
</pre>


Do NOT need to fiddle with this unless you specifically have more than just the normal definitions of localhost. So for 'normal' nodes with one external interface, you DO NOT NEED TO DO ANY OF THIS.
Again, remember You do <b>NOT</b> need to fiddle with this unless you specifically have more than just the normal definitions of localhost. So for 'normal' nodes with one external interface, <b>YOU DO NOT NEED TO DO ANY OF THIS</b>.


There is a utility external to the project that performs the automatic search and update process.
(NOT SURE WHAT THIS LINE MEANS?  DOES THE EXTERNAL UTILITY SIMPLY LOOK FOR IP ADDRESSES?) There is a utility external to the project that performs the automatic search and update process.

Revision as of 07:55, 15 February 2023

NOTE: You do NOT</> need to fiddle with this unless you specifically have more than just the normal definitions of localhost. So for 'normal' nodes with one external interface, YOU DO NOT NEED TO DO ANY OF THIS.

If you need to configure a node with more than one local IP address, you can do this in the Mojo branch. This allows other IP addresses to be treated in the same way as localhost.

These can be set in the /spider/scripts/startup

The variable @main::localhost_names is used to achieve this.

You must include ALL the normal localhost names + any other interface names that you might want to include:

 set/var @main::localhost_names ('127.0.0.1', '::1', '192.168.1.30', '172.16.0.20')

You can simplify this by using the qw() option, like this ...

 set/var @main::localhost_names qw(127.0.0.1 ::1 192.168.1.30 172.16.0.20)

but either will work. You can define as many IP addresses as you like and they can be IPV4 or 6.


To find the Local IPs you can use the command:

hostname -I

from the command line.

You can also update the cluster immediately from the console by adding the line:

 set/var @main::localhost_names qw(127.0.0.1 ::1 192.168.1.30 172.16.0.20)

Again, remember You do NOT need to fiddle with this unless you specifically have more than just the normal definitions of localhost. So for 'normal' nodes with one external interface, YOU DO NOT NEED TO DO ANY OF THIS.

(NOT SURE WHAT THIS LINE MEANS? DOES THE EXTERNAL UTILITY SIMPLY LOOK FOR IP ADDRESSES?) There is a utility external to the project that performs the automatic search and update process.