生產(chǎn)環(huán)境
系統(tǒng):ubuntu 16.04 LTS
安裝版本:Neo4j 3.1.3
安裝
編寫sh腳本
#!/bin/bash
# This script installs default Java Machine and latest version of enterprise Neo4j on your machine
# This script is compatible with Debian(8+) and Ubuntu (14.04+) as on Dec-21-2016
# update your distro
sudo apt-get update
# install the default JRE (required for running Neo4j)
sudo apt-get install default-jre -y
# the following commands add the neo4j repo to apt-get
wget -O - https://debian.neo4j.org/neotechnology.gpg.key | sudo apt-key add -
echo 'deb https://debian.neo4j.org/repo stable/' | sudo tee /etc/apt/sources.list.d/neo4j.list
# get packages from the Neo4j list. I know it's been run before, but I like to
# do this twice just to ensure nothing got left out earlier
sudo apt-get update
# Gets Neo4j enterprise. To get latest version use sudo apt-get install neo4j-enterprise
# sudo apt-get install neo4j-enterprise=x.x.x, e.g. sudo apt-get install neo4j-enterprise=3.1.0
sudo apt-get install neo4j-enterprise=3.1.3 -y
# Install vim
sudo apt-get install vim -y
echo "in case of 3.1.3, the conf file can be edited by running vim /etc/neo4j/neo4j.conf"
保存為install.sh之后給予運行權(quán)限就好了
而后使用命令neo4j console
就可以開啟neo4j了,通過訪問http://localhost:7474/
可以查看那個超級厲害的控制臺(若提示權(quán)限不足松嘶,請用sudo
)
默認(rèn)配置信息
可通過vim /etc/neo4j/neo4j.conf
查看
默認(rèn)的文件目錄如下
# Paths of directories in the installation.
dbms.directories.data=/var/lib/neo4j/data #數(shù)據(jù)庫目錄
dbms.directories.plugins=/var/lib/neo4j/plugins #插件目錄
dbms.directories.certificates=/var/lib/neo4j/certificates
dbms.directories.logs=/var/log/neo4j #日志目錄
dbms.directories.lib=/usr/share/neo4j/lib #jar包目錄
dbms.directories.run=/var/run/neo4j
dbms.directories.metric=/var/lib/neo4j/metrics
修改數(shù)據(jù)庫目錄
因為在后面的操作過程中幾乎一定會遇到需要增加凑兰、修改數(shù)據(jù)文件和日志文件的情況碴巾,為了避免各種訪問權(quán)限問題的打擾,我們可以將數(shù)據(jù)庫的目錄更改到另一個地方扰楼,首先先將默認(rèn)數(shù)據(jù)庫目錄整個復(fù)制到新的目錄下面,然后修改配置文件
dbms.directories.data=/home/ericwyn/neo4j/data #更改后數(shù)據(jù)庫目錄地址
保存后使用命令neo4j restart
重新啟動一下neo4j就好了