版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/chengyuqiang/article/details/102663149
[root@elastic1 neo4j-community-3.5.11]# bin/neo4j stop
[root@elastic1 neo4j-community-3.5.11]# vi conf/neo4j.conf
# Whether requests to Neo4j are authenticated.
# To disable authentication, uncomment this line
dbms.security.auth_enabled=true
# A comma separated list of procedures and user defined functions that are allowed
# full access to the database through unsupported/insecure internal APIs.
dbms.security.procedures.unrestricted=apoc.*
# Java Heap Size: by default the Java heap size is dynamically
# calculated based on available system resources.
# Uncomment these lines to set specific initial and maximum
# heap size.
dbms.memory.heap.initial_size=1g
dbms.memory.heap.max_size=2g
# The amount of memory to use for mapping the store files, in bytes (or
# kilobytes with the 'k' suffix, megabytes with 'm' and gigabytes with 'g').
# If Neo4j is running on a dedicated server, then it is generally recommended
# to leave about 2-4 gigabytes for the operating system, give the JVM enough
# heap to hold all your transaction state and query context, and then leave the
# rest for the page cache.
# The default page cache memory assumes the machine is dedicated to running
# Neo4j, and is heuristically set to 50% of RAM minus the max Java heap size.
dbms.memory.pagecache.size=2g
CALL apoc.generate.ba(1000,2,'Person','FRIEND_OF')
match(p:Person)return p
FOREACH(id IN range(0,1000)|CREATE(n:Node{id:id}))
MATCH(n1:Node),(n2:Node) WITH n1,n2 LIMIT 1000000 WHERE rand()<0.1
CREATE (n1)-[:TYPE_1]->(n2)
MATCH(node:Node) WITH collect(node) as nodes
CALL apoc.algo.pageRank(nodes) YIELD node,score
RETURN node,score ORDER BY score DESC