Bondy Connect
Skip to content

Configuration Basics ​

The bondy.conf file ​

Bondy configuration file is used to set a wide variety of static configuration options. The file location depends on the installation method you've used as shown in the following table.

Installation methodLocation
Source tarballetc/bondy.conf, under the directory where you unpacked the release
Docker image/bondy/etc/bondy.conf

Syntax ​

The file uses a sysctl-like syntax that looks like this:

text
security.allow_anonymous_user = off
cluster.enabled = off

The node name and the distribution cookie are not bondy.conf keys. Set them with the BONDY_ERL_NODENAME and BONDY_ERL_DISTRIBUTED_COOKIE environment variables.

Notice

Notice that for every option not provided by your configuration, Bondy will define a default value (also specified in the following sections).

Variable replacement ​

A value in bondy.conf can contain $(key), where key is another key of the file. Bondy replaces $(key) with the value of that key, or with its default when the file does not set it. The directory keys platform_data_dir, platform_log_dir, platform_tmp_dir, platform_lib_dir and platform_runtime_dir are the usual choices.

broker_bridge.config_file = $(platform_data_dir)/broker_bridge_config.json

platform_etc_dir is not a bondy.conf key, so $(platform_etc_dir) does not work. When a substitution names a key that does not exist, cuttlefish rejects the whole file without a message. The node then starts on the configuration that the last successful generation wrote, so none of your changes apply.

OS environment variables

$(key) does not read OS environment variables. To use them, write the file as etc/bondy.conf.template and write each variable as ${VARNAME}. On every start, the pre-start hook writes etc/bondy.conf from each *.template file in etc. If a variable named in a template is unset, the node does not start.

Feature-specific configuration files ​

Some features and/or subsystems in Bondy allow providing an additional JSON configuration file e.g. the Security subsystem.

In those cases, we need to let Bondy know where to find those specific files. This is done in the bondy.conf under the desired section e.g. the following configuration file adds the location for the security_conf.json file.

security.allow_anonymous_user = off
security.config_file = /bondy/etc/security_conf.json

Environment variables ​

Operating System Configuration ​

Configuring Open File Limits ​

Bondy can accumulate a large number of open file handles during operation. The creation of numerous data files is normal, and the storage backend performs periodic merges of data file collections to avoid accumulating file handles.

Increase the open files limit on your system. We recommend setting a soft limit of 65536 and a hard limit of 200000.

Most operating systems can check and change the open-files limit for the current shell session using the ulimit command.

Start by checking the current open file limit values with:

bash
ulimit -Hn # Hard limit
ulimit -Sn # Soft limit

Set the limit by using:

bash
ulimit -n 200000

This configuration persists only for the duration of your shell session. To change the limit on a system-wide, permanent basis read the following sections.

Open file limits on Linux

On most Linux distributions, the total limit for open files is controlled by sysctl.

If Bondy runs as the bondy user, add the following settings to the /etc/security/limits.conf file:

bash
bondy soft nofile 65536
bondy hard nofile 200000
Open file limits on Debian and Ubuntu using PAM

You can enable PAM-based user limits so that non-root users, such as the bondy user, may specify a higher value for maximum open files.

Edit /etc/pam.d/common-session and add the following line:

bash
session required pam_limits.so

Save and close the file. If /etc/pam.d/common-session-noninteractive exists, append the same line as above.

Then, edit /etc/security/limits.conf and append the following lines to the file:

bash
soft nofile 65536
hard nofile 200000

Save and close the file.

(Optional) If you will be accessing the Bondy nodes via secure shell (SSH), you should also edit /etc/ssh/sshd_config and set the following line:

UseLogin yes

Restart the machine so the limits take effect and verify that the new limits are set with the following command:

bash
ulimit -a
Open file limits on Docker running on K8s

Docker ulimits limit a program's resource utilization to prevent a run-away bug or security breach from bringing the whole system down.

The instructions below describe how to check what your current value is, and then increase it to allow Bondy to run.

To increase the ulimit value:

  1. Connect to the desired worker node and execute the following command:
bash
systemctl show docker
  1. Search for NOFILE.
  2. If the output is “1024”, edit the file:
bash
/etc/sysconfig/docker

and replace the line:

bash
OPTIONS=" — default-ulimit nofile=1024:4096"

with:

bash
OPTIONS="--default-ulimit nofile=2000000:2000000"
  1. Restart the Docker daemon
bash
sudo systemctl restart docker
Open file limits on DockerUser

Use docker run --ulimit

bash
$ docker run --ulimit nofile=2000000:2000000