Skip to content

Commit

Permalink
Merge pull request #6713 from benbc/3.0-settings-for-logs-and-dirs
Browse files Browse the repository at this point in the history
3.0 settings for logs and dirs
  • Loading branch information
benbc committed Mar 18, 2016
2 parents 8050ea8 + 9bdbc03 commit b32e766
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -182,29 +182,29 @@ public abstract class GraphDatabaseSettings
"procedures will be loaded if they are placed in this directory.")
public static final Setting<File> plugin_dir = setting("dbms.directories.plugins", PATH, "plugins" );

@Description( "Threshold for rotation of the internal log." )
public static final Setting<Long> store_internal_log_rotation_threshold = setting("store.internal_log.rotation_threshold", BYTES, "20m", min(0L), max( Long.MAX_VALUE ) );
@Description( "Threshold for rotation of the debug log." )
public static final Setting<Long> store_internal_log_rotation_threshold = setting("dbms.logs.debug.rotation.size", BYTES, "20m", min(0L), max( Long.MAX_VALUE ) );

@Description( "Internal log contexts that should output debug level logging" )
@Description( "Debug log contexts that should output debug level logging" )
@Internal
public static final Setting<List<String>> store_internal_debug_contexts = setting( "store.internal_log.debug_contexts",
public static final Setting<List<String>> store_internal_debug_contexts = setting( "unsupported.dbms.logs.debug.debug_loggers",
list( ",", STRING ), "org.neo4j.diagnostics,org.neo4j.cluster.protocol,org.neo4j.kernel.ha" );

@Description("Log level threshold.")
public static final Setting<Level> store_internal_log_level = setting( "store.internal_log.level",
@Description("Debug log level threshold.")
public static final Setting<Level> store_internal_log_level = setting( "dbms.logs.debug.level",
options( Level.class ), "INFO" );

@Description( "Maximum time to wait for active transaction completion when rotating counts store" )
@Internal
public static final Setting<Long> counts_store_rotation_timeout =
setting( "unsupported.dbms.counts_store_rotation_timeout", DURATION, "10m" );

@Description( "Minimum time interval after last rotation of the internal log before it may be rotated again." )
@Description( "Minimum time interval after last rotation of the debug log before it may be rotated again." )
public static final Setting<Long> store_internal_log_rotation_delay =
setting("store.internal_log.rotation_delay", DURATION, "300s" );
setting("dbms.logs.debug.rotation.delay", DURATION, "300s" );

@Description( "Maximum number of history files for the internal log." )
public static final Setting<Integer> store_internal_log_max_archives = setting("store.internal_log.max_archives", INTEGER, "7", min(1) );
@Description( "Maximum number of history files for the debug log." )
public static final Setting<Integer> store_internal_log_max_archives = setting("dbms.logs.debug.rotation.keep_number", INTEGER, "7", min(1) );

@Description( "Configures the transaction interval between check-points. The database will not check-point more " +
"often than this (unless check pointing is triggered by a different event), but might check-point " +
Expand Down Expand Up @@ -417,7 +417,7 @@ private static String defaultPageCacheMemory()

@Description( "Log executed queries that takes longer than the configured threshold. "
+ "_NOTE: This feature is only available in the Neo4j Enterprise Edition_." )
public static final Setting<Boolean> log_queries = setting("dbms.querylog.enabled", BOOLEAN, FALSE );
public static final Setting<Boolean> log_queries = setting("dbms.logs.query.enabled", BOOLEAN, FALSE );

@Description("Path of the logs directory")
public static final Setting<File> logs_directory = setting("dbms.directories.logs", PATH, "logs");
Expand All @@ -430,16 +430,16 @@ private static String defaultPageCacheMemory()

@Description("If the execution of query takes more time than this threshold, the query is logged - " +
"provided query logging is enabled. Defaults to 0 seconds, that is all queries are logged.")
public static final Setting<Long> log_queries_threshold = setting("dbms.querylog.threshold", DURATION, "0s");
public static final Setting<Long> log_queries_threshold = setting("dbms.logs.query.threshold", DURATION, "0s");

@Description( "Specifies at which file size the query log will auto-rotate. " +
"`0` means that no rotation will automatically occur based on file size." )
public static final Setting<Long> log_queries_rotation_threshold = setting("dbms.querylog.rotation.threshold",
@Description( "The file size in bytes at which the query log will auto-rotate. If set to zero then no rotation " +
"will occur. Accepts a binary suffix `k`, `m` or `g`." )
public static final Setting<Long> log_queries_rotation_threshold = setting("dbms.logs.query.rotation.size",
BYTES, "20m", min( 0L ), max( Long.MAX_VALUE ) );

@Description( "Maximum number of history files for the query log." )
public static final Setting<Integer> log_queries_max_archives = setting( "dbms.querylog.max_archives", INTEGER,
"7", min( 1 ) );
public static final Setting<Integer> log_queries_max_archives = setting( "dbms.logs.query.rotation.keep_number",
INTEGER, "7", min( 1 ) );

@Description( "Specifies number of operations that batch inserter will try to group into one batch before " +
"flushing data into underlying storage.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ private ThirdPartyJaxRsPackage createThirdPartyJaxRsPackage( String packageAndMo

@SuppressWarnings("unused") // used only in the startup scripts
@Description("Size of each GC log that is kept.")
Setting<Long> gc_logging_rotation_size = setting("dbms.logs.rotation.gc.size", BYTES, "20m", min(0L), max( Long.MAX_VALUE ) );
Setting<Long> gc_logging_rotation_size = setting("dbms.logs.gc.rotation.size", BYTES, "20m", min(0L), max( Long.MAX_VALUE ) );

@SuppressWarnings("unused") // used only in the startup scripts
@Description("Path of the run directory")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public String toString()
list( ",", HOSTNAME_PORT ), MANDATORY );

@Description( "Host and port to bind the cluster management communication." )
public static final Setting<HostnamePort> cluster_server = setting( "ha.cluster_server", HOSTNAME_PORT,
public static final Setting<HostnamePort> cluster_server = setting( "ha.host.coordination", HOSTNAME_PORT,
"0.0.0.0:5001-5099" );

@Description( "Whether to allow this instance to create a cluster if unable to join." )
Expand Down
34 changes: 17 additions & 17 deletions enterprise/ha/src/docs/dev/ha-setup-tutorial.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,18 @@ It must be a positive integer and must be unique among all Neo4j instances in th

For example, +ha.server_id=1+.

=== ha.cluster_server
=== ha.host.coordination

+ha.cluster_server+ is an address/port setting that specifies where the Neo4j instance will listen for cluster communications (like hearbeat messages).
+ha.host.coordination+ is an address/port setting that specifies where the Neo4j instance will listen for cluster communications (like hearbeat messages).
The default port is +5001+.
In the absence of a specified IP address, Neo4j will attempt to find a valid interface for binding.
While this behavior typically results in a well-behaved server, it is _strongly recommended_ that users explicitly choose an IP address bound to the network interface of their choosing to ensure a coherent cluster deployment.

For example, +ha.cluster_server=192.168.33.22:5001+ will listen for cluster communications on the network interface bound to the 192.168.33.0 subnet on port 5001.
For example, +ha.host.coordination=192.168.33.22:5001+ will listen for cluster communications on the network interface bound to the 192.168.33.0 subnet on port 5001.

=== ha.initial_hosts

+ha.initial_hosts+ is a comma separated list of address/port pairs, which specify how to reach other Neo4j instances in the cluster (as configured via their +ha.cluster_server+ option).
+ha.initial_hosts+ is a comma separated list of address/port pairs, which specify how to reach other Neo4j instances in the cluster (as configured via their +ha.host.coordination+ option).
These hostname/ports will be used when the Neo4j instances start, to allow them to find and join the cluster.
Specifying an instance's own address is permitted.

Expand All @@ -54,25 +54,25 @@ Do _not_ use any whitespace in this configuration option.
For example, +ha.initial_hosts=192.168.33.22:5001,192.168.33.21:5001+ will attempt to reach Neo4j instances listening on
192.168.33.22 on port 5001 and 192.168.33.21 on port 5001 on the 192.168.33.0 subnet.

=== ha.server
=== ha.host.data

+ha.server+ is an address/port setting that specifies where the Neo4j instance will listen for transactions (changes to the graph data) from the cluster master.
+ha.host.data+ is an address/port setting that specifies where the Neo4j instance will listen for transactions (changes to the graph data) from the cluster master.
The default port is +6001+.
In the absence of a specified IP address, Neo4j will attempt to find a valid interface for binding.
While this behavior typically results in a well-behaved server, it is _strongly recommended_ that users explicitly choose an IP address bound to the network interface of their choosing to ensure a coherent cluster topology.

+ha.server+ must user a different port to +ha.cluster_server+.
+ha.host.data+ must use a different port to +ha.host.coordination+.

For example, +ha.server=192.168.33.22:6001+ will listen for cluster communications on the network interface bound to the 192.168.33.0 subnet on port 6001.
For example, +ha.host.data=192.168.33.22:6001+ will listen for cluster communications on the network interface bound to the 192.168.33.0 subnet on port 6001.

[TIP]
.Address/port format
====
The +ha.cluster_server+ and +ha.server+ configuration options are specified as +<IP address>:<port>+.
The +ha.host.coordination+ and +ha.host.data+ configuration options are specified as +<IP address>:<port>+.
For +ha.server+ the IP address _must be_ the address assigned to one of the host's network interfaces.
For +ha.host.data+ the IP address _must be_ the address assigned to one of the host's network interfaces.
For +ha.cluster_server+ the IP address _must be_ the address assigned to one of the host's network interfaces, or the value +0.0.0.0+, which will cause Neo4j to listen on every network interface.
For +ha.host.coordination+ the IP address _must be_ the address assigned to one of the host's network interfaces, or the value +0.0.0.0+, which will cause Neo4j to listen on every network interface.
Either the address or the port can be omitted, in which case the default for that part will be used.
If the address is omitted, then the port must be preceded with a colon (eg. +:5001+).
Expand Down Expand Up @@ -239,11 +239,11 @@ ha.initial_hosts = 127.0.0.1:5001,127.0.0.1:5002,127.0.0.1:5003
# IP and port for this instance to bind to for communicating cluster information
# with the other neo4j instances in the cluster.
ha.cluster_server = 127.0.0.1:5001
ha.host.coordination = 127.0.0.1:5001
# IP and port for this instance to bind to for communicating data with the
# other neo4j instances in the cluster.
ha.server = 127.0.0.1:6363
ha.host.data = 127.0.0.1:6363
# HA - High Availability
# SINGLE - Single mode, default.
Expand Down Expand Up @@ -274,11 +274,11 @@ ha.initial_hosts = 127.0.0.1:5001,127.0.0.1:5002,127.0.0.1:5003
# IP and port for this instance to bind to for communicating cluster information
# with the other neo4j instances in the cluster.
ha.cluster_server = 127.0.0.1:5002
ha.host.coordination = 127.0.0.1:5002
# IP and port for this instance to bind to for communicating data with the
# other neo4j instances in the cluster.
ha.server = 127.0.0.1:6364
ha.host.data = 127.0.0.1:6364
# HA - High Availability
# SINGLE - Single mode, default.
Expand Down Expand Up @@ -309,11 +309,11 @@ ha.initial_hosts = 127.0.0.1:5001,127.0.0.1:5002,127.0.0.1:5003
# IP and port for this instance to bind to for communicating cluster information
# with the other neo4j instances in the cluster.
ha.cluster_server = 127.0.0.1:5003
ha.host.coordination = 127.0.0.1:5003
# IP and port for this instance to bind to for communicating data with the
# other neo4j instances in the cluster.
ha.server = 127.0.0.1:6365
ha.host.data = 127.0.0.1:6365
# HA - High Availability
# SINGLE - Single mode, default.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public class HaSettings
setting( "ha.max_channels_per_slave", INTEGER, "20", min( 1 ) );

@Description( "Hostname and port to bind the HA server." )
public static final Setting<HostnamePort> ha_server = setting( "ha.server", HOSTNAME_PORT, "0.0.0.0:6001-6011" );
public static final Setting<HostnamePort> ha_server = setting( "ha.host.data", HOSTNAME_PORT, "0.0.0.0:6001-6011" );

@Description("Whether this instance should only participate as slave in cluster. "
+ "If set to `true`, it will never be elected as master.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,14 @@ org.neo4j.server.http.log.config=conf/neo4j-http-logging.xml
#dbms.logs.gc.rotation.keep_number=5

# Size of each GC log that is kept.
#dbms.logs.rotation.gc.size=20m
#dbms.logs.gc.rotation.size=20m

# Size threshold for rotation of the debug log. If set to zero then no rotation will occur. Accepts a binary suffix "k",
# "m" or "g".
#dbms.logs.debug.rotation.size=20m

# Maximum number of history files for the internal log.
#dbms.logs.debug.rotation.keep_number=7

# Enable this to be able to upgrade a store from an older version.
#dbms.allow_format_migration=true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,20 @@ dbms.security.tls_key_file=#{dbms.security.tls_key_file}
# Number of Neo4j worker threads.
#dbms.threads.worker_count=

# Log executed queries that takes longer than the configured threshold. Enable by uncommenting this line.
#dbms.logs.query.enabled=true

# If the execution of query takes more time than this threshold, the query is logged. If set to zero then all queries
# are logged.
#dbms.logs.query.threshold=0

# The file size in bytes at which the query log will auto-rotate. If set to zero then no rotation will occur. Accepts a
# binary suffix "k", "m" or "g".
#dbms.logs.query.rotation.size=20m

# Maximum number of history files for the query log.
#dbms.logs.query.rotation.keep_number=7

#*****************************************************************
# HTTP logging configuration
#*****************************************************************
Expand Down Expand Up @@ -100,7 +114,14 @@ org.neo4j.server.http.log.config=conf/neo4j-http-logging.xml
#dbms.logs.gc.rotation.keep_number=5

# Size of each GC log that is kept.
#dbms.logs.rotation.gc.size=20m
#dbms.logs.gc.rotation.size=20m

# Size threshold for rotation of the debug log. If set to zero then no rotation will occur. Accepts a binary suffix "k",
# "m" or "g".
#dbms.logs.debug.rotation.size=20m

# Maximum number of history files for the internal log.
#dbms.logs.debug.rotation.keep_number=7

# Enable this to be able to upgrade a store from an older version.
#dbms.allow_format_migration=true
Expand Down Expand Up @@ -152,19 +173,19 @@ org.neo4j.server.http.log.config=conf/neo4j-http-logging.xml
#ha.server_id=

# ha.initial_hosts is a comma-separated list (without spaces) of the host:port
# where the ha.cluster_server of all instances will be listening. Typically
# where the ha.host.coordination of all instances will be listening. Typically
# this will be the same for all cluster instances.
#ha.initial_hosts=192.168.0.1:5001,192.168.0.2:5001,192.168.0.3:5001

# IP and port for this instance to listen on, for communicating cluster status
# information iwth other instances (also see ha.initial_hosts). The IP
# must be the configured IP address for one of the local interfaces.
#ha.cluster_server=192.168.0.1:5001
#ha.host.coordination=192.168.0.1:5001

# IP and port for this instance to listen on, for communicating transaction
# data with other instances (also see ha.initial_hosts). The IP
# must be the configured IP address for one of the local interfaces.
#ha.server=192.168.0.1:6001
#ha.host.data=192.168.0.1:6001

# The interval at which slaves will pull updates from the master. Comment out
# the option to disable periodic pulling of updates. Unit is seconds.
Expand Down

0 comments on commit b32e766

Please sign in to comment.