#*****************************			基础运行配置 		************************************
# 如果想自定义neo4j数据库数据的存储路径,要同时修改dbms.active_database 和 dbms.directories.data 两项配置,
# 修改配置后,数据会存放在${dbms.directories.data}/databases/${dbms.active_database} 目录下
# 安装的数据库的名称,默认使用${NEO4J_HOME}/data/databases/graph.db目录
dbms.active_database=graph.db
dbms.directories.data=data
# 插件路径
#dbms.directories.plugins=plugins
# 证书路径
#dbms.directories.certificates=certificates
#  日志路径
dbms.directories.logs=logs
# jar包路径
#dbms.directories.lib=lib
# 脚本运行路径
#dbms.directories.run=run

#*****************************			权限配置 		************************************
# 是否开启身份验证默认密码neo4j,注释后无需验证,默认false
dbms.security.auth_enabled=true
# 认证模式 `native` or `ldap`
#dbms.security.auth_provider=native
# 使用时缓存的身份验证和授权信息的生存时间(TTL)
#dbms.security.auth_cache_ttl=10m
# 身份验证缓存和授权缓存的最大容量
#dbms.security.auth_cache_max_capacity=10000
# 设置身份验证的事件记录到安全日志。如果设置为“false”,将只记录失败的身份验证事件
#dbms.security.log_successful_authentication=true

#*****************************			内存配置 		************************************
# 初始化内存和限定最大内存,默认情况下,Java堆大小是动态地根据可用的系统资源计算。
dbms.memory.heap.initial_size=16g
dbms.memory.heap.max_size=16g
# 用于映射存储文件的内存量(以字节为单位)千字节带有'k'后缀,兆字节带有'm',千兆字节带有'g')。
# 如果Neo4j在专用服务器上运行,那么通常建议为操作系统保留大约2-4千兆字节,
# 为JVM提供足够的堆来保存所有的事务状态和查询上下文,然后保留其余的页面缓存 。
# 默认页面缓存存储器假定机器专用于运行Neo4j,并且试探性地设置为RAM50%减去最大Java堆大小。
dbms.memory.pagecache.size=28g

#*****************************			网关配置 		************************************
# 只接受本地连接,请注释此行
dbms.connectors.default_listen_address=0.0.0.0
# 客户端可以访问此服务器的地址。这可以是服务器的IP地址或DNS名称,或者可以是位于服务器前面的反向代理的地址。此设置可能会覆盖以下各个连接器
#dbms.connectors.default_advertised_address=localhost
# HTTP 端口,默认7474
dbms.connector.http.enabled=true
dbms.connector.http.listen_address=:7474
# Bolt 端口,默认7687
dbms.connector.bolt.enabled=true
#dbms.connector.bolt.tls_level=OPTIONAL
dbms.connector.bolt.listen_address=:7687
# HTTPS 端口,默认7473
dbms.connector.https.enabled=true
dbms.connector.https.listen_address=:7473
# 线程数
#dbms.threads.worker_count=

#*****************************			集群配置 		************************************
# neo4j运行模式:HA, SINGLE, CORE, READ_REPLICA; 1.安全性:核心服务器(Core)为事物平台处理提供了容错平台 2.可扩展性:只读副本(Read Replica)为图查询提供了一个大规模高可扩展的平台

# 例子:HA集群
#dbms.mode=HA
#ha.server_id=104
#ha.initial_hosts=192.168.1.101:5001,192.168.1.102:5001,192.168.1.103:5001
#ha.host.coordination=192.168.1.101:5001

# 例子:因果集群
# dbms.mode=CORE
# 配置成当前机器IP或hostname
dbms.connectors.default_advertised_address=192.168.1.101
causal_clustering.minimum_core_cluster_size_at_formation=2
causal_clustering.minimum_core_cluster_size_at_runtime=2
causal_clustering.initial_discovery_members=192.168.1.101:5000,192.168.1.102:5000,192.168.1.103:5000
causal_clustering.discovery_listen_address=:5000
causal_clustering.transaction_listen_address=:6000
causal_clustering.raft_listen_address=:7000
# 列出此服务器所属的组的名称集。这是一个逗号分隔的列表,名字只能使用字母数字,主要目的是对服务器进行分组,但是也可以指定这里也是唯一的标识符,对于故障排除可能很有用或其他特殊用途。
#causal_clustering.server_groups=

#*****************************			数据导入配置 		************************************
# “LOAD CSV”导入文件限制在`import`目录下。删除注释允许从文件系统的任何地方加载文件;这引入了可能的安全问题。
dbms.directories.import=import
# 是否兼容以前版本的数据,默认true
dbms.allow_upgrade=true
dbms.security.allow_csv_import_from_file_urls=true

#*****************************			在线备份配置 		************************************
# 启用从该数据库进行在线备份
dbms.backup.enabled=false
# 备份服务地址绑定,如果是集群时与 causal_cluster.transaction_listen_address 搭配使用
dbms.backup.address=0.0.0.0:6362
# 对 CC 实例的备份服务进行不可加密(对单实例或HA集群无效)
#dbms.backup.ssl_policy=backup

#*****************************			日志配置 		************************************
# **** info 日志 **** 
# 要启用HTTP日志记录,请取消注释此行
dbms.logs.http.enabled=true
# 要保留的HTTP日志数
dbms.logs.http.rotation.keep_number=7
# 每个HTTP日志文件的大小
dbms.logs.http.rotation.size=20m

# **** GC 日志 **** 
# 要启用GC日志记录,请取消注释此行
#dbms.logs.gc.enabled=true
# GC日志记录选项 请参见http://docs.oracle.com/cd/E19957-01/819-0084-10/pt_tuningjava.html#wp57013
#dbms.logs.gc.options=-XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCApplicationStoppedTime -XX:+PrintPromotionFailure -XX:+PrintTenuringDistribution
# 要保留的GC日志数
#dbms.logs.gc.rotation.keep_number=5
# 保留的每个GC日志文件的大小
#dbms.logs.gc.rotation.size=20m

# **** 调试日志 **** 
# 调试日志旋转的大小阈值。如果设置为零,则不会发生滚动(达到指定大小后切割日志文件)。接受二进制后缀“k”,“m”或“g”
#dbms.logs.debug.rotation.size=20m
# 最多保存几个日志文件
#dbms.logs.debug.rotation.keep_number=7

# **** query 日志 **** 
# 开启查询语句耗时过高记录日志
#dbms.logs.query.enabled=true
# 如果查询时间超过该时间时记录到日志,等于0时全部记录
#dbms.logs.query.threshold=0
# 每个query日志文件大小,可设置单位 "k", "m" or "g".
#dbms.logs.query.rotation.size=20m
# 保留query日志文件最大个数
#dbms.logs.query.rotation.keep_number=7
# 记录执行查询的参数,默认开启。
#dbms.logs.query.parameter_logging_enabled=true
# 记录查询时间,默认开启
#dbms.logs.query.time_logging_enabled=true
# 记录查询所分配的大小,默认开启
#dbms.logs.query.allocation_logging_enabled=true
# 记录查询时页面操作和错误信息:
#dbms.logs.query.page_logging_enabled=true

# The security log is always enabled when `dbms.security.auth_enabled=true`, and resides in `logs/security.log`.
# **** security 日志 **** 
# 安全权限日志需开启身份验证(dbms.security.auth_enabled=true),保存日志在 `logs/security.log`
# 日志输出等级: DEBUG, INFO, WARN and ERROR.
#dbms.logs.security.level=INFO
# 每个日志文件最大块
#dbms.logs.security.rotation.size=20m
# 最小回滚时间
#dbms.logs.security.rotation.delay=300s
# 保留最大日志文件个数.
#dbms.logs.security.rotation.keep_number=7

#*****************************			SSL策略配置 		************************************
#bolt.ssl_policy=legacy
#https.ssl_policy=legacy
# SSL policy configuration
#dbms.ssl.policy.default.base_directory=certificates/default
#dbms.ssl.policy.default.allow_key_generation=false
#dbms.ssl.policy.default.trust_all=false
#dbms.ssl.policy.default.private_key=
#dbms.ssl.policy.default.public_certificate=
#dbms.ssl.policy.default.trusted_dir=
#dbms.ssl.policy.default.client_auth=require
#dbms.ssl.policy.default.tls_versions=
#dbms.ssl.policy.default.ciphers=

#*****************************		集群负载均衡配置 		************************************
# 选择要启用的负载平衡插件
#causal_clustering.load_balancing.plugin=server_policies
# 示例: "server_policies" 组件
# 将选择所有可用服务器作为默认策略,该策略是当客户端没有指定策略首选项时使用的策略。默认配置为all()。
#causal_clustering.load_balancing.config.server_policies.default=all()
# 在默认策略下选择组'group1''group2'中的服务器
#causal_clustering.load_balancing.config.server_policies.default=groups(group1,group2)
# 稍微高级一点的例子:将选择“group1”、“group2”或“group3”中的服务器,但仅当至少有2个服务器时才这样做。此策略将以“mypolicy”的名称公开。
#causal_clustering.load_balancing.config.server_policies.mypolicy=groups(group1,group2,group3) -> min(2)
#causal_clustering.load_balancing.config.server_policies.policyA=\
#groups(regionA) -> min(2);\
#groups(regionA,regionB) -> min(2);
#causal_clustering.load_balancing.config.server_policies.regionA_only=\
#groups(regionA);\
#halt();

# 附件配置选项,如果你不知道使用情况,建议注释
#causal_clustering.database=default 
#causal_clustering.raft_advertised_address=:7000
#causal_clustering.transaction_advertised_address=:6000
#causal_clustering.leader_election_timeout=7s
# 允许新成员尝试更新其数据以匹配集群其余部分的时间限制
#causal_clustering.join_catch_up_timeout=10m
# The size of the batch for streaming entries to other machines while trying to catch up another machine.
#causal_clustering.catchup_batch_size=64
# When to pause sending entries to other machines and allow them to catch up.
#causal_clustering.log_shipping_max_lag=256
#causal_clustering.raft_log_pruning_frequency=10m
#causal_clustering.raft_log_rotation_size=250M
#causal_clustering.pull_interval=1s
#causal_clustering.cluster_routing_ttl=300s

# HA集群附加配置
#dbms.mode=HA
#ha.server_id=
#ha.initial_hosts=127.0.0.1:5001,127.0.0.1:5002,127.0.0.1:5003
#ha.host.coordination=127.0.0.1:5001
#ha.host.data=127.0.0.1:6001
#dbms.logs.gc.options=-Xlog:gc*,safepoint,age*=trace
#ha.pull_interval=10
#ha.tx_push_factor=1
#ha.tx_push_strategy=fixed_ascending
#ha.branched_data_policy=keep_all
#ha.heartbeat_interval=5s
#ha.heartbeat_timeout=40s
#dbms.security.ha_status_auth_enabled=false
#ha.slave_only=false

#*****************************			其它配置 		************************************
# Enable this to specify a parser other than the default one.
#cypher.default_language_version=3.0

# Determines if Cypher will allow using file URLs when loading data using
# `LOAD CSV`. Setting this value to `false` will cause Neo4j to fail `LOAD CSV`
# clauses that load data from the file system.
#dbms.security.allow_csv_import_from_file_urls=true


# Value of the Access-Control-Allow-Origin header sent over any HTTP or HTTPS
# connector. This defaults to '*', which allows broadest compatibility. Note
# that any URI provided here limits HTTP/HTTPS access to that URI only.
#dbms.security.http_access_control_allow_origin=*

# Value of the HTTP Strict-Transport-Security (HSTS) response header. This header
# tells browsers that a webpage should only be accessed using HTTPS instead of HTTP.
# It is attached to every HTTPS response. Setting is not set by default so
# 'Strict-Transport-Security' header is not sent. Value is expected to contain
# dirictives like 'max-age', 'includeSubDomains' and 'preload'.
#dbms.security.http_strict_transport_security=

# Retention policy for transaction logs needed to perform recovery and backups.
dbms.tx_log.rotation.retention_policy=7 days

#*****************************			shell客户端 登陆配置 		************************************
# 启用Neo4j Shell客户端可以登录的远程shell服务器
dbms.shell.enabled=true
# The network interface IP the shell will listen on (use 0.0.0.0 for all interfaces).
#dbms.shell.host=127.0.0.1
# shell 开放端口 1337.
#dbms.shell.port=1337

# 只允许从Neo4j实例读取操作。此模式仍然需要对目录的写访问以用于锁定目的。
#dbms.read_only=false

#  包含JAX-RS资源的JAX-RS软件包的逗号分隔列表,每个安装点一个软件包名称。
#  所列出的软件包名称将在指定的安装点下加载。取消注释此行以装载org.neo4j.examples.server.unmanaged.HelloWorldResource.java neo4j-server-examples下/ examples / unmanaged,最终的URL为http//localhost7474/examples/unmanaged/helloworld/{nodeId} 
#dbms.unmanaged_extension_classes=org.neo4j.examples.server.unmanaged=/examples/unmanaged

#*****************************			JVM参数 		************************************
# G1GC通常在吞吐量和尾部延迟之间达到很好的平衡,而没有太多的调整。
dbms.jvm.additional=-XX:+UseG1GC
# Cypher commit size,提交大小
dbms.jvm.additional=-Xss50M
# 有共同的异常保持生成堆栈跟踪,所以他们可以被调试,无论日志被旋转的频率
dbms.jvm.additional=-XX:-OmitStackTraceInFastThrow

# 确保在启动数据库之前,“initmemory”不仅被分配,而且被提交到进程。这减少了内存碎片,增加了透明大页面的有效性。
# 它还减少了由于堆增长的GC事件而导致性能下降的可能性,其中可用页面缓存的减少导致平均IO响应时间的增加。如果此标志降低性能,请减少堆内存。    
dbms.jvm.additional=-XX:+AlwaysPreTouch

# 信任非静态final字段真的是final。这允许更多的优化和提高整体性能。注意:如果使用嵌入模式,或者有可能使用反射或序列化更改最终字段的值的扩展或依赖关系,请禁用此选项!
dbms.jvm.additional=-XX:+UnlockExperimentalVMOptions
dbms.jvm.additional=-XX:+TrustFinalNonStaticFields

# 禁用显式垃圾回收,这是偶尔由JDK本身调用。
dbms.jvm.additional=-XX:+DisableExplicitGC

# 远程JMX监视,取消注释并根据需要调整以下行。需要jmx.access和jmx.password文件的绝对路径。
# 还要确保使用适当的权限角色和密码更新jmx.access和jmx.password文件,所配置的配置只包含名为“monitor”的只读角色,密码为“Neo4j”。
# Also make sure to update the jmx.access and jmx.password files with appropriate permission roles and passwords,
# Unix系统,有关详情,请参阅:http://download.oracle.com/javase/8/docs/technotes/guides/management/agent.html,jmx.password文件需要由运行服务器的用户拥有,并且权限设置为0600。
# Windows系统  有关在设置这些文件权限的详细信息,请参阅:http://docs.oracle.com/javase/8/docs/technotes/guides/management/security-windows.html
#dbms.jvm.additional=-Dcom.sun.management.jmxremote.port=3637
#dbms.jvm.additional=-Dcom.sun.management.jmxremote.authenticate=true
#dbms.jvm.additional=-Dcom.sun.management.jmxremote.ssl=false
#dbms.jvm.additional=-Dcom.sun.management.jmxremote.password.file=/absolute/path/to/conf/jmx.password
#dbms.jvm.additional=-Dcom.sun.management.jmxremote.access.file=/absolute/path/to/conf/jmx.access

# 某些系统无法自动发现主机名,需要配置以下行::
#dbms.jvm.additional=-Djava.rmi.server.hostname=$THE_NEO4J_SERVER_HOSTNAME

# 对于服务器TLS握手中使用的DH-RSA密码套件,将Diffie Hellman(DH)密钥大小从默认1024展开到2048。
# 这是为了保护服务器免受任何潜在的被动窃听。
dbms.jvm.additional=-Djdk.tls.ephemeralDHKeySize=2048

# This mitigates a DDoS vector.
dbms.jvm.additional=-Djdk.tls.rejectClientInitiatedRenegotiation=true

#*****************************	Windows NT/2000/XP Service 参数	************************************
# 不要在应用程序运行时修改下列属性,在修改此部分之前请卸载此服务。然后可以重新安装服务
# 服务的名称
dbms.windows_service_name=neo4j

#*****************************	apoc参数	************************************
dbms.security.procedures.unrestricted=*
# Neo4j text index 此项配置可能会影响性能
apoc.autoIndex.enabled=true
# 数据导入导出
apoc.export.file.enabled=true
apoc.import.file.enabled=true

#*****************************	其它参数	************************************
dbms.jvm.additional=-Dunsupported.dbms.udc.source=tarball
# 事务处理超时
dbms.transaction.timeout=180180180s


更多推荐