Neo4j Multiple server instances Error 401 - neo4j

I am new to neo4j,I just follow the neo4j official manual:
install two instances on one machine ,my environment is ubuntu-11.10.I had success start up the neo4j service and entered the websites http://localhost:7474/webadmin/ .But when I tried to run the "DELETE /db/data/cleandb/secret-key' command in its http console .It returned error 401. Any idea about this?

Which version of neo4j are you using?
You have to configure two different ports for the two servers. Think you did this.
The clean-db-addon doesn't come out of the box, you have to download it and and copy it in the plugins directory and adjust the neo4j-server.properties config file.
org.neo4j.server.thirdparty_jaxrs_classes=org.neo4j.server.extension.test.delete=/cleandb
org.neo4j.server.thirdparty.delete.key=<please change secret-key>
Then you can call it for each of your servers with:
curl -X DELETE http://localhost:<port>/cleandb/secret-key

Related

Create Neo4j database dump with JQAssistant

I want to create a dump of the database that JQAssistant creates with a scan. So far i have tried to do this with the integrated server and by connecting jqassistant to a running database.
The problem with the integrated database is that i can't access a shell and therefore i don't know how i could create the dump.
Connecting to the running database also didn't work. I assume the problem here is the encryption, my server is running local and trying to connect to it with
jqassistant.sh scan -f my-project.jar -storeUri bolt://localhost:7687 -storeUsername neo4j -storePassword secret
which is the example from the jqa tutorial throws the error:
javax.net.ssl.SSLHandshakeException: General SSLEngine problem
so i assume i can't connect without ssl encryption.
I am using Neo4j server 3.5.15 and JQAssistant Commandline Tool version 1.9 which uses an integrated Neo4j 3.5.14 server.
If you can give me an new idea how to create a data dump out of the scan or how to fix one of the two given problems i would appreciate that a lot!
Thanks in advance!
I couldn't figure out a way to export the database with the commandline tool, but with the maven plugin. If you setup a maven project and include jqassistant as a plugin it offers you the option "export-database" which creates a Cypher script.

Jenkins doesn't update GitHub check status sometimes

I'm using Jenkins 2.15 (GitHub plugin 1.29.3) based CI for my GitHub core repo. It works fine, but sometimes Jenkins build doesn't update GitHub check status.
I see nothing relevant into Jenkins log.
Any idea how to debug and hopefully fix this issue?
As I know, check status update is just an http request to the status api: https://developer.github.com/v3/repos/statuses/
I experienced a similar behavior with a database. The client application and the database had no errors. Each one was on a different host.
What I did was, create a bash script in host A to perform a ping to host B.
ping www.host_B.com | while read pong; do echo "$(date): $pong"; done >> /tmp/ping-test-$(date +%F).log
Then, when the sporadic error related to the connection of the database occurred, the log file helped me to detect that the error was related to:
Network issues
Latency issues
Internet service provider issues
In your case, you could perform a simple curl to the status api and compare to the sporadic behavior detected.

Start multiple neo4j servers from Neo4j Desktop

I recently downloaded and successfully used "neo4j desktop" (v 1.0.10), which allows you to create and manage different projects and databases.
I need to spawn two databases instances at the same time. I changed the ports for them both from the confs and I can start them successfully on such ports but not together.
When I press the start button on one server the other one automatically stops.
Is it possible to use such feature on neo4j desktop or should I just use the normal neo4j server installation?
Yes, you can not run multiple projects together from Neo4J desktop application.
You need to use the neo4j server for this purpose.
What I did is :
Download Neo4J server(Community Release) from here
Unzip the tar
Copy unzipped directory to two different locations.
Updated following configurations in conf/neo4j.conf file for both directories (with different values obviously !) :
dbms.active_database=<name-of-db-dir>
dbms.directories.data=<path-to-dir>
# Bolt connector
dbms.connector.bolt.enabled=true
#dbms.connector.bolt.tls_level=OPTIONAL
dbms.connector.bolt.listen_address=localhost:XXXX
# HTTP Connector. There must be exactly one HTTP connector.
dbms.connector.http.enabled=true
dbms.connector.http.listen_address=localhost:XXXX
# HTTPS Connector. There can be zero or one HTTPS connectors.
dbms.connector.https.enabled=true
dbms.connector.https.listen_address=localhost:XXXX
start Neo4J server from respective directories using command : ./bin/neo4j start.
It will start Neo4j server at specified ports on localhost !

Neo4J Browser ServiceUnavailable failure after connecting with Neo4J Java driver

I regularly use Neo4J Browser on http://localhost:7474/browser/. However, yesterday I used the java driver to connect to Neo4J and execute queries. Since then, I'm unable to login to Neo4J Browser.
I start Neo4J from the terminal (I'm on ubuntu) using sudo neo4j start, and this is the output -
% sudo neo4j start
Active database: graph.db
Directories in use:
home: /var/lib/neo4j
config: /etc/neo4j
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.
/usr/share/neo4j/bin/neo4j: line 411: /var/run/neo4j/neo4j.pid: No such file or directory
Then, I visit localhost:7474, which gives me the :server connect screen, but as soon as I enter the password, I get this error -
ServiceUnavailable: WebSocket connection failure. Due to security constraints in your web browser, the reason for the failure is not available to this Neo4j Driver. Please use your browsers development console to determine the root cause of the failure. Common reasons include the database being
Screenshot -
Normally, the only authentication fields are "Username" and "Password". I don't think I've seen the "Host" field in there before.
I searched for this error, and came across a question with similar error and an article on the Neo4J KB that says -
In Neo4j 3.0 and its implementation of the Bolt protocol, if a remote browser connects to Neo4j (http://:7474) and attempts to authenticate, the following error may be encountered:
But I don't think this situation applies here.
How can I fix this?
As logisima pointed out, neo4j is not compatible with Java 9. You can install multiple versions of Java and use environment variables to swap between them. For instance on MacOS you might have these two lines in your .bash_profile
export JAVA_HOME=$(/usr/libexec/java_home)
export JAVA8_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home
The first line gets your normally installed java home and the second points to the older java8 location.
Then before starting your neo4j instance, execute for example:
export JAVA_HOME=$JAVA8_HOME
$NEO4J_HOME/bin/neo4j start

Running an Ant script to prepare a Database in Bluemix

I have an Ant script that I use to populate/prepare a database. All I need is to set the host, port and credentials for the database. It works fine for MySQL and DB2, the DB just need to be reachable from were the script is executed.
The DB service in Bluemix gives me a DB with an IP (75.x.x.x) that is only reachable from the internal network of Bluemix, it is not accessible externally.
My understanding is that my ant script needs to be executed from inside the Bluemix network/servers.
How can I do that?
What would be the alternatives?
I'm considering to create a NodeJS script to trigger that ant internally, but I'm not sure if it will work properly.
dashDB always had the ability for local clients (outside of Bluemix) to connect to the cloud database, and SQL Database later added the feature as well. So you should be able to populate a database as long as you have the correct driver client installed on your local machine.
Can you provide more details on how you tested that the IP is not reachable? Is there a firewall put in place between your local machine and Bluemix? Note that ping is not a good test because the port is blocked for security reasons. You may try the JDBC port indicated on the connection page from the console.
See link for instructions on how to make a connection:
https://www.ng.bluemix.net/docs/#services/SQLDB/index.html#connecting-to-sqldb
You might be able to use a simple custom buildpack. You can start with a sample like this one:
https://github.com/dmikusa-pivotal/cf-test-buildpack
fork it and modify the bin/compile script to run your ant task instead. Then put your ant script (and probably executable as I expect it is not installed in the Bluemix environment) in a directory and run
cf push <appname> -b <your forked git url>
To push it to Bluemix and run it. If you're just using it once you can probably get away with hard-coding the address and credentials, or else you can bind to the same service instance and get the info from VCAP_SERVICES.

Resources