Skip to content

Commit

Permalink
Fill in intall docs
Browse files Browse the repository at this point in the history
Signed-off-by: Tobin C. Harding <me@tobin.cc>
  • Loading branch information
tcharding committed Apr 18, 2018
1 parent 06b4883 commit 380a9a5
Showing 1 changed file with 94 additions and 2 deletions.
96 changes: 94 additions & 2 deletions install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,101 @@ Install and Configuration

.. _install:

Running the AppSwitch docker image will start the ``ax`` daemon and also copy
the binary onto the host at ``/usr/bin/ax``. No further installation is
required. However if you wish to run the daemon on the host without Docker then
please see below.


Install on Bare Metal
=====================

Although the usual use case for AppSwitch is to run it from within a docker
container we describe here the installation method to run AppSwitch
directly on a host machine.
container we describe here the installation method to run AppSwitch directly on
a host machine.


Components
----------

The AppSwitch binary is used to run an application as well as running the
ax daemon.
::

$ ax daemon & `# run the AppSwitch daemon`
$ ax run -- nc -l 9999 `# run netcat under AppSwitch`

For an application to be run under AppSwitch the AppSwitch (ax) daemon must
be running.

The daemon can be configured using a configuration file typically located
in ``/etc/default/ax.config``.
::

# Name of the node (defaults to host name)
APPSWITCH_NAME=

# Datacenter name (defaults to appswitch)
APPSWITCH_DATA_CENTER=

# Name/IP of the interface to bind (defaults to first interface)
APPSWITCH_INTERFACE=

# Name/IP of the external interface to bind (for inter datacenter connectivity)
APPSWITCH_EXTERNAL_INTERFACE=

# IP addresses of other nodes in the cluster for bootstrap (comma separated list)
APPSWITCH_NEIGHBORS=

# IP addresses of other nodes in the cluster for bootstrap (comma separated list)
APPSWITCH_WAN_NEIGHBORS=

# DNS domain for the appswitch cluster
APPSWITCH_DNS_DOMAIN="appswitch.local"

# Additional options
APPSWITCH_OPTS=

These configuration options can also be passed to the daemon on the command
line.


Install
-------

AppSwitch is distributed as a static binary. Therefore to install all that
is required is placing the binary in your path, typically at ``/usr/bin/ax``.


Systemd
-------

You may like to bring up the daemon using systemd. To do so, first create a
service file ``/etc/systemd/system/ax.service``
::

[Unit]
Description=AppSwitch Daemon
Requires=network-online.target
After=network-online.target

[Service]
Restart=on-failure
EnvironmentFile=/etc/default/ax.config
ExecStart=/bin/sh -c '/usr/bin/ax daemon \
--service.name=$APPSWITCH_NAME \
--service.dataCenter=$APPSWITCH_DATA_CENTER \
--service.ip=$APPSWITCH_INTERFACE \
--service.extIp=$APPSWITCH_EXTERNAL_INTERFACE \
--service.neighbors=$APPSWITCH_NEIGHBORS \
--service.wanNeighbors=$APPSWITCH_WAN_NEIGHBORS \
--dns.domain=$APPSWITCH_DNS_DOMAIN \
$APPSWITCH_OPTS \
>> /var/log/ax.log 2>&1'

ExecReload=/bin/kill -HUP $MAINPID
KillSignal=SIGINT
KillMode=control-group

[Install]
WantedBy=multi-user.target

0 comments on commit 380a9a5

Please sign in to comment.