S _ Neo - dwisianto/dwisianto GitHub Wiki
-
M1mac
-
neosemantics
-
ToDo
- Michael Hunger
- https://neo4j.com/news/good-relationships/
- Download jdk-11 from https://jdk.java.net/archive/.
- Jdk-11 is the LTS release according to the oracle roadmap https://www.oracle.com/java/technologies/java-se-support-roadmap.html .
- Set the JAVA_HOME, JAVA_CMD, PATH and LD_LIBRARY_PATH variables in the .bashrc file ($HOME/.bashrc)
export JAVA_HOME=<path>/<to>/jdk11
export JAVA_CMD=$JAVA_HOME/bin/java
export PATH=$HOME/bin:$JAVA_HOME/bin:$PATH
export LD_LIBRARY_PATH="$JAVA_HOME/lib:$LD_LIBRARY_PATH"
brew update
brew info jdk11
brew install jdk11
export neo=/loc/to/neo4j
export NEO_HOME=$neo
export NEO_USER=neo4j
export NEO_PASS=neo4j
export PATH=$NEO_HOME/bin:$PATH
alias neo_="cd $neo"
alias neo-="$neo/bin/neo4j console & 1>$rc/tmp/n1.log 2>$rc/tmp/n1.err "
- Download
https://go.neo4j.com/download-thanks.html?edition=community&release=4.4.6&flavour=unix
- Expand the package into the desired installation directory $NEO.
- Move all JAR files from the $NEO/labs to the $NEO/plugins subdirectory.
- read the $NEO/labs/readme.md
- Modify the $NEO/conf/neo4j.conf
- By default only procedures that don't use low-level APIs are enabled.
- To enable all APOC procedures
- dbms.security.procedures.unrestricted=apoc.*
cp $NEO/labs/apoc-4.3.0.0-core.jar $NEO/plugins/
- Verify the port numbers in the $NEO/conf/neo4j.conf.
#dbms.connector.bolt.listen_address=:7687
#dbms.connector.http.listen_address=:7474
- create the file $NEO/conf/apoc.conf containing the lines
apoc.import.file.enabled=true
apoc.export.file.enabled=true
- Disable the authentication if necessary by updating the $NEO/conf/conf.json
# Whether requests to Neo4j are authenticated.
# To disable authentication, uncomment this line
dbms.security.auth_enabled=false
-
Create the directory $NEO/import to allow the graphs to be imported or exported.
-
Start the server
bin/neo4j console 1> n.log 2> n.err
- Set the initial password for the default "neo4j" user (which is otherwise "neo4j")
$NEO/bin/neo4j-admin set-initial-password abcde
#
# https://memgraph.com/blog/how-to-migrate-from-neo4j-to-memgraph#Export-from-Neo4j
#
# docker ps -a
# docker
#
# If you’re having trouble running this on the new Apple M1 chip,
# try adding --platform linux/arm64/v8 after the run command.
# Also, you can set NEO4J_AUTH however you like, here neo4j is username and password is password.
#
#
# The Neo4j Browser is available at http://localhost:7474, and you can use the credentials from the NEO4J_AUTH environment variable. The ports 7474 and 7687 are now exposed, and since Memgraph also uses port 7687,
#
# m1
# --platform linux/arm64/v8 \
docker run -p 7474:7474 -p 7687:7687 \
-v data:/data -v plugins:/plugins --name neo4j-apoc-$RANDOM \
-e NEO4J_apoc_export_file_enabled=true \
-e NEO4J_apoc_import_file_enabled=true \
-e NEO4J_apoc_import_file_use__neo4j__config=true \
-e NEO4JLABS_PLUGINS=\[\"apoc\"\] \
-e NEO4J_AUTH=neo4j/neo neo4j:latest
# docker ps
# docker exec -t <container_id>
#
#After you run the above command, you are inside the container where Neo4j is running. All exported data is located at /var/lib/neo4j/import/. Hence, run cd /var/lib/neo4j/import/ to check whether the movies.csv file is there. Next, you are going to copy the movies.csv file to your local file system. To do that, you need to run:
#
#docker cp <container_ID>:/var/lib/neo4j/import/movies.csv /path_to_local_folder/movies.csv
#The <container_ID> is the ID of the Neo4j container, which you already found before. On the right, you can give the path to one of your local folders where you want the movies.csv file to be copied to.
docker run \
--name=neo4j-$RANDOM \
-p7474:7474 -p7687:7687 \
--env NEO4J_AUTH=neo4j/neo \
neo4j:latest
# -v $HOME/neo4j/data:/data \
# -v $HOME/neo4j/logs:/logs \
# -v $HOME/neo4j/import:/var/lib/neo4j/import \
# -v $HOME/neo4j/plugins:/plugins \
export NEO_HOME=/Users/xinlei/d2/s2/m6_/ap/jv/neo/n42
export NEO_EXE=${NEO_HOME}/bin/neo4j
neo() {
nm1="n"
nm2="neo"
case "$@" in
h | hlp | help )
echo "help - ${nm1} - ${nm2} "
echo "NEO_HOME: $NEO_HOME"
echo "JAVA_HOME: $JAVA_HOME"
;;
${nm1}0 | ${nm2}0 )
echo "cleaning.."
echo "..done"
;;
${nm1}1 | ${nm2}1 )
echo "cleaning.."
echo "..done"
$NEO_EXE console
;;
esac
}
neo "$@"
act() {
case "$@" in
h | hlp | help )
echo "help"
;;
cln )
echo "cleaning.."
find . -name ".cache"
find . -name ".pytest_cache"
find . -name ".cache" -exec rm -rf {} \;
find . -name ".pytest_cache" -exec rm -rf {} \;
echo "..done"
;;
esac
}
act "$@"