Backing up and restoring AEN (AEN 4.2.1)
========================================

.. raw:: html

    <div class="contents local topic" id="contents">
    <ul class="simple">
    <li><a class="reference internal" href="#document-purpose" id="id20">Document purpose</a></li>
    <li><a class="reference internal" href="#important-notes" id="id21">Important notes</a></li>
    <li><a class="reference internal" href="#server-component-steps" id="id22">Server component steps</a><ul>
    <li><a class="reference internal" href="#backup" id="id23">Backup</a><ul>
    <li><a class="reference internal" href="#mongo-database" id="id24">Mongo database</a></li>
    <li><a class="reference internal" href="#aen-server-config-files-including-license-file" id="id25">AEN Server config files (including License file)</a></li>
    <li><a class="reference internal" href="#nginx-config-if-needed" id="id26">Nginx config (if needed)</a></li>
    <li><a class="reference internal" href="#ssl-certificates-if-needed" id="id27">SSL certificates (if needed)</a></li>
    </ul>
    </li>
    <li><a class="reference internal" href="#restore" id="id28">Restore</a><ul>
    <li><a class="reference internal" href="#reinstall-aen-server" id="id29">Reinstall AEN-Server</a></li>
    <li><a class="reference internal" href="#restore-mongo-database" id="id30">Restore Mongo database</a></li>
    <li><a class="reference internal" href="#id1" id="id31">AEN Server config files (including License file)</a></li>
    <li><a class="reference internal" href="#id2" id="id32">Nginx config (if needed)</a></li>
    <li><a class="reference internal" href="#id3" id="id33">SSL certificates (if needed)</a></li>
    <li><a class="reference internal" href="#restart-server" id="id34">Restart server</a></li>
    </ul>
    </li>
    </ul>
    </li>
    <li><a class="reference internal" href="#gateway-component-steps" id="id35">Gateway component steps</a><ul>
    <li><a class="reference internal" href="#id4" id="id36">Backup</a><ul>
    <li><a class="reference internal" href="#config-files" id="id37">Config files</a></li>
    <li><a class="reference internal" href="#custom-condarc-file-if-needed" id="id38">Custom .condarc file (if needed)</a></li>
    <li><a class="reference internal" href="#id5" id="id39">SSL certificates (if needed)</a></li>
    </ul>
    </li>
    <li><a class="reference internal" href="#id6" id="id40">Restore</a><ul>
    <li><a class="reference internal" href="#reinstall-aen-gateway" id="id41">Reinstall AEN-Gateway</a></li>
    <li><a class="reference internal" href="#id7" id="id42">Config files</a></li>
    <li><a class="reference internal" href="#id8" id="id43">Custom .condarc file (if needed)</a></li>
    <li><a class="reference internal" href="#id9" id="id44">SSL certificates (if needed)</a></li>
    <li><a class="reference internal" href="#restart-gateway" id="id45">Restart gateway</a></li>
    </ul>
    </li>
    </ul>
    </li>
    <li><a class="reference internal" href="#compute-component-steps" id="id46">Compute component steps</a><ul>
    <li><a class="reference internal" href="#id10" id="id47">Backup</a><ul>
    <li><a class="reference internal" href="#id11" id="id48">Config files</a></li>
    <li><a class="reference internal" href="#custom-changes-rare" id="id49">Custom Changes (rare)</a></li>
    <li><a class="reference internal" href="#create-user-list" id="id50">Create user list</a></li>
    <li><a class="reference internal" href="#project-files" id="id51">Project files</a></li>
    <li><a class="reference internal" href="#full-anaconda-option-1" id="id52">Full Anaconda (option 1)</a></li>
    <li><a class="reference internal" href="#partial-anaconda-option-2" id="id53">Partial Anaconda (option 2)</a></li>
    </ul>
    </li>
    <li><a class="reference internal" href="#id12" id="id54">Restore</a><ul>
    <li><a class="reference internal" href="#reinstall-aen-compute" id="id55">Reinstall AEN-Compute</a></li>
    <li><a class="reference internal" href="#id14" id="id56">Config files</a></li>
    <li><a class="reference internal" href="#id15" id="id57">Custom changes (rare)</a></li>
    <li><a class="reference internal" href="#create-users" id="id58">Create users</a></li>
    <li><a class="reference internal" href="#id16" id="id59">Project files</a></li>
    <li><a class="reference internal" href="#id17" id="id60">Full Anaconda (option 1)</a></li>
    <li><a class="reference internal" href="#id18" id="id61">Partial Anaconda (option 2)</a></li>
    <li><a class="reference internal" href="#id19" id="id62">Custom environments (if needed)</a></li>
    <li><a class="reference internal" href="#restart-compute-node" id="id63">Restart compute node</a></li>
    </ul>
    </li>
    </ul>
    </li>
    </ul>
    </div>
    <div class="section" id="document-purpose">
    <h2><a class="toc-backref" href="#id20">Document purpose</a><a class="headerlink" href="#document-purpose" title="Permalink to this headline">¶</a></h2>
    <p>This document lays out the steps to backup and restore Anaconda Enterprise
    Notebooks (AEN) for Disaster Recovery. It is not intended to provide High
    Availability. Each of the components (Server, Gateway and Compute) has its own
    instructions and each may be done individually as needed. The steps primarily
    involve creating tar files of important configuration files and data.</p>
    <p>This document is written for a system administrator who is comfortable with
    basic Linux command line navigation and usage.</p>
    <p>To migrate to a new cluster, use these backup and restore instructions to
    back up the system from the old cluster and restore it to the new cluster.</p>
    </div>
    <div class="section" id="important-notes">
    <h2><a class="toc-backref" href="#id21">Important notes</a><a class="headerlink" href="#important-notes" title="Permalink to this headline">¶</a></h2>
    <p>Review the <a class="reference internal" href="../concepts.html"><span class="doc">Concepts</span></a> page to become familiar with the different
    components and how they work together.</p>
    <p>Root or sudo access is required for some commands.</p>
    <p><strong>CAUTION:</strong> All commands MUST be run by <code class="docutils literal"><span class="pre">$AEN_SRVC_ACCT</span></code> (the account used to
    run AEN) except for those commands explicitly indicated to run as root or sudo.
    If the commands are not run by the correct user, the installation will not
    work, and a full uninstallation and reinstallation will be required!</p>
    <p>These instructions assume that the fully qualified domain name (FQDN) has not
    changed for any of the component nodes. If any of the FQDNs are not the same,
    additional steps will be needed.</p>
    </div>
    <div class="section" id="server-component-steps">
    <h2><a class="toc-backref" href="#id22">Server component steps</a><a class="headerlink" href="#server-component-steps" title="Permalink to this headline">¶</a></h2>
    <div class="section" id="backup">
    <h3><a class="toc-backref" href="#id23">Backup</a><a class="headerlink" href="#backup" title="Permalink to this headline">¶</a></h3>
    <div class="section" id="mongo-database">
    <h4><a class="toc-backref" href="#id24">Mongo database</a><a class="headerlink" href="#mongo-database" title="Permalink to this headline">¶</a></h4>
    <p>This will create a single tar file called <code class="docutils literal"><span class="pre">aen_mongo_backup.tar</span></code> that
    includes only the database named &#8220;wakari&#8221; that is used by AEN. It also
    generates a log of the database backup.</p>
    <p>NOTE: These commands must be run by <code class="docutils literal"><span class="pre">$AEN_SRVC_ACCT</span></code>.</p>
    <div class="highlight-bash"><div class="highlight"><pre><span></span>mongodump -db wakari -o aen_main &gt;&gt; mongo_backup.log
    tar -cvf aen_mongo_backup.tar aen_main
    </pre></div>
    </div>
    </div>
    <div class="section" id="aen-server-config-files-including-license-file">
    <h4><a class="toc-backref" href="#id25">AEN Server config files (including License file)</a><a class="headerlink" href="#aen-server-config-files-including-license-file" title="Permalink to this headline">¶</a></h4>
    <p>Create a tar file of all of the configuration files, including any license
    files.</p>
    <p>NOTE: This command must be run by <code class="docutils literal"><span class="pre">$AEN_SRVC_ACCT</span></code>.</p>
    <div class="highlight-bash"><div class="highlight"><pre><span></span>tar -cvf aen_server_config.tar -C /opt/wakari/ wakari-server/etc/wakari/
    </pre></div>
    </div>
    </div>
    <div class="section" id="nginx-config-if-needed">
    <h4><a class="toc-backref" href="#id26">Nginx config (if needed)</a><a class="headerlink" href="#nginx-config-if-needed" title="Permalink to this headline">¶</a></h4>
    <p>Make a copy of the nginx configuration file if it has been customized.
    The default configuration for the AEN server is a symlink.</p>
    <p>NOTE: This command must be run by <code class="docutils literal"><span class="pre">$AEN_SRVC_ACCT</span></code>.</p>
    <div class="highlight-bash"><div class="highlight"><pre><span></span>/etc/nginx/conf.d/www.enterprise.conf -&gt; /opt/wakari/wakari-server/etc/nginx/conf.d/www.enterprise.conf
    </pre></div>
    </div>
    </div>
    <div class="section" id="ssl-certificates-if-needed">
    <h4><a class="toc-backref" href="#id27">SSL certificates (if needed)</a><a class="headerlink" href="#ssl-certificates-if-needed" title="Permalink to this headline">¶</a></h4>
    <p>Make a copy of the SSL certificates files (certfiles) for the server, including
    the key file, and a copy of the certfile for the gateway, which is needed for
    verification if using self-signed or private CA signed certs.</p>
    </div>
    </div>
    <div class="section" id="restore">
    <h3><a class="toc-backref" href="#id28">Restore</a><a class="headerlink" href="#restore" title="Permalink to this headline">¶</a></h3>
    <div class="section" id="reinstall-aen-server">
    <h4><a class="toc-backref" href="#id29">Reinstall AEN-Server</a><a class="headerlink" href="#reinstall-aen-server" title="Permalink to this headline">¶</a></h4>
    <p>See <a class="reference internal" href="../install/install-server-node.html"><span class="doc">the instructions for installing the current version of AEN-Server</span></a>.</p>
    <p>It is not necessary to upload the license, because it will be restored with the
    config files.</p>
    <p>NOTE: The new installation will generate a new password for the local <code class="docutils literal"><span class="pre">$AEN_SRVC_ACCT</span></code>
    account.</p>
    </div>
    <div class="section" id="restore-mongo-database">
    <h4><a class="toc-backref" href="#id30">Restore Mongo database</a><a class="headerlink" href="#restore-mongo-database" title="Permalink to this headline">¶</a></h4>
    <p>This assumes that mongo was reinstalled as part of the reinstallation of the
    server component. Untar the mongo database and restore it.</p>
    <p>NOTE: These commands must be run by <code class="docutils literal"><span class="pre">$AEN_SRVC_ACCT</span></code>.</p>
    <div class="highlight-bash"><div class="highlight"><pre><span></span>tar -xvf aen_mongo_backup.tar
    mongorestore --drop aen_main
    </pre></div>
    </div>
    <p>NOTE: The <code class="docutils literal"><span class="pre">--drop</span></code> option resets the <code class="docutils literal"><span class="pre">$AEN_SRVC_ACCT</span></code> user password and restores
    the database to the exact state it was in at the time of backup. Please see the
    <a class="reference external" href="https://docs.mongodb.com/v2.6/reference/program/mongorestore/">MongoDB documentation</a>
    for more information about mongorestore options for Mongo 2.6.</p>
    <p>NOTE: AEN uses Mongo 2.6 by default. If you are using a different version,
    consult the documentation for your version.</p>
    </div>
    <div class="section" id="id1">
    <h4><a class="toc-backref" href="#id31">AEN Server config files (including License file)</a><a class="headerlink" href="#id1" title="Permalink to this headline">¶</a></h4>
    <p>Untar the tar file of all of the configuration files, including any license files.</p>
    <p>NOTE: This command must be run by <code class="docutils literal"><span class="pre">$AEN_SRVC_ACCT</span></code>.</p>
    <div class="highlight-bash"><div class="highlight"><pre><span></span>tar -xvf aen_server_config.tar -C /opt/wakari/
    </pre></div>
    </div>
    <p>Make sure the files are in <code class="docutils literal"><span class="pre">/opt/wakari/wakari-server/etc/wakari/</span></code>
    and are owned by the <code class="docutils literal"><span class="pre">$AEN_SRVC_ACCT</span></code>.</p>
    </div>
    <div class="section" id="id2">
    <h4><a class="toc-backref" href="#id32">Nginx config (if needed)</a><a class="headerlink" href="#id2" title="Permalink to this headline">¶</a></h4>
    <p>Make sure any modifications to the nginx configuration are either in
    <code class="docutils literal"><span class="pre">/etc/nginx/conf.d</span></code> or in <code class="docutils literal"><span class="pre">/opt/wakari/wakari-server/etc/nginx/conf.d/</span></code>
    with a proper symlink.</p>
    <p>NOTE: This command must be run by <code class="docutils literal"><span class="pre">$AEN_SRVC_ACCT</span></code>.</p>
    <div class="highlight-bash"><div class="highlight"><pre><span></span>/etc/nginx/conf.d/www.enterprise.conf -&gt; /opt/wakari/wakari-server/etc/nginx/conf.d/www.enterprise.conf
    </pre></div>
    </div>
    </div>
    <div class="section" id="id3">
    <h4><a class="toc-backref" href="#id33">SSL certificates (if needed)</a><a class="headerlink" href="#id3" title="Permalink to this headline">¶</a></h4>
    <p>Move any SSL certificate files to the locations indicated in the config files.</p>
    </div>
    <div class="section" id="restart-server">
    <h4><a class="toc-backref" href="#id34">Restart server</a><a class="headerlink" href="#restart-server" title="Permalink to this headline">¶</a></h4>
    <p>Restart the server application.</p>
    <p>NOTE: This command must be run as root or with sudo.</p>
    <div class="highlight-bash"><div class="highlight"><pre><span></span>service wakari-server restart
    </pre></div>
    </div>
    </div>
    </div>
    </div>
    <div class="section" id="gateway-component-steps">
    <h2><a class="toc-backref" href="#id35">Gateway component steps</a><a class="headerlink" href="#gateway-component-steps" title="Permalink to this headline">¶</a></h2>
    <div class="section" id="id4">
    <h3><a class="toc-backref" href="#id36">Backup</a><a class="headerlink" href="#id4" title="Permalink to this headline">¶</a></h3>
    <div class="section" id="config-files">
    <h4><a class="toc-backref" href="#id37">Config files</a><a class="headerlink" href="#config-files" title="Permalink to this headline">¶</a></h4>
    <p>Create a tar file of all of the configuration files.</p>
    <p>NOTE: This command must be run by <code class="docutils literal"><span class="pre">$AEN_SRVC_ACCT</span></code>.</p>
    <div class="highlight-bash"><div class="highlight"><pre><span></span>tar -cvf aen_gateway_config.tar -C /opt/wakari/ wakari-gateway/etc/wakari/
    </pre></div>
    </div>
    </div>
    <div class="section" id="custom-condarc-file-if-needed">
    <h4><a class="toc-backref" href="#id38">Custom .condarc file (if needed)</a><a class="headerlink" href="#custom-condarc-file-if-needed" title="Permalink to this headline">¶</a></h4>
    <p>Make a copy of any <code class="docutils literal"><span class="pre">/opt/wakari/miniconda/.condarc</span></code> if it has been modified.</p>
    </div>
    <div class="section" id="id5">
    <h4><a class="toc-backref" href="#id39">SSL certificates (if needed)</a><a class="headerlink" href="#id5" title="Permalink to this headline">¶</a></h4>
    <p>Make a copy of SSL certificate files for the gateway (including the key file)
    and the certfile for the server (needed for verification if using self-signed
    or private CA signed certs).</p>
    </div>
    </div>
    <div class="section" id="id6">
    <h3><a class="toc-backref" href="#id40">Restore</a><a class="headerlink" href="#id6" title="Permalink to this headline">¶</a></h3>
    <div class="section" id="reinstall-aen-gateway">
    <h4><a class="toc-backref" href="#id41">Reinstall AEN-Gateway</a><a class="headerlink" href="#reinstall-aen-gateway" title="Permalink to this headline">¶</a></h4>
    <div class="section" id="setting-variables-and-changing-permissions">
    <h5>Setting variables and changing permissions<a class="headerlink" href="#setting-variables-and-changing-permissions" title="Permalink to this headline">¶</a></h5>
    <p>NOTE: These commands must be run by <code class="docutils literal"><span class="pre">$AEN_SRVC_ACCT</span></code>.</p>
    <p>Run:</p>
    <div class="highlight-bash"><div class="highlight"><pre><span></span><span class="nb">export</span> <span class="nv">AEN_SERVER</span><span class="o">=</span>&lt;FQDN HOSTNAME OR IP ADDRESS&gt; <span class="c1"># Use the real FQDN</span>
    <span class="nb">export</span> <span class="nv">AEN_GATEWAY_PORT</span><span class="o">=</span><span class="m">8089</span>
    <span class="nb">export</span> <span class="nv">AEN_GATEWAY</span><span class="o">=</span>&lt;FQDN HOSTNAME OR IP ADDRESS&gt;  <span class="c1"># will be needed shortly</span>
    chmod a+x aen-*.sh                <span class="c1"># Set installer to be executable</span>
    </pre></div>
    </div>
    <p>NOTE: Change &lt;FQDN HOSTNAME OR IP ADDRESS&gt; to the actual fully qualified domain
    hostname or IP address.</p>
    <p>NOTE: You must perform the entire procedure before closing the terminal
    to ensure the variable export persists. If the terminal is closed before
    successful installation, export the variables to continue with the installation.</p>
    </div>
    <div class="section" id="running-the-aen-gateway-installer">
    <h5>Running the AEN gateway installer<a class="headerlink" href="#running-the-aen-gateway-installer" title="Permalink to this headline">¶</a></h5>
    <p>Run:</p>
    <div class="highlight-bash"><div class="highlight"><pre><span></span>sudo -E ./aen-gateway-4.2.1-Linux-x86_64.sh -w <span class="nv">$AEN_SERVER</span>
    &lt;license text&gt;
    ...
    ...

    <span class="nv">PREFIX</span><span class="o">=</span>/opt/wakari/wakari-gateway
    Logging to /tmp/wakari_gateway.log
    ...
    ...
    Checking server name
    Please restart the Gateway after running the following <span class="nb">command</span>
    to connect this Gateway to the AEN Server
    ...
    </pre></div>
    </div>
    </div>
    </div>
    <div class="section" id="id7">
    <h4><a class="toc-backref" href="#id42">Config files</a><a class="headerlink" href="#id7" title="Permalink to this headline">¶</a></h4>
    <p>Untar the configuration files.</p>
    <p>NOTE: This command must be run by <code class="docutils literal"><span class="pre">$AEN_SRVC_ACCT</span></code>.</p>
    <div class="highlight-bash"><div class="highlight"><pre><span></span>tar -xvf aen_gateway_config.tar -C /opt/wakari
    </pre></div>
    </div>
    <p>Verify that the files are in <code class="docutils literal"><span class="pre">/opt/wakari/wakari-gateway/etc/wakari/</span></code>
    and are owned by the <code class="docutils literal"><span class="pre">$AEN_SRVC_ACCT</span></code>.</p>
    </div>
    <div class="section" id="id8">
    <h4><a class="toc-backref" href="#id43">Custom .condarc file (if needed)</a><a class="headerlink" href="#id8" title="Permalink to this headline">¶</a></h4>
    <p>Move the custom .condarc file to <code class="docutils literal"><span class="pre">/opt/wakari/miniconda/.condarc</span></code>.</p>
    </div>
    <div class="section" id="id9">
    <h4><a class="toc-backref" href="#id44">SSL certificates (if needed)</a><a class="headerlink" href="#id9" title="Permalink to this headline">¶</a></h4>
    <p>Move any SSL certificate files to the locations indicated in the config files.</p>
    </div>
    <div class="section" id="restart-gateway">
    <h4><a class="toc-backref" href="#id45">Restart gateway</a><a class="headerlink" href="#restart-gateway" title="Permalink to this headline">¶</a></h4>
    <p>Restart the gateway application.</p>
    <p>NOTE: This command must be run as root or with sudo.</p>
    <div class="highlight-bash"><div class="highlight"><pre><span></span>service wakari-gateway restart
    </pre></div>
    </div>
    </div>
    </div>
    </div>
    <div class="section" id="compute-component-steps">
    <h2><a class="toc-backref" href="#id46">Compute component steps</a><a class="headerlink" href="#compute-component-steps" title="Permalink to this headline">¶</a></h2>
    <div class="section" id="id10">
    <h3><a class="toc-backref" href="#id47">Backup</a><a class="headerlink" href="#id10" title="Permalink to this headline">¶</a></h3>
    <div class="section" id="id11">
    <h4><a class="toc-backref" href="#id48">Config files</a><a class="headerlink" href="#id11" title="Permalink to this headline">¶</a></h4>
    <p>Create a tar file of all of the configuration files.</p>
    <p>NOTE: This command must be run by <code class="docutils literal"><span class="pre">$AEN_SRVC_ACCT</span></code>.</p>
    <div class="highlight-bash"><div class="highlight"><pre><span></span>tar -cvf aen_compute_config.tar -C /opt/wakari/ wakari-compute/etc/wakari
    </pre></div>
    </div>
    </div>
    <div class="section" id="custom-changes-rare">
    <h4><a class="toc-backref" href="#id49">Custom Changes (rare)</a><a class="headerlink" href="#custom-changes-rare" title="Permalink to this headline">¶</a></h4>
    <p>Manually backup any custom changes that were applied to the code.
    One change might be additional files in the skeleton folder:</p>
    <p><code class="docutils literal"><span class="pre">/opt/wakari/wakari-compute/lib/node_modules/wakari-compute-launcher/skeleton</span></code></p>
    </div>
    <div class="section" id="create-user-list">
    <h4><a class="toc-backref" href="#id50">Create user list</a><a class="headerlink" href="#create-user-list" title="Permalink to this headline">¶</a></h4>
    <p>AEN uses POSIX access control lists (ACLs) for project sharing, so the backup
    must preserve the ACL information. This is done with a script that creates a
    file named <code class="docutils literal"><span class="pre">users.lst</span></code> containing a list of all users that have access to
    projects on a given compute node. Download and run the script.</p>
    <p>NOTE: These commands must be run by <code class="docutils literal"><span class="pre">$AEN_SRVC_ACCT</span></code>.</p>
    <div class="highlight-bash"><div class="highlight"><pre><span></span>wget https://s3.amazonaws.com/continuum-airgap/misc/wk-compute-get-acl-users.py
    chmod <span class="m">755</span> wk-compute-get-acl-users.py
    ./wk-compute-get-acl-users.py
    </pre></div>
    </div>
    </div>
    <div class="section" id="project-files">
    <h4><a class="toc-backref" href="#id51">Project files</a><a class="headerlink" href="#project-files" title="Permalink to this headline">¶</a></h4>
    <p>Create a tar of the projects directory with ACLs enabled. The default projects
    base location is <code class="docutils literal"><span class="pre">/projects</span></code>.</p>
    <p>NOTE: This command must be run as root or with sudo.</p>
    <div class="highlight-bash"><div class="highlight"><pre><span></span>tar --acls -cpvf projects.tar -C &lt;projects base location&gt;/*
    </pre></div>
    </div>
    </div>
    <div class="section" id="full-anaconda-option-1">
    <h4><a class="toc-backref" href="#id52">Full Anaconda (option 1)</a><a class="headerlink" href="#full-anaconda-option-1" title="Permalink to this headline">¶</a></h4>
    <p>If any changes have been made to the default Anaconda installation (additional
    packages installed or packages removed), it is necessary to backup the entire
    Anaconda installation.</p>
    <p>NOTE: This command must be run by <code class="docutils literal"><span class="pre">$AEN_SRVC_ACCT</span></code>.</p>
    <div class="highlight-bash"><div class="highlight"><pre><span></span>tar -cvf aen_anaconda.tar -C /opt/wakari/anaconda/*
    </pre></div>
    </div>
    <p>If no changes have been made to the default installation of Anaconda, you may
    just backup the <code class="docutils literal"><span class="pre">.condarc</span></code> file and any custom environments.</p>
    </div>
    <div class="section" id="partial-anaconda-option-2">
    <h4><a class="toc-backref" href="#id53">Partial Anaconda (option 2)</a><a class="headerlink" href="#partial-anaconda-option-2" title="Permalink to this headline">¶</a></h4>
    <div class="section" id="custom-condarc-file">
    <h5>Custom <code class="docutils literal"><span class="pre">.condarc</span></code> file<a class="headerlink" href="#custom-condarc-file" title="Permalink to this headline">¶</a></h5>
    <p>Make a copy of <code class="docutils literal"><span class="pre">/opt/wakari/anaconda/.condarc</span></code>.</p>
    </div>
    <div class="section" id="custom-environments-if-needed">
    <h5>Custom environments (if needed)<a class="headerlink" href="#custom-environments-if-needed" title="Permalink to this headline">¶</a></h5>
    <p>Create a tar file of any custom shared environments.</p>
    <p>NOTE: This command must be run by <code class="docutils literal"><span class="pre">$AEN_SRVC_ACCT</span></code>.</p>
    <div class="highlight-bash"><div class="highlight"><pre><span></span>tar -cvf aen_compute_envs.tar -C /opt/wakari/ anaconda/envs
    </pre></div>
    </div>
    <p>NOTE: If no custom shared environments have been created, the <code class="docutils literal"><span class="pre">envs</span></code> folder
    will not be present.</p>
    </div>
    </div>
    </div>
    <div class="section" id="id12">
    <h3><a class="toc-backref" href="#id54">Restore</a><a class="headerlink" href="#id12" title="Permalink to this headline">¶</a></h3>
    <div class="section" id="reinstall-aen-compute">
    <h4><a class="toc-backref" href="#id55">Reinstall AEN-Compute</a><a class="headerlink" href="#reinstall-aen-compute" title="Permalink to this headline">¶</a></h4>
    <div class="section" id="id13">
    <h5>Setting variables and changing permissions<a class="headerlink" href="#id13" title="Permalink to this headline">¶</a></h5>
    <p>NOTE: These commands must be run by <code class="docutils literal"><span class="pre">$AEN_SRVC_ACCT</span></code>.</p>
    <p>Run:</p>
    <div class="highlight-bash"><div class="highlight"><pre><span></span><span class="nb">export</span> <span class="nv">AEN_SERVER</span><span class="o">=</span>&lt;FQDN HOSTNAME OR IP ADDRESS&gt; <span class="c1"># Use the real FQDN</span>
    chmod a+x aen-*.sh                <span class="c1"># Set installer to be executable</span>
    </pre></div>
    </div>
    <p>NOTE: Change &lt;FQDN HOSTNAME OR IP ADDRESS&gt; to the actual fully qualified domain
    hostname or IP address.</p>
    <p>NOTE: You must perform the entire procedure before closing the terminal
    to ensure the variable export persists.</p>
    </div>
    <div class="section" id="running-the-aen-compute-installer">
    <h5>Running the AEN compute installer<a class="headerlink" href="#running-the-aen-compute-installer" title="Permalink to this headline">¶</a></h5>
    <p>Run:</p>
    <div class="highlight-bash"><div class="highlight"><pre><span></span>sudo -E ./aen-compute-4.2.1-Linux-x86_64.sh -w <span class="nv">$AEN_SERVER</span>
    ...
    ...
    <span class="nv">PREFIX</span><span class="o">=</span>/opt/wakari/wakari-compute
    Logging to /tmp/wakari_compute.log
    Checking server name
    ...
    ...
    Initial clone of root environment...
    Starting Wakari daemons...
    installation finished.
    Do you wish the installer to prepend the wakari-compute install location
    to PATH in your /root/.bashrc ? <span class="o">[</span>yes<span class="p">|</span>no<span class="o">]</span>
    <span class="o">[</span>no<span class="o">]</span> &gt;&gt;&gt; yes
    </pre></div>
    </div>
    </div>
    </div>
    <div class="section" id="id14">
    <h4><a class="toc-backref" href="#id56">Config files</a><a class="headerlink" href="#id14" title="Permalink to this headline">¶</a></h4>
    <p>Untar the config files.</p>
    <p>NOTE: This command must be run by <code class="docutils literal"><span class="pre">$AEN_SRVC_ACCT</span></code>.</p>
    <div class="highlight-bash"><div class="highlight"><pre><span></span>tar -xvf aen_compute_config.tar -C /opt/wakari
    </pre></div>
    </div>
    <p>NOTE: Verify that they are located in <code class="docutils literal"><span class="pre">/opt/wakari/wakari-compute/etc/wakari</span></code>
    and are owned by the <code class="docutils literal"><span class="pre">$AEN_SRVC_ACCT</span></code>.</p>
    </div>
    <div class="section" id="id15">
    <h4><a class="toc-backref" href="#id57">Custom changes (rare)</a><a class="headerlink" href="#id15" title="Permalink to this headline">¶</a></h4>
    <p>Manually restore any custom changes you saved in the backup section.
    If there are changes in the skeleton directory, these files must be world readable or
    projects will refuse to start.</p>
    </div>
    <div class="section" id="create-users">
    <h4><a class="toc-backref" href="#id58">Create users</a><a class="headerlink" href="#create-users" title="Permalink to this headline">¶</a></h4>
    <p>NOTE: Only create users with these instructions if your Linux machine is not
    bound to LDAP.</p>
    <p>In order for the ACLs to be set properly on restore, all users that have
    permissions to the files must be available on the machine. Ask your system
    administrator for the proper way to do this for your system, such as using the
    &#8220;useradd&#8221; tool. A list of users that are needed was created in the backup
    process as a file named <code class="docutils literal"><span class="pre">users.lst</span></code>.</p>
    <p>A process similar to the following <code class="docutils literal"><span class="pre">useradd</span></code> example will be suitable for most
    Linux systems.</p>
    <p>NOTE: This command must be run by <code class="docutils literal"><span class="pre">$AEN_SRVC_ACCT</span></code>.</p>
    <div class="highlight-bash"><div class="highlight"><pre><span></span>xargs -0 -n <span class="m">1</span> useradd --user-group &lt; users.lst
    </pre></div>
    </div>
    </div>
    <div class="section" id="id16">
    <h4><a class="toc-backref" href="#id59">Project files</a><a class="headerlink" href="#id16" title="Permalink to this headline">¶</a></h4>
    <p>Create the projects directory in the location specified in projectRoot in
    <code class="docutils literal"><span class="pre">wk-compute-launcher-config.json</span></code>.</p>
    <p>NOTE: By default this directory is <code class="docutils literal"><span class="pre">/projects</span></code>.</p>
    <p>Then untar the projects directory with ACLs.</p>
    <p>NOTE: This command must be run as root or with sudo:</p>
    <div class="highlight-bash"><div class="highlight"><pre><span></span>tar --acls -xpvf projects.tar -C &lt;projects base location&gt;
    </pre></div>
    </div>
    </div>
    <div class="section" id="id17">
    <h4><a class="toc-backref" href="#id60">Full Anaconda (option 1)</a><a class="headerlink" href="#id17" title="Permalink to this headline">¶</a></h4>
    <p>If you did a full backup of the full Anaconda installation, untar this file to
    <code class="docutils literal"><span class="pre">/opt/wakari/anaconda</span></code>.</p>
    <p>NOTE: This command must be run by <code class="docutils literal"><span class="pre">$AEN_SRVC_ACCT</span></code>.</p>
    <div class="highlight-bash"><div class="highlight"><pre><span></span>tar -xvf aen_anaconda.tar -C /opt/wakari
    </pre></div>
    </div>
    </div>
    <div class="section" id="id18">
    <h4><a class="toc-backref" href="#id61">Partial Anaconda (option 2)</a><a class="headerlink" href="#id18" title="Permalink to this headline">¶</a></h4>
    <p>Restore the custom <code class="docutils literal"><span class="pre">.condarc</span></code> file.</p>
    <p>If you did a partial backup of the Anaconda installation, move the copy of the
    <code class="docutils literal"><span class="pre">.condarc</span></code> file to <code class="docutils literal"><span class="pre">/opt/wakari/anaconda/.condarc</span></code>.</p>
    </div>
    <div class="section" id="id19">
    <h4><a class="toc-backref" href="#id62">Custom environments (if needed)</a><a class="headerlink" href="#id19" title="Permalink to this headline">¶</a></h4>
    <p>Untar any custom environments that were created to <code class="docutils literal"><span class="pre">/opt/wakari/anaconda/envs</span></code>.</p>
    <p>NOTE: This command must be run by <code class="docutils literal"><span class="pre">$AEN_SRVC_ACCT</span></code>.</p>
    <div class="highlight-bash"><div class="highlight"><pre><span></span>tar -xvf aen_compute_envs.tar -C /opt/wakari
    </pre></div>
    </div>
    </div>
    <div class="section" id="restart-compute-node">
    <h4><a class="toc-backref" href="#id63">Restart compute node</a><a class="headerlink" href="#restart-compute-node" title="Permalink to this headline">¶</a></h4>
    <p>Restart the compute-launcher application.</p>
    <p>NOTE: This command must be run as root or with sudo.</p>
    <div class="highlight-bash"><div class="highlight"><pre><span></span>service wakari-compute restart
    </pre></div>
    </div>
    </div>
    </div>
    </div>
