2016-07-06 3 views
0

Ich habe einen Neo4j-Server, der gut funktioniert, aber wenn ich versuchte, einen Cluster einzurichten, kann ich nicht einfach herausfinden, warum es nicht funktioniert.Ich kann keinen Neo4j-Cluster einrichten

Um die Clusterarbeit zu machen, wie es scheint, ich muss nur die folgenden Zeilen uncoment:

ha.server_id = 3 
ha.initial_hosts =192.168.1.93:5001,192.168.1.91:5001 
dbms.mode=HA 

aber wenn ich so tun, ich habe einen Fehler in den Protokollen über den db Datei laden.

Das ist meine neo4j.conf Datei

#***************************************************************** 
# Neo4j configuration 
#***************************************************************** 

# The name of the database to mount 
dbms.active_database=graph.db 

# Paths of directories in the installation. 
dbms.directories.data=/var/lib/neo4j/data 
dbms.directories.plugins=/var/lib/neo4j/plugins 
#dbms.directories.certificates=certificates 

# This setting constrains all `LOAD CSV` import files to be under the `import` directory. Remove or uncomment it to 
# allow files to be loaded from anywhere in filesystem; this introduces possible security problems. See the `LOAD CSV` 
# section of the manual for details. 
dbms.directories.import=import 

# Whether requests to Neo4j are authenticated. 
# To disable authentication, uncomment this line 
#dbms.security.auth_enabled=false 

# Enable this to be able to upgrade a store from an older version. 
#dbms.allow_format_migration=true 

# The amount of memory to use for mapping the store files, in bytes (or 
# kilobytes with the 'k' suffix, megabytes with 'm' and gigabytes with 'g'). 
# If Neo4j is running on a dedicated server, then it is generally recommended 
# to leave about 2-4 gigabytes for the operating system, give the JVM enough 
# heap to hold all your transaction state and query context, and then leave the 
# rest for the page cache. 
# The default page cache memory assumes the machine is dedicated to running 
# Neo4j, and is heuristically set to 50% of RAM minus the max Java heap size. 
#dbms.memory.pagecache.size=10g 
# Enable online backups to be taken from this database. 
#dbms.backup.enabled=true 

# To allow remote backups, uncomment this line: 
#dbms.backup.address=0.0.0.0:6362 

#***************************************************************** 
# Network connector configuration 
#***************************************************************** 

# Bolt connector 
dbms.connector.bolt.type=BOLT 
dbms.connector.bolt.enabled=true 
dbms.connector.bolt.tls_level=OPTIONAL 
# To have Bolt accept non-local connections, uncomment this line 
# dbms.connector.bolt.address=0.0.0.0:7687 

# HTTP Connector 
dbms.connector.http.type=HTTP 
dbms.connector.http.enabled=true 
#dbms.connector.http.encryption=NONE 
# To have HTTP accept non-local connections, uncomment this line 
dbms.connector.http.address=0.0.0.0:7474 

# HTTPS Connector 
dbms.connector.https.type=HTTP 
dbms.connector.https.enabled=true 
dbms.connector.https.encryption=TLS 
dbms.connector.https.address=localhost:7473 

# Number of Neo4j worker threads. 
#dbms.threads.worker_count= 

#***************************************************************** 
# HA configuration 
#***************************************************************** 

# Uncomment and specify these lines for running Neo4j in High Availability mode. 
# See the High availability setup tutorial for more details on these settings 
# http://neo4j.com/docs/operations-manual/current/#tutorials 

# Database mode 
# Allowed values: 
# HA - High Availability 
# SINGLE - Single mode, default. 
# To run in High Availability mode uncomment this line: 
#dbms.mode=HA 

# ha.server_id is the number of each instance in the HA cluster. It should be 
# an integer (e.g. 1), and should be unique for each cluster instance. 
ha.server_id=5 

# ha.initial_hosts is a comma-separated list (without spaces) of the host:port 
# where the ha.host.coordination of all instances will be listening. Typically 
# this will be the same for all cluster instances. 
ha.initial_hosts=192.168.1.93:5001,192.168.1.91:5001 

# IP and port for this instance to listen on, for communicating cluster status 
# information iwth other instances (also see ha.initial_hosts). The IP 
# must be the configured IP address for one of the local interfaces. 
ha.host.coordination=127.0.0.1:5001 

# IP and port for this instance to listen on, for communicating transaction 
# data with other instances (also see ha.initial_hosts). The IP 
# must be the configured IP address for one of the local interfaces. 
ha.host.data=127.0.0.1:6001 

ha.pull_interval=10 

# Amount of slaves the master will try to push a transaction to upon commit 
# (default is 1). The master will optimistically continue and not fail the 
# transaction even if it fails to reach the push factor. Setting this to 0 will 
# increase write performance when writing through master but could potentially 
# lead to branched data (or loss of transaction) if the master goes down. 
#ha.tx_push_factor=1 

# Strategy the master will use when pushing data to slaves (if the push factor 
# is greater than 0). There are three options available "fixed_ascending" (default), 
# "fixed_descending" or "round_robin". Fixed strategies will start by pushing to 
# slaves ordered by server id (accordingly with qualifier) and are useful when 
# planning for a stable fail-over based on ids. 
#ha.tx_push_strategy=fixed_ascending 

# Policy for how to handle branched data. 
#ha.branched_data_policy=keep_all 

# How often heartbeat messages should be sent. Defaults to ha.default_timeout. 
#ha.heartbeat_interval=5s 

# Timeout for heartbeats between cluster members. Should be at least twice that of ha.heartbeat_interval. 
#ha.heartbeat_timeout=11s 

# If you are using a load-balancer that doesn't support HTTP Auth, you may need to turn off authentication for the 
# HA HTTP status endpoint by uncommenting the following line. 
#dbms.security.ha_status_auth_enabled=false 

# Whether this instance should only participate as slave in cluster. If set to 
# true, it will never be elected as master. 
#ha.slave_only=false 

Danke

Antwort

1

Zunächst einmal, wenn Sie einen Fehler beim Start zu bekommen, ist das Mindeste, was Sie tun könnten es Zitat hier, sonst gibt es nicht viel Jeder kann etwas dagegen tun.

In Bezug auf Ihre Konfiguration gibt es mindestens einen Fehler: Um an einem Cluster mit anderen Hosts mit IP-Adressen wie 192.168.1.93 und 192.168.1.91 teilzunehmen, müssen Sie diesen Host für die Kommunikation im selben Netzwerk einrichten, nicht auf Loopback (dh 127.0.0.1), mit denen andere Hosts keine Verbindung herstellen können.

Wenn dieser Host z.B. 192.168.1.93, das ist, was Sie verwenden müssen:

ha.initial_hosts=192.168.1.93:5001,192.168.1.91:5001 
ha.host.coordination=192.168.1.93:5001 
ha.host.data=192.168.1.93:6001 

Allerdings, wenn Ihr Host 192.168.1.92 hat, müssen Sie es ha.initial_hosts hinzuzufügen (die gleich auf allen Hosts ist, wie im Kommentar erwähnt, und nicht die Liste der anderen Hosts):

ha.initial_hosts=192.168.1.93:5001,192.168.1.92:5001,192.168.1.91:5001 
ha.host.coordination=192.168.1.92:5001 
ha.host.data=192.168.1.92:6001