neo4j cluster: No such log version - neo4j

I try use neo4j HA cluster (neo4j 2.0.1), but I got error "No such log version: ..." after database copied from master.
I deleted all *.log files, but it was not help for me.
Can you help me with this problem?
TIA.

"Log" in Neo4j refers to the write-ahead-log that the database uses to ensure durability and consistency. It is stored in files named something like nioneo_logical_log.vX, where X is a number. You should never delete these files manually, even if the database is turned off, this may lead to data loss. If you wish to limit the amount of disk space used by neo for logs, use this configuration:
keep_logical_logs=128M
The error you are seeing means that the database copied cannot perform an incremental update to catch up with the master, because the log files have been deleted. This may happen normally, if the copy is very old, or if you have keep_logical_logs set to false.
What you need to do to resolve this is to set keep_logical_logs to some value that makes sense to you, perhaps "keep_logical_logs=2 days" to keep logs up to two days old around. Once you've done that, you need to do a new full store copy on your slave, which can be triggered by shutting the slave off, deleting the database folder (data/graph.db), and starting the slave back up again.
Newer versions of Neo will do this automatically.

Related

neo4j-APOC plugin stopped working

Plugin APOC was working for me for a long time which means I have it copied at right place and I have edited config file correctly. But today I needed to create same graph on different data set so I stopped neo4j service, removed database directy, restarted it, changed password then copied plugins directory in neo4j directory(as I'm not using shell) and again restarted neo4j serivice. Then tried to execute the same query again and got error messgae.
There is no procedure with the name apoc.create.relationship registered for this database instance. and the query I'm using is as following
CALL apoc.create.relationship(n, network.connection, {}, m) yield rel
I have made following change based on a stackoverflow post,
uncommented following line
#dbms.directories.plugins=plugins
and added plugin directory path, restarted service even restarted system but still not working. I have done this(removing neo4j directory...) in past multiple times but this has never happened to me. Even I have tried replacing old apoc.jar with newly downloaded one before. I have neo4j3.3.0 with apoc3.3.0.1jar with windows10. Can anybody tell me what have I done wrong this time? Thanks in advance.
EDIT 1: when I uncomment above line in config file my other plugins also stop working but after commenting it other plugins like graph algorithms are working but not APOC
Since you are using APOC procedures and graph algorithms, I think you have configured your config file this way:
dbms.security.procedures.unrestricted=algo.*
dbms.security.procedures.unrestricted=apoc.*
If it is the case, change these lines to:
dbms.security.procedures.unrestricted=algo.*,apoc.*
I really don't know what the problem was, I uninstalled it with logs and config files, downloaded latest version which didn't pose any headaches of editing config file for csv files and for plugins and it worked.
If someone is reading this question and has done everything correctly. Set the correct permissions on the plugins directory, uncommented the whitelisted and unrestricted sections of the /etc/neo4j.conf, checked if the version of the Apoc jar you're loading is the same version as neo4j, etc. and can't make it work.
Try to restart your PC, that was what did it for me, for some weird reason.

How to Cleanly shutdown database in neo4j

I want to import some database at my neo4j local server. I unpacked data from archive do data/databases change active.db and allow_format_migration had changed to true.
But now when I use bin/neo4j start I had error in log/neo4j. There are many lines but I think problem is with it:
Please see the attached cause exception "The database is not cleanly shutdown. The database needs recovery, in order to recover the database, please run the old version of the database on this store.".
What I did wrong?
I've read ton's of information and found the answer.
Just need to delete transaction files inside your database folder and run neo4j.

Separate transaction logs in Neo4j Enterprise

I'am trying to change logical logs out of the *.db folder to put this in another disk volume. However I don't see any option in the neo4j config files that will allow you to do this. It's possible to do this configuration?
My neo4j version is 3.2.1.
Thanks
No, it is - at this time - not possible to move the transaction logs to some other place. Note that while the term logs is technically correct, these files are essential to the integrity of the database (unlike a regular log it would be very unwise to delete them) and it is therefore logical that they live together with the actual datafiles.
Hope this helps,
Tom
see file
conf/neo4j.conf
and line
#dbms.directories.logs=logs

How do I recover from TransactionFailureException?

Something went wrong with the application in the middle of a transaction (the thread was killed, which resulted in a ThreadDeath etc.), so the transaction failed, but no new transaction could be started after:
org.neo4j.kernel.api.exceptions.TransactionFailureException:
Kernel has encountered some problem, please perform neccesary action (tx recovery/restart)
What are the actions I should undertake to deal with this issue?
Update: I forgot to mention that I have encountered this type of error before and managed to (at least temporarily) fix it by deleting transaction log files. But now, apparently, there aren't any *nioneo* (IIRC) files in the neo4j data directory at all! Did the location or names of log files change? Or am I missing something? There are neostore.transaction.db.x files, which, upon grepping seem to contain chunks of my data. I did start the fresh instance of the application (fortunately that was a test), so I can't check it now, but if I deleted them, would I be able to restart an app from the previous state?
One of the improvements in Neo4j 2.2 was the unification of transaction logs, those are now in neostore.transaction.db.x.
In case the db does not start any more you can try to remove them (but be sure to keep a backup copy) and restart the database. However try a restart with these files in place beforehand. If the presence of transaction logs causes the database not to start up I would consider this being a bug.

Fixing neo4j consistency errors

After upgrading to 2.1.6 we started noticing the following error during the consistency checks of a full backup:
This node record has a label that is not found in the label scan store entry for this node
Is there any way to rebuild the label scan store?
Similarly, is there a way to fix these index errors:
ERROR: This node was not found in the expected index.
Unfortunately going to a previous backup is not an option since we need the new data and cannot recreate it.
You can use https://github.com/jexp/store-utils to copy over the datastore. The tools reads from a source datastore and writes it's data to a new datastore. Not 100%, but I'm pretty confident that this will solve your issue.
Or you could shut down the db, delete the label index /schema/label/ so that when you start again the label index will be rebuilt.

Resources