Database Configuration for a Particular Host (nuodb.config)


The nuodb.config file is a standard configuration file, which one could optionally supply to the NuoDB config database option. It contains a list of database options, presented as key/value pairs, where the key is separated from its value by whitespace, and each key/value pair is on its own line.

The nuodb.config file is installed in NUODB_HOME/etc. The NuoDB Manager will search for nuodb.config there.

Caution: Stopping and starting a database is required to cause changes in nuodb.config to be read.

Default nuodb.config

By default, when NuoDB is installed, nuodb.config contains the following:

verbose error,flush,warn 

Database Options Precedence

By default, any NuoDB database process will read database options specified in NUODB_HOME/etc/nuodb.config.

These can be overwritten by specifying the config database option and pointing at an alternate configuration file.

Furthermore, these can all be overwritten, by specifying database options in the NuoDB Manager. For more information see Precedence for Database Process Options.

Specifying SM Versus TE Database Options

There is only one nuodb.config file per host. This means that you need to specify database options that might only apply to a storage manager (for example, all the journal-* options) in addition to database options that might only apply to a transaction engine (for example, jvm-lib). This is fine because storage managers ignore options for transaction engines and transaction engines ignore options for storage managers. In other words, you can specify all options in the one nuodb.config file.

Useful Database Option Settings

The nuodb.config file is most useful for setting database options that are specific to the particular host where a TE or SM is running. There are some common cases where this would be helpful.

Pointing at the Local JVM

The transaction engine needs to know the location of the JVM in order to run Java stored procedures. The jvm-lib argument is used to force the TE to load a specific instance of a JVM. If jvm-lib is not specified, the TE will use a search algorithm that on Windows will end up choosing the default JVM as specified in the registry, and on Unix will search for the JVM as specified by the JAVA_HOME environment variable first and then in well-known locations (/usr/java, /usr/lib/java, /opt/java, etc...). If on a physical host in the domain, the JVM is installed in a non-default location, not pointed to by the JAVA_HOME environment variable, then specifying jvm-lib in the nuodb.config file is useful.

Sample jvm-lib setting in nuodb.config:

jvm-lib /home/joey/myjvm 

Setting Journal Options

See the options beginning with journal- at Database Options. It might be ideal to set these per physical host in the domain. In particular, journal-sync-method specifies the filesystem synchronization mechanism when the journal needs to ensure the durability of a commit. The sync mechanism has been specifically tuned for each supported OS. The kernel sync method is the fastest but requires a battery backed disk controller. The kernel method on Linux also requires the filesystem to support fallocate, that is, ext4. The disk sync method is the most durable but slowest method. The osync method is available for copy-on-write filesystems, a.k.a. ZFS.

Sample journal setting in nuodb.config:

journal-sync-method osync

Verify nuodb.config Settings

You can verify changes to process options in NuoDB Manager. Let's say for example, we have a NUODB_HOME/etc/nuodb.config file that looks as follows:

jvm-lib /home/joey/myjvm
journal-sync-method osync 
max-http-connections 150

Assume these changes were made on a host with the IP address and the process we want to check is a TE with pid 362. In NuoDB Manager, use the following steps:

nuodb [domain] > show database processes
Database: test
Include options (optional): journal-sync-method max-http-connections
[SM] ip-172-31-46-122/ (us-east-1) [ pid = 5779 ] [ db = test ] 
  [ nodeId = 1 ] [ journal-sync-method osync ] [ max-http-connections = 150 ] RUNNING
[TE] ip-172-31-46-122/ (us-east-1) [ pid = 5834 ] [ db = test ] 
  [ nodeId = 3 ] [ journal-sync-method osync ] [ max-http-connections = 150 ] RUNNING
[SM] ip-172-31-40-24/ (us-east-1) [ pid = 340 ] [ db = test ] 
  [ nodeId = 2 ] [ journal-sync-method osync ] [ max-http-connections = 150 ] RUNNING
[TE] ip-172-31-40-24/ (us-east-1) [ pid = 362 ] [ db = test ] 
  [ nodeId = 4 ] [ journal-sync-method osync ] [ max-http-connections = 150 ] RUNNING

nuodb [domain] > show process config
Process ID: 362
Configuration for ip-172-31-40-24/
agent-port = 48004
allow-non-durable = false
commit = remote:1
config = /opt/nuodb/etc/nuodb.config
database = test
enabled-ciphers = RC4
help = false
initialize = false
journal = enable
journal-buffer-size-bytes = 1000000
journal-max-directory-entries = 1000
journal-max-file-size-bytes = 1000000
journal-sleep-interval-ms = 10
journal-sync-method = osync
jvm-lib = /home/joey/jvm/lib/
max-http-connections = 150
mem = 2147483648
node-port = 48005
show-archive-history = false
version = false

Note: Options related to journaling, for example --journal-buffer-size-bytes are configurable. The exception to this is --journal which is enabled by default and cannot be disabled. For more information on using options related to journaling, see Database Options.