I've tried to run a simple example "Hello World" with Neo4j but I don't know how to modify the configuration file.
I don't know what to put as a parameter for
"GraphDatabaseService graphDB = new GraphDatabaseFactory()
.newEmbeddedDatabase(" ..... ");"
and what other modification do I have to make. Do I have to put the org.neo4j.server.database.location from the neo4j-server.properties?
But first, do I have to run the server?
Thanks!
You can either put in the path from org.neo4j.server.database.location in the neo4j-server.properties file which will allow you to access the same database referred to when you run the server/webadmin.
Or you can put in the path to any directory that you have access to and your database will be created there.
You should not run the server since the above code uses Neo4j in embedded mode.
Related
Suppose I have a graph database created with Neo4j Desktop in the path
path/neo4jDatabases/database-abc/installation-3.5.5
In a different path I have the neo4j-community-3.5.5 folder (I am on OSX). I am trying to start the path/neo4jDatabases/database-abc/installation-3.5.5 database with neo4j-community.
I am trying this command:
sudo ./bin/neo4j console -path path/neo4jDatabases/database-abc/installation-3.5.5
but the started database is using the directories of neo4j-community-3.5.5 instead of the ones specified in the path.
How can I start neo4j-community using the path of an existing db (created with Neo4j Desktop)?
The path argument doesn't exist for the command neo4j.
If you want to change the data folder location of your community server, you need to modify the configuration of your community server (the conf/neo4j.conf) by specifying the dbms.directories.data property :
dbms.directories.data=path/neo4jDatabases/database-abc/installation-3.5.5/data
Cheers.
I know that can add set of docroot in yaws.conf but this not always convenient. Is exist way to start of server from current directory with yaws without modifying configuration file?
Two options:
Keep a template of your yaws.conf file somewhere and invoke yaws through a script that first uses the template to create a conf file with the current working directory filled in as docroot, and then runs yaws using its --conf command-line option to specify the newly-created conf file as its configuration file.
Run yaws in embedded mode, which allows you to programmatically specify the configuration. You can use file:get_cwd/0 to obtain the pathname of the current working directory, then use it as the value for docroot in the configuration details you pass to yaws_api:embedded_start_conf/1,2,3,4.
I try to start neo4j on OSX and change the chosen configuration file. I'd like to start a test server for unit tests with a different port and a database, which shall be deleted while startup (I will solve the deletion part in a shell script, which should stop and start the server).
My problem is neo4j ignores the configuration file from the parameter. My call looks like this (from the terminal and the current folder is bin:
./neo4j start -server -Dorg.neo4j.server.properties=conf/neo4j-server-test.properties
The default configuration file is still chosen.
Thanks for your help
There are no 'ad hoc' arguments to the neo4j command script, so your arguments after start are ignored. You need to either make a modified version of the neo4j command script, or swap out neo4j-server.properties files.
You can use ineo to manage two or more Neo4j instances:
https://github.com/cohesivestack/ineo
You can specify the path to a folder containing a customized configuration file with an environment variable:
NEO4J_CONF=../conf neo4j start
I created a database Neo4j on a PC, with many relationships, node, etc
how to move/ copy the database from this pc to another?
thanks for the help
francesco
update1: I have tried to found conf/neo4j-server.properties but i don't have...
this is a screenshot of my folder ne04j (It is in Windows document Folder)
http://s12.postimg.org/vn4e22s3x/fold.jpg
Neo4J databases live in your filesystem, you can simply make a copy of the folder in which your Neo4J data is stored. If you are running standalone this folder will be configured in conf/neo4j-server.properties and the line will look something like this:
org.neo4j.server.database.location=data/graph.db
Copy the content of that folder to the graph database folder on your other machine. I'd recommend that your databases are not running when you do this.
I believe you're looking for the dump shell command which you can use to export a database into a single Cypher create statement, you'd "dump" the database and then import it on your new machine.
Information on using the command is outlined here: Neo4j docs
A Neo4j database can be dumped and loaded using the following commands:
neo4j-admin dump --database=<database> --to=<destination-path>
neo4j-admin load --from=<archive-path> --database=<database> [--force]
Limitations
The database should be shutdown before running the dump and load commands.
https://neo4j.com/docs/operations-manual/current/tools/dump-load/
i used the above solution, but the file name was different.
in the folder of the neo4j data, look for folder called conf and inside the configuration file called neo4j.conf
inside this file you will see a line that direct to the folder that contain the data.
its called "graph.db"
replace it with the same folder from your backup of the DB that you want to clone.
i have installed Informix database server(11.70) successfully.but get problems in starting the DB server.when i run it give me error.
Warning: could not access INFORMIXSQLHOSTS /opt/IBM/informix1/etc/sqlhosts.
How to create this sqlhosts file and what is the exact content of this file.in my etc directory i have some similar files named :
sqlhosts.cmsm.sample
sqlhosts.cmsm.sample.all
sqlhosts.cmsm.sample.client
sqlhosts.cmsm.sample.er
sqlhosts.demo
sqlhosts.ol_informix1170_1
sqlhosts.std
but there is no file named sqlhosts in /etc/ folder.please guideline how to prepare this file ??
I suppose you created the instance during the install process. From your file list I suspect that the name was "ol_informix1170_1". I'd say, but I cannot be 100% sure that in order to setup the environment for your Informix instance, you need (as a minimum) set the following:
INFORMIXDIR=/opt/IBM/informix1
INFORMIXSQLHOSTS=/opt/IBM/informix1/etc/sqlhosts.ol_informix1170_1
ONCONFIG=onconfig.ol_informix1170_1 #check if this file exists (in $INFORMIXDIR/etc)
INFORMIXSERVER=ol_informix1170_1 #check that this is the value of the SERVERNAME in the previous file
PATH=$PATH:$INFORMIXDIR/bin
export INFORMIXDIR INFORMIXSERVER ONCONFIG INFORMIXSQLHOSTS PATH
Regards