layout: website-normal title: Increase Entropy toc: /guide/toc.json

Checking entropy level

A lack of entropy can cause random number generation to be extremely slow. This results in tasks like ssh to also be extremely slow. One can check the available entropy on a machine by running the command:

{% highlight bash %} cat /proc/sys/kernel/random/entropy_avail {% endhighlight %}

It should be a value above 2000.

If you are installing Apache Brooklyn on a virtual machine, you may find that it has insufficient entropy. You may need to increase the Linux kernel entropy in order to speed up the ssh connections to the managed entities. You can install and configure rng-tools, or just use /dev/urandom`.

Installing rng-tool

If you are using a RHEL 6 based OS:

{% highlight bash %} sudo -i yum -y -q install rng-tools echo “EXTRAOPTIONS="-r /dev/urandom"” | cat >> /etc/sysconfig/rngd /etc/init.d/rngd start {% endhighlight %}

If you are using a RHEL 7 or a systemd based system:

{% highlight bash %} sudo yum -y -q install rng-tools

Configure rng to use /dev/urandom

Change the “ExecStart” line to:

ExecStart=/sbin/rngd -f -r /dev/urandom

sudo vi /etc/systemd/system/multi-user.target.wants/rngd.service

sudo systemctl daemon-reload sudo systemctl start rngd {% endhighlight %}

If you are using a Debian-based OS:

{% highlight bash %} sudo -i apt-get -y install rng-tools echo “HRNGDEVICE=/dev/urandom” | cat >> /etc/default/rng-tools /etc/init.d/rng-tools start {% endhighlight %}

Using /dev/urandom

You can also just mv /dev/random then create it again linked to /dev/urandom:

{% highlight bash %} sudo mv /dev/random /dev/random-real sudo ln -s /dev/urandom /dev/random {% endhighlight %}

Notice! If you map /dev/random to use /dev/urandom you will need to restart the Apache Brooklyn java process in order for the change to take place.

More Information

The following links contain further information: