Skip to content

Commit

Permalink
deploy: 4b55f44
Browse files Browse the repository at this point in the history
  • Loading branch information
cjcchen committed Aug 22, 2023
1 parent d3ce1ca commit 2aa6aba
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ <h1><a class="anchor" id="autotoc_md67"></a>
Usage</h1>
<h2><a class="anchor" id="autotoc_md68"></a>
Deploy KV Service</h2>
<p>Add the IP addresses and the SSH key of the machines where you wish to deploy ResilientDB replicas and client proxy in the file <a href="https://github.com/msadoghi/nexres/blob/master/deploy/config/kv_server.conf">config/kv_server.conf</a>. We recomment using private IP addresses of each machine.</p>
<p>Add the IP addresses and the SSH key of the machines where you wish to deploy ResilientDB replicas and client proxy in the file <a href="https://github.com/msadoghi/nexres/blob/master/deploy/config/kv_server.conf">config/kv_server.conf</a>. We recommend using private IP addresses of each machine.</p>
<ul>
<li>If you do not require any SSH key to log in to a machine, then you would need to update the scripts.</li>
<li>In these scripts, we assume that the <code>root</code> is <code>ubuntu</code> and the current working directory is located at <code>/home/ubuntu/</code>. If this is not the case for your machines, you would need to update the scripts.</li>
Expand Down
12 changes: 6 additions & 6 deletions d8/d84/md__2github_2workspace_2platform_2statistic_2README.html
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,10 @@ <h2><a class="anchor" id="autotoc_md37"></a>
<div class="line">sudo apt install grafana</div>
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md40"></a>
Change endpoint's server address</h2>
<p>Edit <a href="../..//example/start_kv_server.sh">example/start_kv_server.sh</a>, set the new endpoint address in command line arguments.</p>
<p>Edit <a href="../..//example/start_kv_server.sh">example/start_kv_server.sh</a>, sets the new endpoint address in command line arguments.</p>
<h1><a class="anchor" id="autotoc_md41"></a>
Start the dashboard</h1>
<p>Prometheus endpoint start automaticly with nexres. To start nexres: </p><div class="fragment"><div class="line">sh example/kv_server.sh</div>
<p>Prometheus endpoint starts automatically with nexres. To start nexres: </p><div class="fragment"><div class="line">sh example/kv_server.sh</div>
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md42"></a>
Prometheus</h2>
<p>Default prometheus port is 9090 </p><div class="fragment"><div class="line">./prometheus</div>
Expand All @@ -136,7 +136,7 @@ <h1><a class="anchor" id="autotoc_md41"></a>
<div class="line">sudo service grafana-server enable</div>
</div><!-- fragment --><p> <em>Stop grafana: sudo service grafana-server stop</em></p>
<h1><a class="anchor" id="autotoc_md45"></a>
Configurate prometheus</h1>
Configure prometheus</h1>
<h2><a class="anchor" id="autotoc_md46"></a>
Add prometheus endpoint:</h2>
<p>Edit “prometheus.yml” under your prometheus folder add the following code after “scrape_configs” </p><div class="fragment"><div class="line">- job_name: &quot;your_job_name&quot;</div>
Expand Down Expand Up @@ -172,12 +172,12 @@ <h2><a class="anchor" id="autotoc_md52"></a>
<p>Go to grafana configuration and click data source. Select your prometheus database and click to change setting, locate "Scrape interval" and change it to 5s.</p>
<p><img src="../..//documents/image/dashboard/resolution.png" alt="resolution" class="inline"/></p>
<h1><a class="anchor" id="autotoc_md53"></a>
Prometheus metrics developemt:</h1>
Prometheus metrics development:</h1>
<p>All the prometheus endpoint code and metrics builder are located under Stats class. There are three types of metric variables you can utilize according to the demand. They are Counter, Gauge, and Histogram. You can discover their using scenario in this <a href="https://prometheus.io/docs/concepts/metric_types/">link</a>.</p>
<p>To properly integrate these metric types to the code, check prometheus-cpp documentation (<a href="https://jupp0r.github.io/prometheus-cpp/">Documentation</a>, <a href="https://github.com/jupp0r/prometheus-cpp">Example</a>). Here is an example of starting a prometheus endpoint and adding a metric to the database.</p>
<p>Create a server running on port 8080 </p><div class="fragment"><div class="line">Exposer exposer{&quot;127.0.0.1:8080&quot;};</div>
</div><!-- fragment --><p>Create a metrics registry (make sure it is alway alive) </p><div class="fragment"><div class="line">auto registry = std::make_shared&lt;Registry&gt;();</div>
</div><!-- fragment --><p>Add a new gauge family to the registry (you can change this part to other metric type as your needed) </p><div class="fragment"><div class="line">auto&amp; packet_counter = BuildGauge()</div>
</div><!-- fragment --><p>Create a metrics registry (make sure it is always alive) </p><div class="fragment"><div class="line">auto registry = std::make_shared&lt;Registry&gt;();</div>
</div><!-- fragment --><p>Add a new gauge family to the registry (you can change this part to other metric type as needed) </p><div class="fragment"><div class="line">auto&amp; packet_counter = BuildGauge()</div>
<div class="line"> .Name(&quot;observed_packets_total&quot;)</div>
<div class="line"> .Help(&quot;Number of observe packets&quot;)</div>
<div class="line"> .Register(*registry);</div>
Expand Down

0 comments on commit 2aa6aba

Please sign in to comment.