{"id":419,"date":"2020-08-04T08:43:33","date_gmt":"2020-08-04T08:43:33","guid":{"rendered":"https:\/\/silviamarin.ro\/?p=419"},"modified":"2020-08-04T08:43:33","modified_gmt":"2020-08-04T08:43:33","slug":"instalare-influxdb","status":"publish","type":"post","link":"https:\/\/marinelvis.xyz\/index.php\/2020\/08\/04\/instalare-influxdb\/","title":{"rendered":"INSTALARE InfluxDB"},"content":{"rendered":"<pre>wget -q https:\/\/repos.influxdata.com\/influxdata-archive_compat.key\ngpg --with-fingerprint --show-keys .\/influxdata-archive_compat.key<\/pre>\n<pre>cat influxdata-archive_compat.key | gpg --dearmor | sudo tee \/etc\/apt\/trusted.gpg.d\/influxdata-archive_compat.gpg &gt; \/dev\/null<\/pre>\n<pre>echo 'deb [signed-by=\/etc\/apt\/trusted.gpg.d\/influxdata-archive_compat.gpg] https:\/\/repos.influxdata.com\/debian stable main' | sudo tee \/etc\/apt\/sources.list.d\/influxdata.list<\/pre>\n<pre>sudo rm -f \/etc\/apt\/trusted.gpg.d\/influxdb.gpg\nsudo apt update &amp;&amp; sudo apt install -y influxdb \nsudo systemctl unmask influxdb.service \nsudo systemctl start influxdb \nsudo systemctl enable influxdb.service \nsudo systemctl status influxdb.service<\/pre>\n<p>Se deschide <em>InfluxDB<\/em> cu comanda:<\/p>\n<pre>influx<\/pre>\n<p>Se creeaza utilizatorul <em>elvis<\/em> si se aloca privilegiile:<\/p>\n<pre>CREATE USER elvis WITH PASSWORD\u00a0<span style=\"color: #ff0000;\">'parola'<\/span> WITH ALL PRIVILEGES\nSHOW USERS<\/pre>\n<p>Output-ul este de forma:<\/p>\n<blockquote><p><em>user admin<\/em><br \/>\n<em>&#8211;- &#8211;&#8211;<\/em><br \/>\n<em>elvis true<\/em><\/p><\/blockquote>\n<p>Se creeaza baza de date <em>ambiental<\/em>:<\/p>\n<pre>CREATE DATABASE ambiental\nSHOW DATABASES\nGRANT ALL PRIVILEGES ON ambiental TO elvis\nCREATE RETENTION POLICY \"un_an\" ON ambiental DURATION 365d REPLICATION 1 DEFAULT\nSHOW RETENTION POLICIES ON ambiental<\/pre>\n<p>Se creeaza baza de date <em>atmosferic:<\/em><\/p>\n<pre>CREATE DATABASE atmosferic\nSHOW DATABASES\nGRANT ALL PRIVILEGES ON atmosferic TO elvis\nCREATE RETENTION POLICY \"un_an\" ON atmosferic DURATION 365d REPLICATION 1 DEFAULT\nSHOW RETENTION POLICIES ON atmosferic<\/pre>\n<p><strong>Comenzi InfluxDB<\/strong><br \/>\nListeaza toate inregistrarile pentru measurement-ul HOL<\/p>\n<pre>SELECT * FROM HOL<\/pre>\n<p>Sterge inregistrarile cu timestamp mai mic de 1596371314400780243 din measurement-ul HOL:<\/p>\n<pre>DELETE FROM HOL WHERE time &lt; 1596371314400780243<\/pre>\n<p>Introduce date in baza de date <em>ambiental<\/em> cu measurement-urile <em>HOL, MIHAI, DORMITOR si BUCATARIE<\/em>:<\/p>\n<pre>USE ambiental\nINSERT HOL,senzor_id=XiaomiHOL,type=assembly temperatura=13.69,umiditate=58.17,baterie=57,tensiune=2935\nINSERT MIHAI,senzor_id=XiaomiMIHAI,type=assembly temperatura=14.88,umiditate=65.98,baterie=83,tensiune=2935\nINSERT DORMITOR,senzor_id=XiaomiDORMITOR,type=assembly temperatura=13.53,umiditate=67.51,baterie=77,tensiune=2935\nINSERT BUCATARIE,senzor_id=XiaomiBUCATARIE,type=assembly temperatura=14.23,umiditate=59.51,baterie=49,tensiune=2935\nINSERT SUFRAGERIE,senzor_id=XiaomiSUFRAGERIE,type=assembly temperatura=12.60,umiditate=65.00,baterie=100,tensiune=2935\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>wget -q https:\/\/repos.influxdata.com\/influxdata-archive_compat.key gpg &#8211;with-fingerprint &#8211;show-keys .\/influxdata-archive_compat.key cat influxdata-archive_compat.key | gpg &#8211;dearmor | sudo tee \/etc\/apt\/trusted.gpg.d\/influxdata-archive_compat.gpg &gt; \/dev\/null echo &#8216;deb [signed-by=\/etc\/apt\/trusted.gpg.d\/influxdata-archive_compat.gpg] https:\/\/repos.influxdata.com\/debian stable main&#8217; | sudo tee \/etc\/apt\/sources.list.d\/influxdata.list sudo rm -f \/etc\/apt\/trusted.gpg.d\/influxdb.gpg sudo apt update &amp;&amp; sudo apt install -y influxdb sudo systemctl unmask influxdb.service sudo systemctl start influxdb sudo systemctl enable influxdb.service sudo systemctl [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-419","post","type-post","status-publish","format-standard","hentry","category-fara-categorie"],"_links":{"self":[{"href":"https:\/\/marinelvis.xyz\/index.php\/wp-json\/wp\/v2\/posts\/419","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/marinelvis.xyz\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/marinelvis.xyz\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/marinelvis.xyz\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/marinelvis.xyz\/index.php\/wp-json\/wp\/v2\/comments?post=419"}],"version-history":[{"count":0,"href":"https:\/\/marinelvis.xyz\/index.php\/wp-json\/wp\/v2\/posts\/419\/revisions"}],"wp:attachment":[{"href":"https:\/\/marinelvis.xyz\/index.php\/wp-json\/wp\/v2\/media?parent=419"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/marinelvis.xyz\/index.php\/wp-json\/wp\/v2\/categories?post=419"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/marinelvis.xyz\/index.php\/wp-json\/wp\/v2\/tags?post=419"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}