Optional configuration (AEN 4.1.2)
==================================

.. raw:: html

    <p>These optional procedures may or may not be necessary, depending on
    how you want to set up your Anaconda Enterprise Notebooks Data Center.</p>
    <p>These procedures assume that you have already performed the
    <a class="reference internal" href="install-server.html"><span class="doc">Install AEN Server</span></a>, <a class="reference internal" href="install-gateway.html"><span class="doc">Install AEN Gateway</span></a> and <a class="reference internal" href="install-compute.html"><span class="doc">Install AEN Compute</span></a>
    procedures.</p>
    <div class="section" id="optional-configure-common-aen-compute-options">
    <h2>Optional: Configure common AEN Compute options<a class="headerlink" href="#optional-configure-common-aen-compute-options" title="Permalink to this headline">¶</a></h2>
    <p>To make any of the changes described below, please edit the following file:
    <code class="docutils literal"><span class="pre">/opt/wakari/wakari-compute/etc/wakari/wk-compute-launcher-config.json</span></code></p>
    <p>Then restart the AEN Compute service:</p>
    <div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">sudo</span> <span class="n">service</span> <span class="n">wakari</span><span class="o">-</span><span class="n">compute</span> <span class="n">restart</span>
    </pre></div>
    </div>
    <div class="section" id="increase-http-timeout-between-gateway-and-compute-nodes">
    <h3>Increase HTTP timeout between Gateway and Compute Nodes<a class="headerlink" href="#increase-http-timeout-between-gateway-and-compute-nodes" title="Permalink to this headline">¶</a></h3>
    <p>NOTE: This setting works for HTTP timeout only, not HTTPS.</p>
    <p>The default timeout is 600 seconds (10 minutes). To adjust this edit the
    <code class="docutils literal"><span class="pre">httpTimeout</span></code> key:</p>
    <div class="highlight-default"><div class="highlight"><pre><span></span><span class="s2">&quot;httpTimeout&quot;</span><span class="p">:</span> <span class="mi">600</span>
    </pre></div>
    </div>
    <p>Note: The <code class="docutils literal"><span class="pre">httpTimeout</span></code> must also be set on the Gateway with the
    same key at <code class="docutils literal"><span class="pre">/opt/wakari/wakari-gateway/etc/wakari/wk-gateway-config.json</span></code></p>
    </div>
    <div class="section" id="change-the-project-directory">
    <h3>Change the project directory<a class="headerlink" href="#change-the-project-directory" title="Permalink to this headline">¶</a></h3>
    <p>NOTE: We recommend putting ``/opt/wakari`` and ``/projects`` on the same
    filesystem. If the project and conda env directories are on separate
    filesystems then more disk space will be required on compute nodes and
    performance will be worse.</p>
    <p>To make <code class="docutils literal"><span class="pre">aen-compute</span></code> service use a different directory than <code class="docutils literal"><span class="pre">/projects</span></code>
    for storing the projects, modify
    <code class="docutils literal"><span class="pre">/opt/wakari/wakari-compute/etc/wakari/wk-compute-launcher-config.json</span></code>
    as follows:</p>
    <div class="highlight-default"><div class="highlight"><pre><span></span><span class="s2">&quot;projectRoot&quot;</span> <span class="p">:</span> <span class="s2">&quot;/nfs/storage/services/wakari/projects&quot;</span><span class="p">,</span>
    </pre></div>
    </div>
    <p>The directory <code class="docutils literal"><span class="pre">/nfs/storage/services/wakari/projects</span></code> specified as
    <code class="docutils literal"><span class="pre">projectRoot</span></code> must exist for this configuration to work.</p>
    </div>
    <div class="section" id="create-groups-with-the-same-id">
    <h3>Create groups with the same ID<a class="headerlink" href="#create-groups-with-the-same-id" title="Permalink to this headline">¶</a></h3>
    <p>Additionally, if the <code class="docutils literal"><span class="pre">/projects</span></code> folder resides on an NFSv3 volume and
    you have a setup with several compute nodes, AEN will create local users
    with a different uid on each node.</p>
    <p>To make the AEN Compute service create groups with the same id, edit the
    configuration file referenced above so that it contains the key <code class="docutils literal"><span class="pre">identicalGID</span></code>
    and the value <code class="docutils literal"><span class="pre">true</span></code> as in the following example. If you don&#8217;t see the
    <code class="docutils literal"><span class="pre">identicalGID</span></code> key, add it, and notice that you must add a comma at the
    beginning of the line. If you add this line as the last key, remove any
    comma at the end of the line.</p>
    <div class="highlight-default"><div class="highlight"><pre><span></span><span class="p">,</span> <span class="s2">&quot;identicalGID&quot;</span><span class="p">:</span> <span class="n">true</span>
    </pre></div>
    </div>
    </div>
    <div class="section" id="use-numeric-usernames">
    <h3>Use numeric usernames<a class="headerlink" href="#use-numeric-usernames" title="Permalink to this headline">¶</a></h3>
    <p>To use numeric usernames, you must modify the configuration file
    referenced above so that it contains the key <code class="docutils literal"><span class="pre">numericUsernames</span></code> and the value
    <code class="docutils literal"><span class="pre">true</span></code> as in the following example. If you don&#8217;t see the <code class="docutils literal"><span class="pre">numericUsernames</span></code>
    key, add it, and notice that you must add a comma at the beginning of the line.
    If you add this line as the last key, remove any comma at the end of the line.</p>
    <div class="highlight-default"><div class="highlight"><pre><span></span><span class="p">,</span> <span class="s2">&quot;numericUsernames&quot;</span><span class="p">:</span> <span class="n">true</span>
    </pre></div>
    </div>
    </div>
    </div>
    <div class="section" id="optional-verify-and-tune-search-indexing">
    <h2>Optional: Verify and tune search indexing<a class="headerlink" href="#optional-verify-and-tune-search-indexing" title="Permalink to this headline">¶</a></h2>
    <p>Verify that the AEN Compute node can communicate with the AEN Server.
    This is required for search indexing to work correctly.</p>
    <div class="highlight-default"><div class="highlight"><pre><span></span>curl -m 5 $AEN_SERVER &gt; /dev/null
    </pre></div>
    </div>
    <p>Ensure that there are sufficient <code class="docutils literal"><span class="pre">inotify</span></code> watches available for the
    number of subdirectories within the project root filesystem. Some Linux
    distributions default to a low number of watches, which may prevent the
    search indexer from monitoring project directories for changes.</p>
    <div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">cat</span> <span class="o">/</span><span class="n">proc</span><span class="o">/</span><span class="n">sys</span><span class="o">/</span><span class="n">fs</span><span class="o">/</span><span class="n">inotify</span><span class="o">/</span><span class="n">max_user_watches</span>
    </pre></div>
    </div>
    <p>If necessary, this can be increased with the following command:</p>
    <div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">echo</span> <span class="n">fs</span><span class="o">.</span><span class="n">inotify</span><span class="o">.</span><span class="n">max_user_watches</span><span class="o">=</span><span class="mi">100000</span> <span class="o">|</span> <span class="n">sudo</span> <span class="n">tee</span> <span class="o">-</span><span class="n">a</span> <span class="o">/</span><span class="n">etc</span><span class="o">/</span><span class="n">sysctl</span><span class="o">.</span><span class="n">conf</span> <span class="o">&amp;&amp;</span> <span class="n">sudo</span> <span class="n">sysctl</span> <span class="o">-</span><span class="n">p</span>
    </pre></div>
    </div>
    <p>Ensure that there are sufficient <code class="docutils literal"><span class="pre">inotify</span></code> user instances available,
    at least one per project.</p>
    <div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">cat</span> <span class="o">/</span><span class="n">proc</span><span class="o">/</span><span class="n">sys</span><span class="o">/</span><span class="n">fs</span><span class="o">/</span><span class="n">inotify</span><span class="o">/</span><span class="n">max_user_instances</span>
    </pre></div>
    </div>
    <p>If necessary, this can be increased with the following command:</p>
    <div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">echo</span> <span class="n">fs</span><span class="o">.</span><span class="n">inotify</span><span class="o">.</span><span class="n">max_user_instances</span><span class="o">=</span><span class="mi">1000</span> <span class="o">|</span> <span class="n">sudo</span> <span class="n">tee</span> <span class="o">-</span><span class="n">a</span> <span class="o">/</span><span class="n">etc</span><span class="o">/</span><span class="n">sysctl</span><span class="o">.</span><span class="n">conf</span> <span class="o">&amp;&amp;</span> <span class="n">sudo</span> <span class="n">sysctl</span> <span class="o">-</span><span class="n">p</span>
    </pre></div>
    </div>
    </div>
    <div class="section" id="optional-setting-up-a-default-project-environment">
    <span id="aen-default-project-env"></span><h2>Optional: Setting up a default project environment<a class="headerlink" href="#optional-setting-up-a-default-project-environment" title="Permalink to this headline">¶</a></h2>
    <p>Anaconda Enterprise Notebooks includes a full installation of the
    Anaconda python distribution, along with several additional packages,
    located in the <code class="docutils literal"><span class="pre">root</span></code> conda environment in the path
    <code class="docutils literal"><span class="pre">/opt/wakari/anaconda</span></code>. A copy of this environment is created for each
    new AEN Project.</p>
    <p>To configure a different set of packages as the defaults, create a new
    conda environment in the directory
    <code class="docutils literal"><span class="pre">/opt/wakari/anaconda/envs/default</span></code>. For example, to do so using a
    python 3.4 base environment, run the following command:</p>
    <div class="highlight-default"><div class="highlight"><pre><span></span>sudo -u $AEN_SRVC_ACCT /opt/wakari/anaconda/bin/conda create -p /opt/wakari/anaconda/envs/default python=3.4
    </pre></div>
    </div>
    <p>Then use <code class="docutils literal"><span class="pre">conda</span></code> to install any additional packages into the
    environment as needed. After creating the environment, clone it once to
    ensure that it works correctly:</p>
    <div class="highlight-default"><div class="highlight"><pre><span></span>sudo -u $AEN_SRVC_ACCT /opt/wakari/anaconda/bin/conda create -p /opt/wakari/testenv --clone /opt/wakari/anaconda/envs/default
    sudo -u $AEN_SRVC_ACCT rm -rf /opt/wakari/testenv
    </pre></div>
    </div>
    <p>The default project environment will be cloned into the project
    workspace the first time the project is started. To convert an existing
    project, run the following command to clone the environment, replacing
    <code class="docutils literal"><span class="pre">/projects/owner/project/envs/&lt;ENV_NAME&gt;</span></code> with the path to the new
    environment you would like to create within the project:</p>
    <div class="highlight-default"><div class="highlight"><pre><span></span>sudo -u $AEN_SRVC_ACCT /opt/wakari/anaconda/bin/conda create -n /projects/owner/project/envs/&lt;ENV_NAME&gt; --clone /opt/wakari/anaconda/envs/default
    </pre></div>
    </div>
    <p>Then open the Compute Resource Config for the project and set the
    project environment path there.</p>
    </div>
    <div class="section" id="configure-a-remote-mongo-database-instance">
    <span id="aen-install-mongodb"></span><h2>Configure a remote Mongo database instance<a class="headerlink" href="#configure-a-remote-mongo-database-instance" title="Permalink to this headline">¶</a></h2>
    <p>Some AEN users set up a remote Mongo database instance for performance or
    resource reasons.</p>
    <p>First stop the AEN Server, AEN Gateway and all AEN Compute Nodes:</p>
    <div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">sudo</span> <span class="n">service</span> <span class="n">wakari</span><span class="o">-</span><span class="n">server</span> <span class="n">stop</span>
    <span class="n">sudo</span> <span class="n">service</span> <span class="n">wakari</span><span class="o">-</span><span class="n">gateway</span> <span class="n">stop</span>
    <span class="n">sudo</span> <span class="n">service</span> <span class="n">wakari</span><span class="o">-</span><span class="n">compute</span> <span class="n">stop</span>
    </pre></div>
    </div>
    <p>In order to configure a remote database to work with
    <strong>AEN-Server</strong>, edit <code class="docutils literal"><span class="pre">/opt/wakari/wakari-server/etc/wakari/config.json</span></code>,
    create a new key called <code class="docutils literal"><span class="pre">MONGO_URL</span></code> and add the database information. The final file
    should look like:</p>
    <div class="highlight-default"><div class="highlight"><pre><span></span><span class="p">{</span>
      <span class="s2">&quot;MONGO_URL&quot;</span><span class="p">:</span> <span class="s2">&quot;mongodb://MONGO-USER:MONGO-PASSWORD@MONGO-URL:MONGO-PORT&quot;</span><span class="p">,</span>
      <span class="s2">&quot;WAKARI_SERVER&quot;</span><span class="p">:</span> <span class="s2">&quot;http://YOUR-IP&quot;</span><span class="p">,</span>
      <span class="s2">&quot;USE_SES&quot;</span><span class="p">:</span> <span class="n">false</span><span class="p">,</span>
      <span class="s2">&quot;CDN&quot;</span><span class="p">:</span> <span class="s2">&quot;http://YOUR-UP/static/&quot;</span><span class="p">,</span>
      <span class="s2">&quot;ANON_USER&quot;</span><span class="p">:</span> <span class="s2">&quot;anonymous&quot;</span>
    <span class="p">}</span>
    </pre></div>
    </div>
    <p>The <a class="reference internal" href="../admin/configuration-files.html"><span class="doc">Configuration Files</span></a> page has more information about these configuration keys.</p>
    <p>You can migrate data from the former database into the new one.
    There is covered at the <a class="reference external" href="https://docs.mongodb.com/manual/tutorial/backup-and-restore-tools/">MongoDB documentation
    website</a>.
    After migration you can restart the services with:</p>
    <div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">sudo</span> <span class="n">service</span> <span class="n">wakari</span><span class="o">-</span><span class="n">server</span> <span class="n">start</span>
    <span class="n">sudo</span> <span class="n">service</span> <span class="n">wakari</span><span class="o">-</span><span class="n">gateway</span> <span class="n">start</span>
    <span class="n">sudo</span> <span class="n">service</span> <span class="n">wakari</span><span class="o">-</span><span class="n">compute</span> <span class="n">start</span>
    </pre></div>
    </div>
    </div>
    <div class="section" id="optional-selinux-enforcing-mode">
    <h2>Optional: SELinux enforcing mode<a class="headerlink" href="#optional-selinux-enforcing-mode" title="Permalink to this headline">¶</a></h2>
    <p>In order to run SELinux in Enforcing mode, set ports with
    the <code class="docutils literal"><span class="pre">semanage</span> <span class="pre">port</span></code> command.</p>
    <p>The semange command relies on <code class="docutils literal"><span class="pre">policycoreutils-python</span></code>. To install (if
    needed):</p>
    <div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">sudo</span> <span class="n">yum</span> <span class="o">-</span><span class="n">y</span> <span class="n">install</span> <span class="n">policycoreutils</span><span class="o">-</span><span class="n">python</span>
    </pre></div>
    </div>
    <p>Enable port 5000 for aen-server:</p>
    <div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">sudo</span> <span class="n">semanage</span> <span class="n">port</span> <span class="o">-</span><span class="n">m</span> <span class="o">-</span><span class="n">t</span> <span class="n">http_port_t</span> <span class="o">-</span><span class="n">p</span> <span class="n">tcp</span> <span class="mi">5000</span>
    </pre></div>
    </div>
    <p>The <code class="docutils literal"><span class="pre">-m</span></code> flag is for modifying an existing usage of a port. If you get
    an error <code class="docutils literal"><span class="pre">Port</span> <span class="pre">tcp/5000</span> <span class="pre">is</span> <span class="pre">not</span> <span class="pre">defined</span></code> change the flag to <code class="docutils literal"><span class="pre">-a</span></code> to
    add the port.</p>
    <p>Enable ports 9200 and 9300 for elasticsearch:</p>
    <div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">sudo</span> <span class="n">semanage</span> <span class="n">port</span> <span class="o">-</span><span class="n">a</span> <span class="o">-</span><span class="n">t</span> <span class="n">http_port_t</span> <span class="o">-</span><span class="n">p</span> <span class="n">tcp</span> <span class="mi">9200</span>
    <span class="n">sudo</span> <span class="n">semanage</span> <span class="n">port</span> <span class="o">-</span><span class="n">a</span> <span class="o">-</span><span class="n">t</span> <span class="n">http_port_t</span> <span class="o">-</span><span class="n">p</span> <span class="n">tcp</span> <span class="mi">9300</span>
    </pre></div>
    </div>
    <p>Please see the <a class="reference internal" href="../admin/index.html"><span class="doc">Administrative documentation</span></a> for
    additional information.</p>
    </div>
    <div class="section" id="wrapping-up">
    <h2>Wrapping up<a class="headerlink" href="#wrapping-up" title="Permalink to this headline">¶</a></h2>
    <p>Congratulations! You now have a fully installed Anaconda Enterprise
    Notebooks!</p>
    <p>Should you encounter any issues while installing AEN or have additional
    questions, please do not hesitate to contact your enterprise support
    representative.</p>
    </div>
    <div class="section" id="next-steps">
    <h2>Next steps<a class="headerlink" href="#next-steps" title="Permalink to this headline">¶</a></h2>
    <p>Depending on your Data Center setup, you may need to
    perform some of the additional procedures below:</p>
    <ul class="simple">
    <li><a class="reference internal" href="customization.html"><span class="doc">Sudo configuration</span></a></li>
    <li><a class="reference internal" href="ldap.html"><span class="doc">LDAP configuration</span></a></li>
    <li><a class="reference internal" href="ssl.html"><span class="doc">SSL</span></a></li>
    <li><a class="reference internal" href="sso.html"><span class="doc">Single sign on</span></a></li>
    </ul>
    <p>Additional post-install information:</p>
    <ul class="simple">
    <li><a class="reference internal" href="installation_update.html"><span class="doc">Upgrading Anaconda Enterprise Notebooks</span></a></li>
    <li><a class="reference internal" href="uninstall.html"><span class="doc">Uninstall</span></a></li>
    <li><a class="reference internal" href="release.html"><span class="doc">Release notes</span></a></li>
    </ul>
    </div>
