Failed to restart neo4j after conf ip address backup

backup

(Dimitri) #1

Hi all,

I host my own neo4j db (version 3.4.9 - Edition entreprise) .
It's running on CentOS Linux release 7.5.1804 (Core)

I running backup from a separate server (https://neo4j.com/docs/operations-manual/current/backup/standalone/#backup-standalone-separate) and it's work fine.

This is my configuration for backup (neo4j.conf)

# Enable online backups to be taken from this database.
dbms.backup.enabled=true
# By default the backup service will only listen on localhost.
# To enable remote backups you will have to bind to an external
dbms.backup.address=0.0.0.0:6362

Problem is my backup is not secure, it's free on internet if you know my IP database, so I want to bind an external address (ip of my server where I run backup)

So this is my IP : 51.255.X.X

I configure neo4j.conf like this

dbms.backup.address=51.255.X.X:6362

And when I restart neo4j, it's failed and I have this error is my log : Cannot assign requested address

2019-02-11 18:03:08.165+0000 ERROR Failed to start Neo4j: Starting Neo4j failed: Component 'org.neo4j.server.database.LifecycleManagingDatabase@f5cf29b' was successfully initialized, but failed to start. Please see the attached cause exception "Cannot assign requested address". Starting Neo4j failed: Component 'org.neo4j.server.database.LifecycleManagingDatabase@f5cf29b' was successfully initialized, but failed to start. Please see the attached cause exception "Cannot assign requested address".
org.neo4j.server.ServerStartupException: Starting Neo4j failed: Component 'org.neo4j.server.database.LifecycleManagingDatabase@f5cf29b' was successfully initialized, but failed to start. Please see the attached cause exception "Cannot assign requested address".
        at org.neo4j.server.exception.ServerStartupErrors.translateToServerStartupError(ServerStartupErrors.java:68)
        at org.neo4j.server.AbstractNeoServer.start(AbstractNeoServer.java:220)
        at org.neo4j.server.ServerBootstrapper.start(ServerBootstrapper.java:111)
        at org.neo4j.server.ServerBootstrapper.start(ServerBootstrapper.java:79)
        at com.neo4j.server.enterprise.CommercialEntryPoint.main(CommercialEntryPoint.java:22)
Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.server.database.LifecycleManagingDatabase@f5cf29b' was successfully initialized, but failed to start. Please see the attached cause exception "Cannot assign requested address".
        at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:466)
        at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:107)
        at org.neo4j.server.AbstractNeoServer.start(AbstractNeoServer.java:212)
        ... 3 more
Caused by: java.lang.RuntimeException: Error starting org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory, /var/lib/neo4j/data/databases/graph.db
        at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.initFacade(GraphDatabaseFacadeFactory.java:212)
        at org.neo4j.kernel.enterprise.EnterpriseGraphDatabase.<init>(EnterpriseGraphDatabase.java:39)
        at org.neo4j.server.enterprise.OpenEnterpriseNeoServer.lambda$static$1(OpenEnterpriseNeoServer.java:78)
        at org.neo4j.server.database.LifecycleManagingDatabase.start(LifecycleManagingDatabase.java:88)
        at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:445)
        ... 5 more
Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.backup.OnlineBackupKernelExtension@2da16263' was successfully initialized, but failed to start. Please see the attached cause exception "Cannot assign requested address".
        at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:466)
        at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:107)
        at org.neo4j.kernel.extension.KernelExtensions.start(KernelExtensions.java:84)
        at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:445)
        at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:107)
        at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.initFacade(GraphDatabaseFacadeFactory.java:208)
        ... 9 more
Caused by: java.lang.RuntimeException: java.io.IOException: org.jboss.netty.channel.ChannelException: Failed to bind to: /51.255.X.X:6362
        at org.neo4j.backup.OnlineBackupKernelExtension.start(OnlineBackupKernelExtension.java:151)
        at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:445)
        ... 14 more
        Suppressed: org.neo4j.kernel.lifecycle.LifecycleException: Exception during graceful attempt to stop partially started component. Please use non suppressed exception to see original component failure.
                at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:457)
                ... 14 more
        Caused by: java.lang.NullPointerException
                at org.neo4j.com.Server.stop(Server.java:213)
                at org.neo4j.backup.OnlineBackupKernelExtension.stop(OnlineBackupKernelExtension.java:161)
                at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:453)
                ... 14 more
Caused by: java.io.IOException: org.jboss.netty.channel.ChannelException: Failed to bind to: /51.255.X.X:6362
        at org.neo4j.com.Server.start(Server.java:202)
        at org.neo4j.backup.OnlineBackupKernelExtension.start(OnlineBackupKernelExtension.java:132)
        ... 15 more
Caused by: org.jboss.netty.channel.ChannelException: Failed to bind to: /51.255.X.X:6362
        at org.jboss.netty.bootstrap.ServerBootstrap.bind(ServerBootstrap.java:272)
        at org.neo4j.com.PortRangeSocketBinder.bindToFirstAvailablePortInRange(PortRangeSocketBinder.java:67)
        at org.neo4j.com.Server.start(Server.java:187)
        ... 16 more
Caused by: java.net.BindException: Cannot assign requested address
        at sun.nio.ch.Net.bind0(Native Method)
        at sun.nio.ch.Net.bind(Net.java:433)
        at sun.nio.ch.Net.bind(Net.java:425)
        at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
        at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
        at org.jboss.netty.channel.socket.nio.NioServerBoss$RegisterTask.run(NioServerBoss.java:193)
        at org.jboss.netty.channel.socket.nio.AbstractNioSelector.processTaskQueue(AbstractNioSelector.java:391)
        at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:315)
        at org.jboss.netty.channel.socket.nio.NioServerBoss.run(NioServerBoss.java:42)
        at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)
        at org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
        at org.neo4j.helpers.NamedThreadFactory$2.run(NamedThreadFactory.java:110)
2019-02-11 18:03:08.166+0000 INFO  Neo4j Server shutdown initiated by request

And if I put again dbms.backup.address=0.0.0.0:6362 is working

Thanks for help


(Michael Hunger) #2

Are you sure that address is bound to one of your network interfaces?


(Michael Hunger) #3

Googling found me this for the error message


(Dimitri) #4

Micheal, I don't understand when you say

Are you sure that address is bound to one of your network interfaces?

How I can check this ?

But maybe I need to open port 6362 in my backup server ? (but is my backup server who is connecting to db neo4j server)

So I open port in firewall (and reload) but when I test connection on this port is failed (but is OK with ssh

vagrant@homestead:~/code/spb-api$ nc -v -z 51.255.X.X 6362
nc: connect to 51.255.X.X port 6362 (tcp) failed: Connection refused
vagrant@homestead:~/code/spb-api$ nc -v -z 51.255.X.X 22
Connection to 51.255.X.X 22 port [tcp/ssh] succeeded!

This is my firewall config on backup server

root@backup:~# firewall-cmd --list-all
public (active)
  target: default
  icmp-block-inversion: no
  interfaces: eth0
  sources:
  services: ssh dhcpv6-client http https
  ports: 6362/tcp
  protocols:
  masquerade: yes
  forward-ports:
  source-ports:
  icmp-blocks:
  rich rules:

And when I check if port is open with netstat I don't see this port

root@backup:~# netstat -plnt
Connexions Internet actives (seulement serveurs)
Proto Recv-Q Send-Q Adresse locale          Adresse distante        Etat        PID/Program name
tcp        0      0 127.0.0.1:9100          0.0.0.0:*               LISTEN      5139/noderig
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      4955/sshd
tcp6       0      0 :::22                   :::*                    LISTEN      4955/sshd


(Dimitri) #5

I do another solution

I accept only my backup server IP on port 6362 on my db server in firewall.
So in neo4j.conf I have this dbms.backup.address=0.0.0.0:6362

It's work well but I would have preferred used neo4j configuration file to do this