Export a (sub)graph to Cypher script and import it again

Oftentimes you want to export a full (or partial) database to a file and import it again without copying the actual database files. If you want to do the latter, use neo4j-admin dump/load. Here are two ways on how to… Read more →

Explore:  


Cluster: org.neo4j.kernel.impl.transaction.log.NoSuchTransactionException: Unable to find transaction 1 in any of my logical logs: Couldn’t find any log containing 1

When operating a causal cluster, if “the store” (data/databases/graph.db) is removed from a server that was previously a member of the cluster we will get the following exception when that server is started: java.lang.RuntimeException: Error starting org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory, /path/to/neo4j/data/databases/graph.db at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.initFacade(GraphDatabaseFacadeFactory.java:209)… Read more →

Explore:  


How do I convert Neo4j logs from base UTC to local timezone

With the introduction of Neo4j 3.3.1 it is possible to represent date timestamps in your $NEO4J_HOME/logs/* in either UTC or SYSTEM timezone through the implementation of dbms.logs.timezone However for prior releases all Neo4j logs will preface each line with a… Read more →

Explore:  


Setup Neo4j Service to run with different service ID

By default when neo4j is installed as an RPM via yum or apt-get, it creates a user neo4j and group neo4j and runs as neo4j user. However it might be required to run Neo4j service as another service id other… Read more →

Explore:  


How to properly shutdown a Neo4j database after receiving the message took more than 120 seconds to stop

The neo4j script under the bin/ directory of any standard Neo4j install is the primary means of shutting down a running Neo4j instance. That script accepts a stop argument that will try to shutdown the running instance by sending a… Read more →

Explore:  


How to avoid costly traversals with join hints

When matching a pattern using Cypher, the number of possible paths to evaluate often correlates with query execution time. When there is a supernode in the path (a node with a high number of relationships whose type are included in… Read more →

Explore:  


Causal Cluster FAQ for heavy workloads

Lagging of follower instances and what causes it? The main reason for followers to fall behind is highly concurrent and continuous read/write workloads. This can cause the instances get overwhelmed which causes some extra latency in propagating the data to… Read more →

Explore:  


Properly escaping input data for neo4j-import

Note neo4j-import is intended to populate a new, empty database. It cannot be used to import into an existing database. When importing data using neo4j-import, make sure to review the required CSV file structure and considerations before moving on. http://neo4j.com/docs/stable/import-tool.html… Read more →

Explore:  


Understanding transaction and lock timeouts

One way to handle runaway queries is to impose a time limit that will terminate a query when exceeded. There are some subtleties here that need to be understood to ensure proper behavior and avoid confusion. Defining a transaction timeout… Read more →

Explore:  


How do I configure init and max java heap when running bin/neo4j-backup

When running $NEO4J_HOME/bin/neo4j-backup if a Java out of heap/memory error occurs you may want define the init and max Java heap to be used by neo4j-backup. The default behavior is to allow the JVM to define the init and max… Read more →

Explore:  


A light weight approach to validating network port connectivity

If it becomes necessary to validate, particularly in a clustered environment whether Causal Cluster or High Availability, whether or not 1 instance can talk to another instance on a given port one can use linux command netcat. To Validate connectivity… Read more →

Explore:  


java.lang.OutOfMemoryError: unable to create new native thread

When a client application establishes a session with a Neo4j server via the bolt or bolt+routing protocols, the server allocates a thread to serve as the server-side bolt worker to handle that connection. There is no server-side limitation on the… Read more →

Explore:  


Stopping the Neo4j docker image in order to restore from a backup

In a neo4j docker installation, the neo4j-admin restore requires the neo4j service to be stopped as one can’t do a restore on a running database. Subsequently, running as a docker image, stopping neo4j server could be done using a Ctrl-C… Read more →

Explore:  


Will execution_guard_enabled work in my release of Neo4j?

Background From the beginning, the execution guard was never meant to be used by the general public. However, the feature was there in the product, though undocumented, and it did work for the purpose of preventing long running queries from… Read more →

Explore:  


How deletes work in Neo4j

Neo4j uses logical deletes to delete from the database to achieve maximum performance and scalability. To understand how this might appear to an operator of the database, lets take a simple case of loading data into Neo4j. When you start… Read more →

Explore:  


How do I authenticate with cypher-shell without specifying the username and password on the command line

When using $NEO4J_HOME/bin/cypher-shell at the command line and authentication is enabled via the setting $NEO4J_HOME/conf/neo4j.conf: # Whether requests to Neo4j are authenticated. # To disable authentication, uncomment this line dbms.security.auth_enabled=true a username and password can be provided on the command… Read more →

Explore:  


Neo4j’s commit process explained

This article will try to guide you through Neo4j’s commit and replication processes both for single instances and causal clusters.   Single Instance When you call tx.commit(), the transaction will go through the Storage Engine which will transform that transaction… Read more →

Explore:  


Limiting MATCH results per row

Since LIMIT applies to the total number of rows of the query, it can’t be used in cases when matching from multiple nodes where the limit must be on match results per row. Take an example case using the Movies… Read more →

Explore:  


Are my cluster transactions/messages encrypted.

For all versions prior to 3.3, there is no encryption done specifically on the contents being transferred. Furthermore, since it doesn’t use REST or Bolt, there is no SSL/https configuration either. Transactions are propagated via transaction logs, which are a… Read more →

Explore:  


Creating and working with linked lists in Cypher

At some point when working with a graph, you may want to create a linked list out of some nodes. If each of the nodes to be linked has its own variable, this is easy, you just do a CREATE… Read more →

Explore:  


How to configure mixed-mode security (native and LDAP) in Neo4j

For environments where you need both LDAP authentication as well as some native user accounts, there is a way to allow this in Neo4j 3.1 and newer. Use the configuration setting dbms.security.auth_providers instead of the singular version dbms.security.auth_provider. This will… Read more →

Explore:  


Understanding aggregations on zero rows

Aggregations in Cypher can be tricky in some cases. Notably, when performing aggregation right after a MATCH where there are no matches, or after a filter operation that filters out all results. In some cases a query using aggregations in… Read more →

Explore:  


Explanation of error “Unrecognized transaction id. Transaction may have timed out and been rolled back”

When submitting a request via the Neo4j Transactional Cypher HTTP endpoint, one may encounter the following error Unrecognized transaction id. Transaction may have timed out and been rolled back This error may occur as a result of the transactions expiration… Read more →

Explore:  


Long GC Pauses caused by application code calling System.gc()

When investigating the cause of long garbage collection cycles, it is often useful to enable GC logging. You can do so by following the product documentation. Once this is enabled, you can look through the GC log file for signs… Read more →

Explore:  


An example of neo4j-import steps in a Causal Cluster environment

The following steps are provided to describe how to use neo4j-import in a Causal Cluster environment and was run from an environment of a single linux host with 3 copies for Neo4j 3.1.2 installed in the following paths ~/HA/ha1/neo4j-enterprise-3.1.2 ~/HA/ha2/neo4j-enterprise-3.1.2… Read more →

Explore: