Neo4j無法打開neo4j-admin導入創建的數據庫(neo4j-import)

[英]Neo4j can't open database created by neo4j-admin import(neo4j-import)


the problem really bothered me for a while. I try to import data follow this [tutorial][1] with neo4j 3.2.2, but it seems I can't open my web anymore if I change the database path to the one I created. The following is my steps. Please let me know if there are some stupid mistakes.

問題真的困擾了我一段時間。我嘗試使用neo4j 3.2.2按照[教程] [1]導入數據,但是如果我將數據庫路徑更改為我創建的路徑,似乎無法打開我的網頁。以下是我的步驟。如果有一些愚蠢的錯誤,請告訴我。

  1. Create an neo4j database under /var/lib/neo4j/data/databases/ (The default root of neo4j in Ubuntu 16):

    在/ var / lib / neo4j / data / databases /(Ubuntu 16中neo4j的默認根目錄)下創建一個neo4j數據庫:

    sudo neo4j-admin import --database=mygraph.db --nodes=movies.csv --nodes=actors.csv --relationships roles.csv
    

    All the data is from the neo4j-import tutorial

    所有數據都來自neo4j-import教程

  2. Changed the dbms.active_database in neo4j.conf to: dbms.active_database=mygraph.db

    將neo4j.conf中的dbms.active_database更改為:dbms.active_database = mygraph.db

  3. start neo4j with service neo4j start

    用服務neo4j start啟動neo4j

  4. try to open the web page with localhost:7474/browser/ But I don't know why I can't open the webpage anymore, it shows that:

    嘗試用localhost打開網頁:7474 / browser /但我不知道為什么我不能打開網頁了,它表明:

This site can't be reached, localhost resused to connect, ERR_CONNECTION_REFUSED

無法訪問此站點,localhost重新連接,ERR_CONNECTION_REFUSED

But if I switch back to the default database by changing dbms.active_database=graph.db I can open the webpage again.

但是如果我通過更改dbms.active_database = graph.db切換回默認數據庫,我可以再次打開網頁。

I'm thinking there could be two potential reasons for this:

我想這可能有兩個潛在的原因:

  1. Haven't used neo4j start to start neo4j. The tutorial for import-tool asked us to use neo4j restart in the database directory, but I can't use neo4j start to use neo4j, which is also not recommended from neo4j community anymore.

    沒有使用neo4j啟動neo4j。 import-tool教程要求我們在數據庫目錄中使用neo4j restart,但是我不能使用neo4j start來使用neo4j,neo4j社區也不推薦使用neo4j。

  2. The neo4j import is for some old version's neo4j and there are some bugs for the current one. Since I compared the database files from the good one and the one created from neo4j-admin import, there are some difference, from left to right: good, bad.

    neo4j導入適用於某些舊版本的neo4j,並且當前版本存在一些錯誤。由於我比較了好的數據庫文件和從neo4j-admin導入創建的數據庫文件,因此從左到右有一些區別:好,壞。

enter image description here

The following is the log that I created the database:

以下是我創建數據庫的日志:

enter image description here

Thanks for your help, appreciate it

感謝您的幫助,感激不盡

1 个解决方案

#1


2  

My guess would be that the ownership of the newly created database is not correct. You are running neo4j-admin with sudo (without specifying a user) ... so the database is created as root. However, the service runs as neo4j. Please change the ownership of the whole mygraph.db directory to neo4j:adm first and then try again.

我的猜測是新創建的數據庫的所有權不正確。您正在使用sudo運行neo4j-admin(未指定用戶)...因此數據庫是以root身份創建的。但是,該服務以neo4j運行。請將整個mygraph.db目錄的所有權更改為neo4j:adm然后再試一次。

Hope this helps.

希望這可以幫助。

Regards, Tom


注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:https://www.itdaan.com/blog/2017/08/01/72a12fe62a2c051a9bc2c1a1fcab2d45.html



 
粤ICP备14056181号  © 2014-2020 ITdaan.com