Vários ips com a mesma porta

0

Estou tentando usar vários endereços IP e executar a mesma porta. Isto é para endereços IP multicraft e dedicados.

Eu tenho a configuração das interfaces de rede como:

ifcfg-eno1
ifcfg-eno1:0 
ifcfg-eno1:1
ifcfg-eno1:2
ifcfg-eno1:3

e apenas alterou os endereços IP para 192.xxx.xxx.147,148,149,150.

Quando faço ping, ele retorna ao servidor, mas quando tento usar multicraft, ele não consegue ligar à porta.

Aqui estão as interfaces (apenas o ip mudou por um)

DEVICE="eno1"
ONBOOT=yes
NETBOOT=yes
UUID="14081356-1da3-49ca-a25d-3ed9fe2fcd32"
IPV6INIT=yes
BOOTPROTO=none
TYPE=Ethernet
DNS1=127.0.0.1
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPADDR=192.xxx.xxx.146
PREFIX=29
GATEWAY=192.xxx.xxx.145
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes

O erro:

WARN **** FAILED TO BIND TO PORT!
13.03 01:41:25 [Server] WARN The exception was: java.net.BindException: Address already in use
13.03 01:41:25 [Server] WARN Perhaps a server is already running on that port?

Saída do Netstat:

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:21              0.0.0.0:*               LISTEN      11397/multicraft    
tcp        0      0 127.0.0.1:53            0.0.0.0:*               LISTEN      24745/named         
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      24771/sshd          
tcp        0      0 0.0.0.0:25465           0.0.0.0:*               LISTEN      11397/multicraft    
tcp        0      0 127.0.0.1:953           0.0.0.0:*               LISTEN      24745/named         
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      1841/master         
tcp        0      0 0.0.0.0:25565           0.0.0.0:*               LISTEN      7912/java           
tcp6       0      0 :::3306                 :::*                    LISTEN      22341/mysqld        
tcp6       0      0 :::80                   :::*                    LISTEN      1555/httpd          
tcp6       0      0 ::1:53                  :::*                    LISTEN      24745/named         
tcp6       0      0 :::8118                 :::*                    LISTEN      19667/java          
tcp6       0      0 :::22                   :::*                    LISTEN      24771/sshd          
tcp6       0      0 ::1:953                 :::*                    LISTEN      24745/named         
tcp6       0      0 ::1:25                  :::*                    LISTEN      1841/master         
tcp6       0      0 :::443                  :::*                    LISTEN      1555/httpd          
tcp6       0      0 192.xxx.xxx.146:25567   :::*                    LISTEN      22781/java          
tcp6       0      0 192.xxx.xxx.146:8192    :::*                    LISTEN      19667/java          
tcp6       0      0 192.xxx.xxx.146:25568   :::*                    LISTEN      19667/java          
tcp6       0      0 192.xxx.xxx.146:8193    :::*                    LISTEN      15346/java          
tcp6       0      0 192.xxx.xxx.146:25569   :::*                    LISTEN      11462/java          
tcp6       0      0 192.xxx.xxx.146:25570   :::*                    LISTEN      15346/java          
tcp6       0      0 192.xxx.xxx.147:25571   :::*                    LISTEN      20296/java          
tcp6       0      0 :::25575                :::*                    LISTEN      7912/java           
udp        0      0 127.0.0.1:53            0.0.0.0:*                           24745/named         
udp        0      0 0.0.0.0:25565           0.0.0.0:*                           7912/java           
udp6       0      0 ::1:53                  :::*                                24745/named         
udp6       0      0 192.xxx.xxx.146:25568   :::*                                19667/java          
raw6       0      0 :::58                   :::*                    7           673/NetworkManager  
Active UNIX domain sockets (only servers)
Proto RefCnt Flags       Type       State         I-Node   PID/Program name     Path
unix  2      [ ACC ]     STREAM     LISTENING     8458     1/systemd            /run/systemd/journal/stdout
unix  2      [ ACC ]     STREAM     LISTENING     9741     1/systemd            /run/lvm/lvmetad.socket
unix  2      [ ACC ]     STREAM     LISTENING     9761     1/systemd            /run/lvm/lvmpolld.socket
unix  2      [ ACC ]     STREAM     LISTENING     12606    1/systemd            /var/run/dbus/system_bus_socket
unix  2      [ ACC ]     STREAM     LISTENING     15793    1841/master          public/pickup
unix  2      [ ACC ]     STREAM     LISTENING     15797    1841/master          public/cleanup
unix  2      [ ACC ]     STREAM     LISTENING     15800    1841/master          public/qmgr
unix  2      [ ACC ]     STREAM     LISTENING     15804    1841/master          private/tlsmgr
unix  2      [ ACC ]     STREAM     LISTENING     15807    1841/master          private/rewrite
unix  2      [ ACC ]     STREAM     LISTENING     15810    1841/master          private/bounce
unix  2      [ ACC ]     STREAM     LISTENING     15813    1841/master          private/defer
unix  2      [ ACC ]     STREAM     LISTENING     15816    1841/master          private/trace
unix  2      [ ACC ]     STREAM     LISTENING     80989    1/systemd            /run/systemd/private
unix  2      [ ACC ]     STREAM     LISTENING     15819    1841/master          private/verify
unix  2      [ ACC ]     STREAM     LISTENING     15822    1841/master          public/flush
unix  2      [ ACC ]     STREAM     LISTENING     15825    1841/master          private/proxymap
unix  2      [ ACC ]     STREAM     LISTENING     15828    1841/master          private/proxywrite
unix  2      [ ACC ]     STREAM     LISTENING     15831    1841/master          private/smtp
unix  2      [ ACC ]     STREAM     LISTENING     15834    1841/master          private/relay
unix  2      [ ACC ]     STREAM     LISTENING     15837    1841/master          public/showq
unix  2      [ ACC ]     STREAM     LISTENING     15840    1841/master          private/error
unix  2      [ ACC ]     STREAM     LISTENING     15843    1841/master          private/retry
unix  2      [ ACC ]     STREAM     LISTENING     15846    1841/master          private/discard
unix  2      [ ACC ]     STREAM     LISTENING     15849    1841/master          private/local
unix  2      [ ACC ]     STREAM     LISTENING     15852    1841/master          private/virtual
unix  2      [ ACC ]     STREAM     LISTENING     15855    1841/master          private/lmtp
unix  2      [ ACC ]     STREAM     LISTENING     15858    1841/master          private/anvil
unix  2      [ ACC ]     STREAM     LISTENING     15861    1841/master          private/scache
unix  2      [ ACC ]     STREAM     LISTENING     67741    22341/mysqld         /var/lib/mysql/mysql.sock
unix  2      [ ACC ]     SEQPACKET  LISTENING     78068    1/systemd            /run/udev/control
unix  2      [ ACC ]     STREAM     LISTENING     14841    673/NetworkManager   /var/run/NetworkManager/private

ifconfig:

eno1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
    inet 192.xxx.xxx.146  netmask 255.255.255.248  broadcast 192.xxx.xxx.151
    inet6 fe80::7254:d2ff:feab:bebf  prefixlen 64  scopeid 0x20<link>
    ether 70:54:d2:ab:be:bf  txqueuelen 1000  (Ethernet)
    RX packets 177249286  bytes 48701330667 (45.3 GiB)
    RX errors 0  dropped 0  overruns 0  frame 0
    TX packets 282601048  bytes 51923351153 (48.3 GiB)
    TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
    device interrupt 20  memory 0xf7f00000-f7f20000  

eno1:0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.xxx.xxx.147  netmask 255.255.255.248  broadcast 192.xxx.xxx.151
        ether 70:54:d2:ab:be:bf  txqueuelen 1000  (Ethernet)
        device interrupt 20  memory 0xf7f00000-f7f20000  

eno1:1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.xxx.xxx.148  netmask 255.255.255.248  broadcast 192.xxx.xxx.151
        ether 70:54:d2:ab:be:bf  txqueuelen 1000  (Ethernet)
        device interrupt 20  memory 0xf7f00000-f7f20000  

eno1:2: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.xxx.xxx.149  netmask 255.255.255.248  broadcast 192.xxx.xxx.151
        ether 70:54:d2:ab:be:bf  txqueuelen 1000  (Ethernet)
        device interrupt 20  memory 0xf7f00000-f7f20000  

eno1:3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.xxx.xxx.150  netmask 255.255.255.248  broadcast 192.xxx.xxx.151
        ether 70:54:d2:ab:be:bf  txqueuelen 1000  (Ethernet)
        device interrupt 20  memory 0xf7f00000-f7f20000  

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 0  (Local Loopback)
        RX packets 1815319739  bytes 455426211814 (424.1 GiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1815319739  bytes 455426211814 (424.1 GiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Multicraft Conf: link

    
por Tom Grozev 13.03.2017 / 02:52

1 resposta

0

A permissão de várias instâncias de multicraft na mesma máquina, todas usando a mesma porta, você precisará definir um endereço específico a ser usado para cada instância. Se a instância estiver configurada para usar 0.0.0.0 , ela será vinculada a todas as interfaces e qualquer outra instância não será vinculada.

Exemplo de uma instância, um endereço:

## The daemon will listen on the following IP/port.
## 0.0.0.0 to listen on all available interfaces (all IPs). Note that
## you will have to use the "externalIp" setting below if you set this
## to 0.0.0.0 as the control panel needs to know where to connect.
ip = 192.xxx.xxx.147
port = 25465

Note que você precisará alterar o 192.xxx.xxx.147 para um endereço real.

    
por 14.03.2017 / 04:10