Managing services (AEN 4.2.0)
=============================

.. raw:: html

    <p>The tasks on this page assume that the 3 AEN nodes are installed
    in the following locations:</p>
    <ul class="simple">
    <li>Server&#8211;<code class="docutils literal"><span class="pre">/opt/wakari/wakari-server/</span></code>.</li>
    <li>Gateway&#8211;<code class="docutils literal"><span class="pre">/opt/wakari/wakari-gateway/</span></code>.</li>
    <li>Compute-Launcher&#8211;<code class="docutils literal"><span class="pre">/opt/wakari/wakari-compute/</span></code>.</li>
    </ul>
    <div class="contents local topic" id="contents">
    <ul class="simple">
    <li><a class="reference internal" href="#checking-the-status-of-server-node-processes" id="id1">Checking the status of server node processes</a></li>
    <li><a class="reference internal" href="#checking-the-status-of-gateway-node-processes" id="id2">Checking the status of gateway node processes</a></li>
    <li><a class="reference internal" href="#checking-the-status-of-compute-node-processes" id="id3">Checking the status of compute node processes</a></li>
    <li><a class="reference internal" href="#starting-aen-services" id="id4">Starting AEN services</a></li>
    <li><a class="reference internal" href="#verifying-that-aen-services-are-set-to-start-with-the-system" id="id5">Verifying that AEN services are set to start with the system</a></li>
    <li><a class="reference internal" href="#stopping-aen-services" id="id6">Stopping AEN services</a></li>
    <li><a class="reference internal" href="#restarting-aen-services" id="id7">Restarting AEN services</a></li>
    <li><a class="reference internal" href="#identify-extra-services" id="id8">Identifying extraneous processes</a></li>
    <li><a class="reference internal" href="#removing-extraneous-processes" id="id9">Removing extraneous processes</a></li>
    </ul>
    </div>
    <div class="section" id="checking-the-status-of-server-node-processes">
    <span id="check-server-process-status"></span><h2><a class="toc-backref" href="#id1">Checking the status of server node processes</a><a class="headerlink" href="#checking-the-status-of-server-node-processes" title="Permalink to this headline">¶</a></h2>
    <ol class="arabic">
    <li><p class="first">Run:</p>
    <div class="highlight-bash"><div class="highlight"><pre><span></span><span class="c1"># service wakari-server status</span>
    wk-server                   RUNNING    pid <span class="m">20758</span>, uptime <span class="m">5</span> days, <span class="m">0</span>:30:23
    worker                      RUNNING    pid <span class="m">20757</span>, uptime <span class="m">5</span> days, <span class="m">0</span>:30:23
    </pre></div>
    </div>
    <p>OR</p>
    <div class="highlight-bash"><div class="highlight"><pre><span></span>root@server <span class="c1"># ps -Hu wakari</span>
      PID TTY          TIME CMD
    <span class="m">20756</span> ?        <span class="m">00</span>:02:26 .supervisord
    <span class="m">20757</span> ?        <span class="m">00</span>:05:58   mtq-worker
    <span class="m">20758</span> ?        <span class="m">00</span>:00:08   wk-server
    <span class="m">20765</span> ?        <span class="m">00</span>:02:00     wk-server
    <span class="m">20766</span> ?        <span class="m">00</span>:01:55     wk-server
    <span class="m">20767</span> ?        <span class="m">00</span>:02:20     wk-server
    <span class="m">20770</span> ?        <span class="m">00</span>:02:02     wk-server
    </pre></div>
    </div>
    </li>
    <li><p class="first">Run:</p>
    <div class="highlight-bash"><div class="highlight"><pre><span></span>root@server <span class="c1"># service nginx status</span>
    nginx <span class="o">(</span>pid  <span class="m">26303</span><span class="o">)</span> is running...
    </pre></div>
    </div>
    </li>
    </ol>
    <p>For more information on server processes, see
    <a class="reference internal" href="../concepts.html#admin-concept-server-processes"><span class="std std-ref">Server processes</span></a>.</p>
    </div>
    <div class="section" id="checking-the-status-of-gateway-node-processes">
    <span id="check-gateway-process-status"></span><h2><a class="toc-backref" href="#id2">Checking the status of gateway node processes</a><a class="headerlink" href="#checking-the-status-of-gateway-node-processes" title="Permalink to this headline">¶</a></h2>
    <p>Run:</p>
    <div class="highlight-bash"><div class="highlight"><pre><span></span><span class="c1"># service wakari-gateway status</span>
    wk-gateway                       RUNNING    pid <span class="m">1137</span>, uptime <span class="m">5</span> days, <span class="m">1</span>:59:28
    </pre></div>
    </div>
    <p>OR</p>
    <div class="highlight-bash"><div class="highlight"><pre><span></span>root@gateway <span class="c1"># ps -Hu wakari</span>
      PID TTY          TIME CMD
     <span class="m">1136</span> ?        <span class="m">00</span>:01:59 .supervisord
     <span class="m">1137</span> ?        <span class="m">00</span>:00:02   wk-gateway
    </pre></div>
    </div>
    <p>For more information on gateway processes, see
    <a class="reference internal" href="../concepts.html#admin-concept-gateway-processes"><span class="std std-ref">Gateway processes</span></a>.</p>
    </div>
    <div class="section" id="checking-the-status-of-compute-node-processes">
    <span id="check-compute-process-status"></span><h2><a class="toc-backref" href="#id3">Checking the status of compute node processes</a><a class="headerlink" href="#checking-the-status-of-compute-node-processes" title="Permalink to this headline">¶</a></h2>
    <p>Run:</p>
    <div class="highlight-bash"><div class="highlight"><pre><span></span><span class="c1"># service wakari-compute status</span>
    wk-compute                       RUNNING    pid <span class="m">22050</span>, uptime <span class="m">3</span> days, <span class="m">1</span>:03:19
    </pre></div>
    </div>
    <p>OR</p>
    <div class="highlight-bash"><div class="highlight"><pre><span></span>root@compute <span class="c1"># ps -Hu wakari</span>
      PID TTY          TIME CMD
     <span class="m">1150</span> ?        <span class="m">00</span>:02:01 .supervisord
     <span class="m">1152</span> ?        <span class="m">00</span>:00:01   wk-compute
    </pre></div>
    </div>
    <p>For more information on compute node processes, see
    <a class="reference internal" href="../concepts.html#admin-concept-compute-processes"><span class="std std-ref">Compute processes</span></a>.</p>
    </div>
    <div class="section" id="starting-aen-services">
    <span id="start-services"></span><h2><a class="toc-backref" href="#id4">Starting AEN services</a><a class="headerlink" href="#starting-aen-services" title="Permalink to this headline">¶</a></h2>
    <p>Services should start automatically both when they are first
    installed and at any point when the system is restarted.</p>
    <p>If you need to manually start an AEN service, you must start each
    node independently, because they may be running on separate
    machines.</p>
    <p>NOTE: The process is basically the same for each node, but
    the path to the correct commands vary.</p>
    <p>To manually start a service:</p>
    <ul>
    <li><p class="first">On the server node, run:</p>
    <div class="highlight-bash"><div class="highlight"><pre><span></span>service wakari-server start
    </pre></div>
    </div>
    </li>
    <li><p class="first">On the gateway node, run:</p>
    <div class="highlight-bash"><div class="highlight"><pre><span></span>service wakari-gateway start
    </pre></div>
    </div>
    </li>
    <li><p class="first">On a compute node, run:</p>
    <div class="highlight-bash"><div class="highlight"><pre><span></span>service wakari-compute start
    </pre></div>
    </div>
    </li>
    </ul>
    </div>
    <div class="section" id="verifying-that-aen-services-are-set-to-start-with-the-system">
    <span id="verify-services-start-at-boot"></span><h2><a class="toc-backref" href="#id5">Verifying that AEN services are set to start with the system</a><a class="headerlink" href="#verifying-that-aen-services-are-set-to-start-with-the-system" title="Permalink to this headline">¶</a></h2>
    <p>To verify that AEN services are set up to start automatically:</p>
    <ol class="arabic">
    <li><p class="first">Run the following command on each node:</p>
    <div class="highlight-bash"><div class="highlight"><pre><span></span>chkconfig --list <span class="p">|</span> grep wakari
    </pre></div>
    </div>
    </li>
    <li><p class="first">If services are missing, add them:</p>
    <div class="highlight-bash"><div class="highlight"><pre><span></span>chkconfig --add <span class="o">[</span>wakari-server<span class="p">|</span>wakari-gateway<span class="p">|</span>wakari-compute<span class="o">]</span>
    </pre></div>
    </div>
    </li>
    <li><p class="first"><a class="reference internal" href="#restart-services"><span class="std std-ref">Restart the services</span></a>.</p>
    </li>
    </ol>
    </div>
    <div class="section" id="stopping-aen-services">
    <span id="stop-services"></span><h2><a class="toc-backref" href="#id6">Stopping AEN services</a><a class="headerlink" href="#stopping-aen-services" title="Permalink to this headline">¶</a></h2>
    <p>CAUTION: Do not stop or kill supervisord without first
    stopping wk-compute and any other processes that use it.</p>
    <p>You must stop services on each node independently, because they
    may be running on separate machines.</p>
    <p>To stop an AEN service:</p>
    <ul>
    <li><p class="first">On the server node, run:</p>
    <div class="highlight-bash"><div class="highlight"><pre><span></span>service wakari-server stop
    </pre></div>
    </div>
    </li>
    <li><p class="first">On the gateway node, run:</p>
    <div class="highlight-bash"><div class="highlight"><pre><span></span>service wakari-gateway stop
    </pre></div>
    </div>
    </li>
    <li><p class="first">On a compute node, run:</p>
    <div class="highlight-bash"><div class="highlight"><pre><span></span>service wakari-compute stop
    </pre></div>
    </div>
    <p>Compute nodes may have running processes that are not
    automatically stopped. To stop them, run:</p>
    <div class="highlight-bash"><div class="highlight"><pre><span></span>sudo /opt/wakari/wakari-compute/bin/wk-compute-apps kill-all
    </pre></div>
    </div>
    </li>
    </ul>
    </div>
    <div class="section" id="restarting-aen-services">
    <span id="restart-services"></span><h2><a class="toc-backref" href="#id7">Restarting AEN services</a><a class="headerlink" href="#restarting-aen-services" title="Permalink to this headline">¶</a></h2>
    <ul>
    <li><p class="first">On the server node, run:</p>
    <div class="highlight-bash"><div class="highlight"><pre><span></span>service wakari-server restart
    </pre></div>
    </div>
    </li>
    <li><p class="first">On the gateway node, run:</p>
    <div class="highlight-bash"><div class="highlight"><pre><span></span>service wakari-gateway restart
    </pre></div>
    </div>
    </li>
    <li><p class="first">On a compute node, run:</p>
    <div class="highlight-bash"><div class="highlight"><pre><span></span>service wakari-compute restart
    </pre></div>
    </div>
    </li>
    </ul>
    </div>
    <div class="section" id="identify-extra-services">
    <span id="identifying-extraneous-processes"></span><h2><a class="toc-backref" href="#id8">Identifying extraneous processes</a><a class="headerlink" href="#identify-extra-services" title="Permalink to this headline">¶</a></h2>
    <p>To get a complete list of the processes running under the
    wakari user account, run <code class="docutils literal"><span class="pre">ps</span> <span class="pre">-Hu</span> <span class="pre">wakari</span></code>.</p>
    <p>EXAMPLE:</p>
    <div class="highlight-bash"><div class="highlight"><pre><span></span>root@server <span class="c1"># ps -Hu wakari</span>
       PID TTY          TIME CMD
     <span class="m">20756</span> ?        <span class="m">00</span>:02:26 .supervisord
     <span class="m">20757</span> ?        <span class="m">00</span>:05:58   mtq-worker
     <span class="m">20758</span> ?        <span class="m">00</span>:00:08   wk-server
     <span class="m">20765</span> ?        <span class="m">00</span>:02:00     wk-server
     <span class="m">20766</span> ?        <span class="m">00</span>:01:55     wk-server
     <span class="m">20767</span> ?        <span class="m">00</span>:02:20     wk-server
     <span class="m">20770</span> ?        <span class="m">00</span>:02:02     wk-server

     root@server <span class="c1"># ps -f -C nginx</span>
     UID     PID  PPID  C STIME TTY     TIME CMD
     root  <span class="m">26303</span>     <span class="m">1</span>  <span class="m">0</span> <span class="m">12</span>:18 ?   <span class="m">00</span>:00:00 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf
     nginx <span class="m">26305</span> <span class="m">26303</span>  <span class="m">0</span> <span class="m">12</span>:18 ?   <span class="m">00</span>:00:00 nginx: worker process

     root@gateway <span class="c1"># ps -Hu wakari</span>
       PID TTY          TIME CMD
      <span class="m">1136</span> ?        <span class="m">00</span>:01:59 .supervisord
      <span class="m">1137</span> ?        <span class="m">00</span>:00:02   wk-gateway

     root@compute <span class="c1"># ps -Hu wakari</span>
       PID TTY          TIME CMD
      <span class="m">1150</span> ?        <span class="m">00</span>:02:01 .supervisord
      <span class="m">1152</span> ?        <span class="m">00</span>:00:01   wk-compute
    </pre></div>
    </div>
    <ul>
    <li><p class="first">wk-server, wk-gateway and wk-compute should have PIDs reported
    by supervisorctl.</p>
    </li>
    <li><p class="first">The nginx master process should have a PID reported by service
    nginx status.</p>
    </li>
    <li><p class="first">If you have installed more than one AEN node on a single
    machine, the processes from all of the installed nodes
    should be displayed for that machine.</p>
    </li>
    <li><p class="first">On compute node(s), any AEN applications currently being run by
    users will be present.</p>
    <p>EXAMPLE:</p>
    <div class="highlight-bash"><div class="highlight"><pre><span></span>root@compute <span class="c1"># ps -Hu wakari</span>
      PID TTY          TIME CMD
     <span class="m">1150</span> ?        <span class="m">00</span>:00:00 .supervisord
     <span class="m">1152</span> ?        <span class="m">00</span>:00:00   wk-compute
     <span class="m">1340</span> ?        <span class="m">00</span>:00:00 bash
     <span class="m">1341</span> ?        <span class="m">00</span>:00:00   notebookwrapper
    </pre></div>
    </div>
    </li>
    </ul>
    </div>
    <div class="section" id="removing-extraneous-processes">
    <h2><a class="toc-backref" href="#id9">Removing extraneous processes</a><a class="headerlink" href="#removing-extraneous-processes" title="Permalink to this headline">¶</a></h2>
    <p>If extra wk-server, wk-gateway, wk-compute, or supervisord
    processes are present, use the <code class="docutils literal"><span class="pre">kill</span></code> command to remove them
    to prevent issues with AEN.</p>
    <p>You can safely <a class="reference internal" href="#restart-services"><span class="std std-ref">restart</span></a> any process that
    you remove in error.</p>
    </div>
