Host: Linux - adobe/aquarium-fish GitHub Wiki

Aquarium Fish node could be running on Linux.

Deploy the Fish node

Of course you can just download the aquarium-fish binary and run it as is, but if you want to deploy it as an autostart service and less privileged user, it's worth to follow those steps. Not all the commands are necessary and here mostly to show the general path of how to make it right.

The commands are executed through SSH as root on Ubuntu 20.04 x64. Make sure you know what you doing for each step and adjust for your system.

  1. Create non privileged user for fish node:

    useradd aquarium-fish
  2. (optional) Install docker to use it as resource provider:

    apt update
    apt install docker.io
    usermod -aG docker aquarium-fish
  3. Create main service folder for fish node:

    mkdir -p /srv/aquarium-fish/ws
    chown aquarium-fish:aquarium-fish /srv/aquarium-fish/ws
    chgrp aquarium-fish /srv/aquarium-fish
  4. Copy aquarium-fish binary to the right place:

    tar -C /srv/aquarium-fish --no-same-owner -xf aquarium-fish-v*.linux_amd64.tar.xz
  5. Create config file to define the node:

    ---
    node_name: test-node-lin.corp.example.com
    node_location: us-west-2a
    default_resource_lifetime: 1h30m
    
    # Recommended to specify how much resources the Fish node could consume
    cpu_limit: 2         # For local resource management 1-2 is ok, for server-only could be skipped to consume as much as possible
    mem_target: '512MB'  # To tell GC where to become really aggressive, otherwise could cause OOM if to close to system limit
    
    # In case you configure the drivers - only the defined drivers will be activated
    drivers:
      # Configure docker here for example
      - name: docker
        cfg:
          download_user: user
          download_password: password
    vim /srv/aquarium-fish/config.yml
    chown root:aquarium-fish /srv/aquarium-fish/config.yml
    chmod 640 /srv/aquarium-fish/config.yml
  6. Run aquarium-fish first time to get admin creds, then press Ctrl-C to stop it: WARNING: This command will create SSL CA which will last for 1 year. Please check openssl docs to generate better CA and certificates for nodes in your cluster.

    su - aquarium-fish sh -c 'cd /srv/aquarium-fish/ws && ../aquarium-fish -c ../config.yml'
    ...
    <Ctrl-C>
    
    pkill aquarium-fish
  7. Create the unit service file to the systemd configs

    [Unit]
    Description=Run aquarium-fish node service as unprivileged user
    After=network.target
    
    [Service]
    Type=simple
    User=aquarium-fish
    Group=aquarium-fish
    WorkingDirectory=/srv/aquarium-fish/ws
    ExecStart=/srv/aquarium-fish/aquarium-fish --timestamp false -c /srv/aquarium-fish/config.yml
    TimeoutStartSec=0
    Restart=on-failure
    
    LimitNOFILE=10240
    
    [Install]
    WantedBy=default.target
    vim /etc/systemd/system/aquarium-fish.service
  8. Enable for autostart and start the service:

    systemctl enable aquarium-fish.service
    systemctl start aquarium-fish.service
  9. (optional) Check logs to see that the service is started ok:

    journalctl -fu aquarium-fish.service
⚠️ **GitHub.com Fallback** ⚠️