--- layout: default navsection: installguide title: Install a compute node ... h2. Install dependencies First, "add the appropriate package repository for your distribution":{{ site.baseurl }}/install/install-manual-prerequisites.html#repos. {% include 'note_python_sc' %} On CentOS 6 and RHEL 6:
~$ sudo yum install perl python27-python-virtualenv fuse python27-python-arvados-python-client python27-python-arvados-fuse crunchrunner crunchstat arvados-docker-cleaner iptables ca-certificates
On other Red Hat-based systems:
~$ echo 'exclude=python2-llfuse' | sudo tee -a /etc/yum.conf
~$ sudo yum install perl python-virtualenv fuse python-arvados-python-client python-arvados-fuse crunchrunner crunchstat arvados-docker-cleaner iptables ca-certificates
On Debian-based systems:
~$ sudo apt-get install perl python-virtualenv fuse python-arvados-python-client python-arvados-fuse crunchrunner crunchstat arvados-docker-cleaner iptables ca-certificates
{% include 'install_compute_docker' %} h2. Set up SLURM Install SLURM following "the same process you used to install the Crunch dispatcher":install-crunch-dispatch.html#slurm. h2. Copy configuration files from the dispatcher (API server) The @slurm.conf@ and @/etc/munge/munge.key@ files need to be identical across the dispatcher and all compute nodes. Copy the files you created in the "Install the Crunch dispatcher":install-crunch-dispatch.html step to this compute node. {% include 'install_compute_fuse' %} {% include 'install_docker_cleaner' %} h2. Add a Crunch user account Create a Crunch user account, and add it to the @fuse@ and @docker@ groups so it can use those tools:
~$ sudo useradd --groups fuse,docker crunch
The crunch user should have the same UID, GID, and home directory across all compute nodes and the dispatcher (API server). h2. Tell the API server about this compute node Load your API superuser token on the compute node:

~$ HISTIGNORE=$HISTIGNORE:'export ARVADOS_API_TOKEN=*'
~$ export ARVADOS_API_TOKEN=@your-superuser-token@
~$ export ARVADOS_API_HOST=@uuid_prefix.your.domain@
~$ unset ARVADOS_API_HOST_INSECURE

Then execute this script to create a compute node object, and set up a cron job to have the compute node ping the API server every five minutes:

#!/bin/bash
set -e
if ! test -f /root/node.json ; then
    python - <<EOF
import arvados, json, socket
fqdn = socket.getfqdn()
hostname, _, domain = fqdn.partition('.')
node = arvados.api('v1').nodes().create(body={'hostname': hostname, 'domain': domain}).execute()
with open('/root/node.json', 'w') as node_file:
    json.dump(node, node_file, indent=2)
EOF

    # Make sure /dev/fuse permissions are correct (the device appears after fuse is loaded)
    chmod 1660 /dev/fuse && chgrp fuse /dev/fuse
fi

UUID=`grep \"uuid\" /root/node.json  |cut -f4 -d\"`
PING_SECRET=`grep \"ping_secret\" /root/node.json  |cut -f4 -d\"`

if ! test -f /etc/cron.d/node_ping ; then
    echo "*/5 * * * * root /usr/bin/curl -k -d ping_secret=$PING_SECRET https://$ARVADOS_API_HOST/arvados/v1/nodes/$UUID/ping" > /etc/cron.d/node_ping
fi

/usr/bin/curl -k -d ping_secret=$PING_SECRET https://$ARVADOS_API_HOST/arvados/v1/nodes/$UUID/ping?ping_secret=$PING_SECRET

And remove your token from the environment:

~$ unset ARVADOS_API_TOKEN
~$ unset ARVADOS_API_HOST