I am using Neo4j 2.3.2 CE server (not embedded) on Windows 7.
I am experiencing a strange behavior. If I stop and restart the Neo4j server process and start the database with the last used database directory, the demo movie database is shown in the web GUI even though the directory still contains my database. After renaming the directory, and starting the database with the new directory name, my database contents are shown again.
Steps to reproduce:
(1) Start the Neo4j server process
(2) Start the server with an empty directory as database location
(3) In web GUI check that database is empty
(4) In web GUI add some data
(5) Stop server and server process
(6) Start server process
(7) Start server with the same directory as above
(8) Check the database contents > now it contains the movie demo database!
(9) Stop server
(10) Rename the database directory
(11) Start server with the new directory name
(12) The database now contains the data added in (4)
Any one has a solution, or at least an explanation?
Gergely
Check what's in config file.
conf/neo4j-server.properties
org.neo4j.server.database.location=data/graph.db
For the record, here is the solution.
When Neo4j CE is started, the Database Location field contains the last used directory. However this is a trap. The effective database location is the default directory, which is C:\Users\your_user_name\Documents\Neo4j\default.graphdb. You have to click Choose and select the directory again. I had the movie database in this directory, hence the behavior above.
Note: the org.neo4j.server.database.location property of the server configuration file C:\Users\your_user_name\AppData\Roaming\Neo4j Community Edition\neo4j-server.properties seems to be ignored in Neo4j CE.
Related
I have a successful import using the bin/neo4j-admin tool, can see the new database folder in my /databases, have restarted the server, but cannot get the database to appear in the console as an option to switch to. Do you have any suggestions for getting a newly imported database to be available in the console?
I assume that you are referring to the Neo4j Desktop environment.
The Desktop currently seems to be designed to support local DBs created by the Desktop itself.
As a workaround, you can:
Create a new "Graph" in the Desktop, using the "Connect to Remote Graph" option.
Accept the default "bolt://localhost:7687" as the Connect URL (assuming the default is acceptable).
Manually start your local neo4j installation from the command line, and
Click Connect on your "Graph" to connect.
Be aware that the Desktop has fewer bells and whistles for "remote
graphs".
I resolved the issue. The steps I found to successfully import a set of CSV using the admin -import tool is to:
Stop the server
Run the admin -import tool and use --database=aDatabaseName
Start the server
In the console switch to the System database using the pulldown control
Run the following command at the system prompt: create database aDatabaseName
(should be the same name set in #2 above)
Switch to the database just created using the console pulldown control
I was able to see the database nodes and relationships I created following the above steps
This is what worked for me. I was trying to access my database generated through neo4j-admin on my Neo4j Desktop app browser console.
On Neo4j Desktop App open the browser of the database server you want to include the new database
Switch to the system database https://neo4j.com/developer/manage-multiple-databases/
:use system
as system, create the database you want to import
:create database dbname
Stop the server
Use the neo4-admin tool to import the database https://neo4j.com/graphacademy/online-training/v4/19-using-neo4j-admin-tool-import/ (make sure to use the same name --database dbname). Run these command on the terminal opened from the Desktop app under the databases>_Open Terminal. On windows the neo4j-admin.bat is located in the bin directory
start the server and open the neo4j browser and switch to the system database https://neo4j.com/developer/manage-multiple-databases/
:use system
To list all the database available to use as system
:dbs
switch to your imported database
:use dbmame
Your browser console is ready now for your queries.
I am missing some steps to achieve Enterprise Replication with Informix regarding disk configuration:
How to set up sbpaces to hold send and receive queues
Create dbspace for transaction records
Define dbspace for syscdr database
I've created two different VMs; each one got CentOS7 Linux System. Then I've installed IDS Developer Edition. My installation is organized as /mnt/informix and in informix/ I have /product, /ids, /storage:
/mnt/informix/product is where am saving installation files.
/mnt/informix/ids is where am installing IDS.
/mnt/informix/storage is where rootdbs, env.ids have been created.
I was able to create instance on each machine and access the remote instance after providing some changes editing the onconfig file, sqlhosts file and hosts.equiv file on each machine. I've been able to create databases and tables on each machine and establish connection between both of them. But when it is time to configure disk for replication, I am not sure of what am doing. I've created new dbspaces and sbspaces by creating new files inside storage directory and changed owner to informix user and file access permissions to 660, then create dbspaces and sbspaces using the onspaces command and provided the required entries in the onconfig file, but I get the error:
command failed -- Sbspace specified for the send/receive queue does
not exist (107)
I have dbms.active_database=debug.db set in neo4j.conf (and the new database's data directory was created upon restart), but the Neo4J Browser still connects to graph.db
I just installed the latest version of Neo4J on ubuntu 15.04 and on my application code I have provided the path for the database as the following :
GraphDatabaseService db = dbFactory.newEmbeddedDatabase("/home/aimad/Documents/Neo4j/default.graphdb");
When I type match(n) return n; on console of http://localhost:7474 I cant see any graph.
And I notice that the location of the database is : /home/aimad/neo4j-community-2.3.0/data/graph.db on the Neo4j plateform.
I also tried to change the location of the database in conf/neo4j-server.properties but I got this error message when I want to start neo4j :
Starting Neo4j Server...WARNING: not changing user process [3151]...
waiting for server to be ready... Failed to start within 120 seconds.
Neo4j Server may have failed to start, please check the logs.
How can I solve this problem ?
As #AllessandroNegro indicated, you cannot start a neo4j server on the same DB that is already opened by an embedded app.
If you want to visualize the DB used by your embedded app, this other question might be helpful.
[neo4j: 2.1.3, Windows 7 64 bit, Java 7]
I want to be able to connect to the embedded neo4j database in java, using the neo4j shell.
As suggested here adding the property remote_shell_enabled="true" should do that.
I tried as suggested but my shell is not able to connect to the db with error
Caused by: org.neo4j.kernel.StoreLockException: Unable to obtain lock
on store lock file:
~\store_lock. Please ensure no
other process is using this database, and that the directory is
writable (required even for read-only access)
at org.neo4j.kernel.StoreLocker.checkLock(StoreLocker.java:82)
I set the property as follows in my code
graphDb = new GraphDatabaseFactory().newEmbeddedDatabaseBuilder(DBPATH).setConfig("remote_shell_enabled","true").newGraphDatabase();
Also, doing this results in the database not shutting down through the shutdown hook. Instead the process does not end, seemingly the shutdown hook is never executed.
If however I use the below to start the property the shutdown hook is executed successfully everytime.
graphDb = new GraphDatabaseFactory().newEmbeddedDatabase(DBPATH);
or
graphDb = new GraphDatabaseFactory().newEmbeddedDatabaseBuilder(DBPATH).newGraphDatabase();
Is there some other way to enable the shell access to the embedded database.
In order to open the neo4j-shell server at e.g. port 5000, start the database with something like
new GraphDatabaseFactory().newEmbeddedDatabaseBuilder(DB_DIR)
.setConfig(ShellSettings.remote_shell_enabled, "true")
.setConfig(ShellSettings.remote_shell_port, "5000")
.newGraphDatabase();
and the connect to it using
neo4j-shell -port 5000
Does that work?