Event Store 3.0.0 - Configuration Changes

News
,

As we gear up to launch version 3.0.0 of [Event Store](/event-store/) at our annual birthday party (which you should totally come to!), we decided it would be a good idea to run a short series of articles describing some of the new features and changes for those who haven’t seen them. If there are things you want to know about in particular, please get in touch on Twitter, @eventstore

Configuration Changes

Since version 1 of Event Store we’ve supported setting configuration options in a variety of ways to suit a range of different use cases - either from the command line, from a configuration file or from environment variables. The original code that handled this was particularly hairy, and has been subject to a complete rewrite in version 3 (thanks originally to a great open-source contribution by Pieter, who is now part of the Event Store team!)

This post will outline the user perspective on how configuration works and what has changed - there’ll also be some links to the code for those interested!

Option Precedence

All sources of configuration are evaluated, and the effective configuration chosen as a result of the following precedence list (as of c4336c23):

  • Command Line Parameter (Most important)
  • Environment Variable
  • Configuration File
  • Default (Least important)

Consequently, if you have, for example, Db: /home/Ouro/myDb/ in the configuration file, but also pass in --db /tmp/random, the effective value will be /tmp/random as the command line has a higher precedence than the configuration file.

Testing a Configuration

Event Store writes the running config to the logs each time it starts. However, when testing it can be useful to know what the effective config will be without actually doing anything. Following Powershell’s lead therefore, we added a -WhatIf option (or --what-if if you prefer) which runs the Event Store to the point it would output the configuration and then exits.

Configuration Formats

The configuration file format for versions 1 and 2 (and v3-rc2) of Event Store was JSON. However, this was a particularly nasty file format which didn’t allow inline comments and caused Windows users issues with paths. As of v3-rc9, the configuration file format has been changed to YAML, which is more suitable for configuration.

Note: YAML is case-sensitive, so the options have to be capitalized in the configuration file. The output of EventStore.ClusterNode.exe --help or ./clusternode --help show the options in the correct format for the configuration file.

A typical configuration file to run a single node Event Store on the default ports on an external interface might look like this:

# Database and logs path
Db: /home/Ouro/myDb

# Bind external interface to external IP address
ExtIp: 192.168.1.2

# Leave port defaults alone

# Run all projections
RunProjections: All

Default Config Files

The idea of a default configuration file path for a node has gone in version 3

  • it caused too many issues when trying to run a cluster of three nodes on the same box (for example, for integration testing). Consequently it is required to specify the location of the configuration file either by passing --config /path/to/config on the command line or by setting the EVENTSTORE_CONFIG environment variable to the file path if you only have one node running on the box.

Related posts

Event Store Announces EventStoreDB Name Change

News
,

We are pleased to announce a name change to our core product: the current Event Store open source database technology will be renamed EventStoreDB. "There are two major reasons for the name change. One is to make it as clear as possible that the flagship Event Store technology is a database technology. We had occasional feedback that this wasn't completely clear. Two, it makes room for other products that are on Event Store's roadmap and...


Announcing a New Versioning Strategy

News
,

There's a lot of changes happening at Event Store, with an increase in team size and a new vision for taking Event Store to the next level. As part of these changes, we are updating our versioning and release strategy. This is to make it clearer to our customers when they can expect a new release and how long we will support it for. From the next release (that would have been called V6) we...


Event Store Has a New and Improved Community Forum

News
,

We are pleased to announce our new forum is now live at [discuss.eventstore.com](https://discuss.eventstore.com/)! It replaces our Google Group as the primary place for our community of developers to connect with other users and the team behind Event Store, to ask questions, find answers, and discuss all things Event Store with the rest of the community. It also acts as a great way for the community to provide us with vital feedback to help us understand...