<commit_before>---
layout: default
---
<div class="content">
<header>
    <div class="unit-head">
        <div class="unit-inner unit-head-inner">
            <h1 class="h2 entry-title">Getting Started</h1>
        </div>
        <!-- unit-inner -->
    </div>
    <!-- unit-head -->
</header>

<div class="bd">
    <div class="entry-content">
        <head></title></head>
        <body><h2><a name="h.iz4tqsugqwie"></a><span></span></h2>

        <h3><a name="h.5usgtrkxbqhs"></a><span>Installation</span></h3>



        <p><span>1. You&rsquo;ll need an Ubuntu 14.04 host to perform the installation, other Linux distributions should work as well if they can run Docker v1.0+. The first step after OS installation is installing docker. The quickest way to install docker is the following:</span>
        </p>

        <pre class="language-"><code># wget -O - http://get.docker.io | sudo su</code></pre>

        <p><span>The install script will add the docker repository to apt and install docker. </span></p>



        <p><span>2. After it is installed, you must either run docker commands as root or add your user to the &ldquo;docker&rdquo;
            group. You can perform this task using:</span></p>



        <pre class="language-"><code># sudo usermod -aG docker $USER</code></pre>



        <p><span>&hellip; with $USER being the username you want to add to the docker group. You&rsquo;ll need to log out all sessions of the user before the change will take effect. </span>
        </p>



        <p><span>3. Next, you will need to install serviced.</span></p>



        <p><span>Note:</span><span>&nbsp;Please make sure you have set the correct hostname/IP in the host file. Control Center will not function correctly if the hostname is mapped to the loopback adapter IP: 127.0.0.1</span>
        </p>

            

            <pre class="language-"><code># sudo sh -c &#39;echo &quot;deb [ arch=amd64 ] http://get.controlcenter.io/apt/ubuntu trusty universe multiverse&quot; \ <br>
                > /etc/apt/sources.list.d/zenoss.list'
            </code></pre>



        <pre class="language-"><code># sudo apt-get update</span></code></pre>

        <pre class="language-"><code># sudo apt-get install serviced</code></pre>

        <p><span>Serviced should now be installed in /opt/serviced.</span><span>&nbsp;There may be an initial pause before serviced starts up as it loads its internal services images into the running docker instance.</span><span>&nbsp;Once that is complete you should see the Control Center serving up an AngularJS UI at </span><span
                class="c12">https://[HOSTIP]/</a></span><span>. </span></p>



        <p>
            <span>If you don&rsquo;t see serviced starting, start it via the following upstart command: </span></p>

        <pre class="language-"><code># sudo start serviced</code></pre>



        <p><span>4. You will need to log in using a user that is in the </span><span
                class="c4">wheel </span><span>or </span><span class="c4">sudoers</span><span>&nbsp;group. Authentication is performed using PAM; you may need to configure PAM appropriately if you use Kerberos or LDAP for authentication.</span>
        </p>



        <p><span>If in doubt about whether Control Center has started properly, check the log: </span>
        </p>

        <pre class="language-"><code># tail /var/log/upstart/serviced.log </code></pre>



        <p><span>Also check if the host is listening on TCP 443:</span></p>

        <pre class="language-"><code># netstat -an | grep [:]443</code></pre>

        <h3><a name="h.jxtz5jv6c7so"></a><span>Deploying Applications</span></h3>

        <p><span>Next, you will need to deploy an application. Applications are deployed from an application template definition.</span>
        </p>



        <p><span>Step 1 - Download application template</span></p>

        <p><span>We are going to deploy a simple Python webserver using Control Center.</span></p>



        <pre class="language-"><code># git clone https://gist.github.com/mmaloney/48f3a5b392d03b8e3f53 ~/apptemplate</code></pre>



        <p><span>Note:</span><span>&nbsp;If you don&rsquo;t have Git installed, you can grab the file directly from the url above via your browser. If you want to install, run: apt-get install git</span>
        </p>



        <p><span>Step 2 - Load application template</span></p>

        <pre class="language-"><code># templateid=$(serviced template add ~/apptemplate/webserver.json)</code></pre>



        <p><span>Step 3 - Add host</span></p>

        <pre class="language-"><code># serviced host add [HOSTIP]:4979 default</code></pre>



        <p><span>Alternatively, you can add the host through the UI: https://[HOSTIP]/#/hosts</span></p>

        <p><span
                style="overflow: hidden; display: inline-block; margin: 0.00px 0.00px; border: 0.00px solid #000000; transform: rotate(0.00rad) translateZ(0px); -webkit-transform: rotate(0.00rad) translateZ(0px); width: 473.50px; height: 132.79px;"><img
                alt="" src="images/image03.png"
                style="width: 473.50px; height: 132.79px; margin-left: 0.00px; margin-top: 0.00px; transform: rotate(0.00rad) translateZ(0px); -webkit-transform: rotate(0.00rad) translateZ(0px);"
                title=""></span></p>

        <p><span>Step 4 - Deploy Application</span></p>

        <pre class="language-"><code># serviced=$(serviced template deploy $templateid default dev)</code></pre>



        <p>
            <span>Alternatively, you can deploy the application through the UI: https://[HOSTIP]/#/apps</span></p>



        <p><span
                style="overflow: hidden; display: inline-block; margin: 0.00px 0.00px; border: 0.00px solid #000000; transform: rotate(0.00rad) translateZ(0px); -webkit-transform: rotate(0.00rad) translateZ(0px); width: 394.50px; height: 136.56px;"><img
                alt="" src="images/image02.png"
                style="width: 394.50px; height: 136.56px; margin-left: 0.00px; margin-top: 0.00px; transform: rotate(0.00rad) translateZ(0px); -webkit-transform: rotate(0.00rad) translateZ(0px);"
                title=""></span></p>

        <p><span>Note:</span><span>&nbsp;This may take a while since Docker will need to pull the target image from Docker Hub.</span>
        </p>



        <p><span>Step 5 - Start Application</span></p>

        <pre class="language-"><code># serviced service $serviced start</code></pre>



        <p>
            <span>Alternatively, you can start the application through the UI: https://[HOSTIP]/#/apps</span></p>

        <p><span
                style="overflow: hidden; display: inline-block; margin: 0.00px 0.00px; border: 0.00px solid #000000; transform: rotate(0.00rad) translateZ(0px); -webkit-transform: rotate(0.00rad) translateZ(0px); width: 402.50px; height: 99.98px;"><img
                alt="" src="images/image00.png"
                style="width: 402.50px; height: 99.98px; margin-left: 0.00px; margin-top: 0.00px; transform: rotate(0.00rad) translateZ(0px); -webkit-transform: rotate(0.00rad) translateZ(0px);"
                title=""></span></p>

        <p>
            <span>Now you should be able to access the Python web server directly via http://[HOSTIP]:8000 </span>
        </p>



        <p><span>In addition, the web server configuration details are available in the UI including the VHost configuration.</span>
        </p>



        <p><span>Application logging is turned on by default and is available here: https://[HOSTIP]/#/logs</span>
        </p>

        <p><span
                style="overflow: hidden; display: inline-block; margin: 0.00px 0.00px; border: 0.00px solid #000000; transform: rotate(0.00rad) translateZ(0px); -webkit-transform: rotate(0.00rad) translateZ(0px); width: 514.58px; height: 237.50px;"><img
                alt="" src="images/image01.png"
                style="width: 514.58px; height: 237.50px; margin-left: 0.00px; margin-top: 0.00px; transform: rotate(0.00rad) translateZ(0px); -webkit-transform: rotate(0.00rad) translateZ(0px);"
                title=""></span></p>








    </div>
    <!-- entry-content -->
</div><commit_msg>My edits<commit_after>---
layout: default
---
<div class="content">
<header>
    <div class="unit-head">
        <div class="unit-inner unit-head-inner">
            <h1 class="h2 entry-title">Getting Started</h1>
        </div>
        <!-- unit-inner -->
    </div>
    <!-- unit-head -->
</header>

<div class="bd">
    <div class="entry-content">
        <head></title></head>
        <body><h2><a name="h.iz4tqsugqwie"></a><span></span></h2>

        <h3><a name="h.5usgtrkxbqhs"></a><span>Installation</span></h3>



        <p><span>1. You&rsquo;ll need an Ubuntu 14.04 host to perform the installation. (Other Linux distributions should work as well if they can run Docker v1.0+.) The first step after OS installation is installing Docker. The quickest way to install Docker is the following:</span>
        </p>

        <pre class="language-"><code># wget -O - http://get.docker.io | sudo su</code></pre>

        <p><span>The install script will add the Docker repository to apt and install Docker. </span></p>



        <p><span>2. After it is installed, you must either run Docker commands as root or add your user to the &ldquo;docker&rdquo;
            group. You can perform this task using:</span></p>



        <pre class="language-"><code># sudo usermod -aG docker $USER</code></pre>



        <p><span>&hellip; with $USER being the username you want to add to the &ldquo;docker&rdquo; group. You&rsquo;ll need to log out all sessions of the user before the change will take effect. </span>
        </p>



        <p><span>3. Next, you will need to install serviced.</span></p>



        <p><span>Note:</span><span>&nbsp;Please make sure you have set the correct hostname/IP in the host file. Control Center will not function correctly if the hostname is mapped to the loopback adapter IP: 127.0.0.1</span>
        </p>

            

            <pre class="language-"><code># sudo sh -c &#39;echo &quot;deb [ arch=amd64 ] http://get.controlcenter.io/apt/ubuntu trusty universe multiverse&quot; \ <br>
                > /etc/apt/sources.list.d/zenoss.list'
            </code></pre>



        <pre class="language-"><code># sudo apt-get update</span></code></pre>

        <pre class="language-"><code># sudo apt-get install serviced</code></pre>

        <p><span>Serviced should now be installed in /opt/serviced.</span><span>&nbsp;There may be an initial pause before serviced starts up as it loads its internal services images into the running Docker instance.</span><span>&nbsp;Once that is complete you should see the Control Center serving up an AngularJS UI at </span><span
                class="c12">https://[HOSTIP]/</a></span><span>. </span></p>



        <p>
            <span>If you don&rsquo;t see serviced starting, start it via the following upstart command: </span></p>

        <pre class="language-"><code># sudo start serviced</code></pre>



        <p><span>4. You will need to log in using a user that is in the </span><span
                class="c4">wheel </span><span>or </span><span class="c4">sudoers</span><span>&nbsp;group. Authentication is performed using PAM; you may need to configure PAM appropriately if you use Kerberos or LDAP for authentication.</span>
        </p>



        <p><span>If in doubt about whether Control Center has started properly, check the log: </span>
        </p>

        <pre class="language-"><code># tail /var/log/upstart/serviced.log </code></pre>



        <p><span>Also check if the host is listening on TCP 443:</span></p>

        <pre class="language-"><code># netstat -an | grep [:]443</code></pre>

        <h3><a name="h.jxtz5jv6c7so"></a><span>Deploying Applications</span></h3>

        <p><span>Next, you will need to deploy an application. Applications are deployed from an application template definition.</span>
        </p>



        <p><span>Step 1 - Download application template</span></p>

        <p><span>We are going to deploy a simple Python webserver using Control Center.</span></p>



        <pre class="language-"><code># git clone https://gist.github.com/mmaloney/48f3a5b392d03b8e3f53 ~/apptemplate</code></pre>



        <p><span>Note:</span><span>&nbsp;If you don&rsquo;t have Git installed, you can grab the file directly from the URL above via your browser. If you want to install, run: apt-get install git</span>
        </p>



        <p><span>Step 2 - Load application template</span></p>

        <pre class="language-"><code># templateid=$(serviced template add ~/apptemplate/webserver.json)</code></pre>



        <p><span>Step 3 - Add host</span></p>

        <pre class="language-"><code># serviced host add [HOSTIP]:4979 default</code></pre>



        <p><span>Alternatively, you can add the host through the UI: https://[HOSTIP]/#/hosts</span></p>

        <p><span
                style="overflow: hidden; display: inline-block; margin: 0.00px 0.00px; border: 0.00px solid #000000; transform: rotate(0.00rad) translateZ(0px); -webkit-transform: rotate(0.00rad) translateZ(0px); width: 473.50px; height: 132.79px;"><img
                alt="" src="images/image03.png"
                style="width: 473.50px; height: 132.79px; margin-left: 0.00px; margin-top: 0.00px; transform: rotate(0.00rad) translateZ(0px); -webkit-transform: rotate(0.00rad) translateZ(0px);"
                title=""></span></p>

        <p><span>Step 4 - Deploy Application</span></p>

        <pre class="language-"><code># serviced=$(serviced template deploy $templateid default dev)</code></pre>



        <p>
            <span>Alternatively, you can deploy the application through the UI: https://[HOSTIP]/#/apps</span></p>



        <p><span
                style="overflow: hidden; display: inline-block; margin: 0.00px 0.00px; border: 0.00px solid #000000; transform: rotate(0.00rad) translateZ(0px); -webkit-transform: rotate(0.00rad) translateZ(0px); width: 394.50px; height: 136.56px;"><img
                alt="" src="images/image02.png"
                style="width: 394.50px; height: 136.56px; margin-left: 0.00px; margin-top: 0.00px; transform: rotate(0.00rad) translateZ(0px); -webkit-transform: rotate(0.00rad) translateZ(0px);"
                title=""></span></p>

        <p><span>Note:</span><span>&nbsp;This may take a while, since Docker needs to pull the target image from Docker Hub.</span>
        </p>



        <p><span>Step 5 - Start Application</span></p>

        <pre class="language-"><code># serviced service $serviced start</code></pre>



        <p>
            <span>Alternatively, you can start the application through the UI: https://[HOSTIP]/#/apps</span></p>

        <p><span
                style="overflow: hidden; display: inline-block; margin: 0.00px 0.00px; border: 0.00px solid #000000; transform: rotate(0.00rad) translateZ(0px); -webkit-transform: rotate(0.00rad) translateZ(0px); width: 402.50px; height: 99.98px;"><img
                alt="" src="images/image00.png"
                style="width: 402.50px; height: 99.98px; margin-left: 0.00px; margin-top: 0.00px; transform: rotate(0.00rad) translateZ(0px); -webkit-transform: rotate(0.00rad) translateZ(0px);"
                title=""></span></p>

        <p>
            <span>Now you should be able to access the Python web server directly via http://[HOSTIP]:8000 </span>
        </p>



        <p><span>In addition, the web server configuration details are available in the UI, including the VHost configuration.</span>
        </p>



        <p><span>Application logging is turned on by default and is available here: https://[HOSTIP]/#/logs</span>
        </p>

        <p><span
                style="overflow: hidden; display: inline-block; margin: 0.00px 0.00px; border: 0.00px solid #000000; transform: rotate(0.00rad) translateZ(0px); -webkit-transform: rotate(0.00rad) translateZ(0px); width: 514.58px; height: 237.50px;"><img
                alt="" src="images/image01.png"
                style="width: 514.58px; height: 237.50px; margin-left: 0.00px; margin-top: 0.00px; transform: rotate(0.00rad) translateZ(0px); -webkit-transform: rotate(0.00rad) translateZ(0px);"
                title=""></span></p>








    </div>
    <!-- entry-content -->
</div>
{'fraction_non_alphanumeric': 0.1557712262711347, 'fraction_numerical': 0.0371116401147531, 'mean_word_length': 2.8641509433962264, 'pattern_counts': {'":': 0, '<': 481, '<?xml version=': 0, '>': 483, 'https://': 12, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4469313', 'n_tokens_mistral': 5614, 'n_tokens_neox': 4870, 'n_words': 1475}