I've been struggling to install Neo4j spatial for quite some time now using several methods I've found on the Web.
I am using neo4j-community-3.0.3, but I don't remember the link I got it from. It was a pre-compiled version from an ftp site (I believe it was an /archives folder somewhere on neo4j's website but I can't find it in google for the life of me). If someone has a link for downloading precompiled versions of neo4j that would be greatly appreciated. The neo4j other-releases webpage only provides recent versions: https://neo4j.com/download/other-releases/
I tried compiling my own version of neo4j from github but to be honest it is very confusing, as the directory tree is extremely dense. It seems like both community and enterprise versions are included in the same repo, without READMEs, so I don't even know where to begin.
As far as the plugin goes, I have tried both the precompiled version, and compiling my own. For the precompiled, I have followed instructions on the git page to the tee.
https://github.com/neo4j-contrib/spatial#using-the-neo4j-spatial-server-plugin
I downloaded the jar file, and copied it over to $NEO4J_HOME/plugins/ Then I restarted the neo4j server. Finally I make the rest call to see if the plugin has been loaded, but I do not see it.
$ http :7474/db/data/ -a neo4j
http: password for neo4j@localhost:7474:
HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
Content-Length: 795
Content-Type: application/json; charset=UTF-8
Date: Fri, 01 Jul 2016 19:49:44 GMT
Server: Jetty(9.2.9.v20150224)
{
"batch": "http://localhost:7474/db/data/batch",
"constraints": "http://localhost:7474/db/data/schema/constraint",
"cypher": "http://localhost:7474/db/data/cypher",
"extensions": {},
"extensions_info": "http://localhost:7474/db/data/ext",
"indexes": "http://localhost:7474/db/data/schema/index",
"neo4j_version": "3.0.3",
"node": "http://localhost:7474/db/data/node",
"node_index": "http://localhost:7474/db/data/index/node",
"node_labels": "http://localhost:7474/db/data/labels",
"relationship": "http://localhost:7474/db/data/relationship",
"relationship_index": "http://localhost:7474/db/data/index/relationship",
"relationship_types": "http://localhost:7474/db/data/relationship/types",
"transaction": "http://localhost:7474/db/data/transaction"
}
The compiled version gave me the same result, only it takes longer to achieve. I cloned the git repo for version 3.0.2, and run the following:
git clone git://github.com/neo4j/spatial.git spatial
cd spatial
mvn clean package -Dmaven.test.skip=true install
Note: This mvn command actually failed for me at one point, but after some googling I found that this command worked
mvn clean compile package assembly:single -Dmaven.test.skip=true install
Finally I run
cp target/neo4j-spatial-0.17-neo4j-3.0.2-server-plugin.jar $NEO4J_HOME/plugins
$NEO4J_HOME/bin/neo4j restart
And voila, the exact same results as before (no plugin listing).
I have never had so much trouble installing something. I really do not want to go back to versions 2.* because I want to take advantage of the new bolt driver with python, and get the latest and greatest performance. Please, any help is greatly appreciated. (Even just finding an archive of direct links to precompiled versions of neo4j would help me).
Okay so I figured out several issues which were probably the cause to my confusion.
Issue 1: If you start the server as root (sudo), you must stop the server as root!
Issue 2: Make sure you do not have another version simultaneously running (with default port 7474).
I believe a combination of these 2 issues were the real culprit to my problem. It would be great if Neo4J had some sort of check upon startup whether or not that port is already being used.
Also, it is very confusing when attempting to stop the service as someone other than the original user, Neo4J shows the following output:
$ sudo bin/neo4j start
Starting Neo4j.
WARNING: Max 1024 open files allowed, minimum of 40000 recommended. See the Neo4j manual.
Started neo4j (pid 25418). By default, it is available at http://localhost:7474/
There may be a short delay until the server is ready.
See /opt/neo4j/neo4j-community-3.0.2/logs/neo4j.log for current status.
$ bin/neo4j stop
Neo4j not running
rm: remove write-protected regular file ‘/opt/neo4j/neo4j-community-3.0.2/run/neo4j.pid’? ^C
That last line caught my attention and then after running
$ ps aux | grep neo
I found that Neo4j WAS actually running.
As far as the download link goes, credit to William in the comments above. He pointed me to http://dist.neo4j.org/neo4j-community-3.0.2-unix.tar.gz, I suppose one can just change the version number in the url if they want other ones.
So figuring this out, I found that the 3.0.2 spatial plugin indeed does show up in the response from http://localhost:7474/db/data/
for neo4j version 3.0.3. However, I am going to stick to using neo4j version 3.0.2 just to be safe for now.