cancel
Showing results for 
Search instead for 
Did you mean: 

Starting neo4j on fresh ec2 install with neo4j enterprise ami

vladimir
Node Link

Hi all, I'm new to this so it seems like a dumb question, but to my surprise, I could resolve it myself so have to ask for help.

Following neo4j guide I created an ec2 instance with neo4j enterprise ami (N.Virginia ami-0caebb418d7e8f3f1).

I guess in order to start the service I need to run sudo ./pre-neo4j.sh. And seems to start the service. However it reports and error:

Starting Neo4j.
WARNING: Max 1024 open files allowed, minimum of 40000 recommended. See the Neo4j manual.
Error: Could not find or load main class com.neo4j.server.enterprise.EnterpriseEntryPoint
Caused by: java.lang.ClassNotFoundException: com.neo4j.server.enterprise.EnterpriseEntryPoint

This is a fresh ami with no changes on my part ... Started on t2.micro (free tier)
Assuming this error can be ignored (guess not), I have also installed Bloom on my win laptop and I need to connect it to the remote DB. It fails to connect because it says the server is not running.

Here i was under the impression at some point I will have to enter my enterprise license we got from neo4j when we were accepted to the start-up program. But I couldn't find where...

So to summarize:

  1. what do you think about the error using latest enterprise ami from neo4j ( java.lang.ClassNotFoundException mentioned above)?

  2. what do i need to do to run a bloom server on an ec2 instance and how do I enter my enterprice license i received from neo4j (we didn't receive any bloom license I saw mentioned in some threads)?

  3. Can't open DB via browser because it keeps complaining about security (https) issues and nothing written in the community seems to resolve it (but if Bloom will work, I don't really need the browser so it's lower priority for me)

Thank you in advance!

Update #1

When running on the ec2 instance sudo ./pre-neo4j.sh towards the end it writes used paths:
Directories in use:
home: /var/lib/neo4j
config: /var/lib/neo4j/conf
logs: /var/log/neo4j
plugins: /var/lib/neo4j/plugins
import: /var/lib/neo4j/import
data: /var/lib/neo4j/data
certificates: /var/lib/neo4j/certificates
run: /var/run/neo4j

I noticed that /var/lib/neo4j/conf does not exist. the conf file neo4j.conf is located in other path, at /etc/neo4j. As an experiment i created a link to it sudo ln -s /var/lib/neo4j/conf /etc/neo4j

This made the error of class not found reported earlier disappear, but it seems that it stucks on starting the db... running pre-neo4j.sh now is stuck at:

pre-neo4j.sh: Starting neo4j console...
Directories in use:
home: /var/lib/neo4j
config: /var/lib/neo4j/conf
logs: /var/log/neo4j
plugins: /var/lib/neo4j/plugins
import: /var/lib/neo4j/import
data: /var/lib/neo4j/data
certificates: /var/lib/neo4j/certificates
run: /var/run/neo4j
Starting Neo4j.
WARNING: Max 1024 open files allowed, minimum of 40000 recommended. See the Neo4j manual.
ERROR StatusLogger Log4j2 could not find a logging implementation. Please add log4j-core to the classpath. Using SimpleLogger to log to the console...
2021-01-13 16:42:21.369+0000 INFO Starting...

Which never ends ... So is for connecting neo4j (remote) desktop. It keeps spinning in starting...
So one error less, looks like a step in the right direction, but still something is missing

1 ACCEPTED SOLUTION

Hi, looking at the instance aws console security tab I see:

Port range Protocol Source Security groups
22 TCP 0.0.0.0/0 neo4j-sg
7474 TCP 0.0.0.0/0 neo4j-sg
7473 TCP 0.0.0.0/0 neo4j-sg
7687 TCP 0.0.0.0/0 neo4j-sg

Outbound rules

  • 1
Port range Protocol Destination Security groups
All All 0.0.0.0/0 neo4j-sg

Small update: seems connection is successful via Neo4j Desktop (browser app), if I don't touch the pre-neo4j.sh ... It says it connects successfully via bolt. Accessing it via chrome and fox browsers reports some security issues and doesn't work but I don't really care about that at this stage as long as Neo4J Desktop app works fine ... So currently my issue is with bloom licensing - please see below.

I also followed the #bloom install guide, added the 4.2 to /var/lib/neo4j/plugins and updated the mentioned configuration. The one part that is not clear is where to get the license file?

I have the licenser number I received by email with the acceptance to the start-up program, but no license file... Any idea?

Update:

Turns out every was very simple
It was just spread among few manuals, and not mentioned as crucial - but everything was there.

So the answers are:

  1. once you spin an ec2 instance from official (i used enterprise) ami, neo4j is up and running, so no need to run pre-neo4j.sh...

  2. Even if you were given startup license, you still have to ask separately for a bloom license key
    which you have to place somewhere and update the path to it.

  3. you also have to place a server plugin in /var/lib/neo4j/plugins

  4. The path to license file (#2) and couple of more things you have to update in /etc/neo4j/neo4j.template
    --> Notice not the neo4j.conf which gets overwritten by pre-neo4j.sh script on every reboot.
    Read carefully the instruction on what exactly to update at Installation - Neo4j Bloom (section 3.2.1. Installing server plugin)

  5. One more peculiar thing I discovered trying to run python query locally on an ec2 instance.
    If you just copy the example from neo4j it doesn't work. The one thing you have to change in
    it is the address from 'localhost' to actual public IP of you instance. Tried it on the latest version
    (4.2) and the bug is still there ... but easy to work-around.

Enjoy

View solution in original post

4 REPLIES 4

did you follow this guide?

Yes I did... Followed it to the letter.

Hi @vladimir, I am sorry for your inconvenience.
You do not need to run the script in order to start the service, it is ready and started out of the box and you should be good to go.
Regarding browser constraints these are seen to happen when using Firefox, if you use Chrome, Safari, etc it will work fine.
Are you sure you have opened the needed ports in your security group?

Hi, looking at the instance aws console security tab I see:

Port range Protocol Source Security groups
22 TCP 0.0.0.0/0 neo4j-sg
7474 TCP 0.0.0.0/0 neo4j-sg
7473 TCP 0.0.0.0/0 neo4j-sg
7687 TCP 0.0.0.0/0 neo4j-sg

Outbound rules

  • 1
Port range Protocol Destination Security groups
All All 0.0.0.0/0 neo4j-sg

Small update: seems connection is successful via Neo4j Desktop (browser app), if I don't touch the pre-neo4j.sh ... It says it connects successfully via bolt. Accessing it via chrome and fox browsers reports some security issues and doesn't work but I don't really care about that at this stage as long as Neo4J Desktop app works fine ... So currently my issue is with bloom licensing - please see below.

I also followed the #bloom install guide, added the 4.2 to /var/lib/neo4j/plugins and updated the mentioned configuration. The one part that is not clear is where to get the license file?

I have the licenser number I received by email with the acceptance to the start-up program, but no license file... Any idea?

Update:

Turns out every was very simple
It was just spread among few manuals, and not mentioned as crucial - but everything was there.

So the answers are:

  1. once you spin an ec2 instance from official (i used enterprise) ami, neo4j is up and running, so no need to run pre-neo4j.sh...

  2. Even if you were given startup license, you still have to ask separately for a bloom license key
    which you have to place somewhere and update the path to it.

  3. you also have to place a server plugin in /var/lib/neo4j/plugins

  4. The path to license file (#2) and couple of more things you have to update in /etc/neo4j/neo4j.template
    --> Notice not the neo4j.conf which gets overwritten by pre-neo4j.sh script on every reboot.
    Read carefully the instruction on what exactly to update at Installation - Neo4j Bloom (section 3.2.1. Installing server plugin)

  5. One more peculiar thing I discovered trying to run python query locally on an ec2 instance.
    If you just copy the example from neo4j it doesn't work. The one thing you have to change in
    it is the address from 'localhost' to actual public IP of you instance. Tried it on the latest version
    (4.2) and the bug is still there ... but easy to work-around.

Enjoy

Nodes 2022
Nodes
NODES 2022, Neo4j Online Education Summit

On November 16 and 17 for 24 hours across all timezones, you’ll learn about best practices for beginners and experts alike.