{"id":251,"date":"2019-08-07T15:52:38","date_gmt":"2019-08-07T19:52:38","guid":{"rendered":"https:\/\/blog.jjhayes.net\/wp\/?p=251"},"modified":"2019-08-07T15:52:38","modified_gmt":"2019-08-07T19:52:38","slug":"run-influxdb-v2-in-docker-with-volume-mounts","status":"publish","type":"post","link":"https:\/\/blog.jjhayes.net\/wp\/2019\/08\/07\/run-influxdb-v2-in-docker-with-volume-mounts\/","title":{"rendered":"Run InfluxDB v2 in Docker with volume mounts"},"content":{"rendered":"<h2>Dockerizing InfluxDB v2 (influxdbv2)<\/h2>\n<p>By default, the influxdb:2.0.0-alpha docker image uses the following key file locations (per <a href=\"https:\/\/v2.docs.influxdata.com\/v2.0\/reference\/config-options\/\">InfluxDBv2 docs<\/a>), but doesn&#8217;t mention setting them in the docker image documentation.<\/p>\n<h3>&#8211;bolt-path<\/h3>\n<p><strong>Default:<\/strong> <code>~\/.influxdbv2\/influxd.bolt<br \/><\/code>InfluxDB uses BoltDB to store data including organization and user information, UI data, REST resources, and other key value data.<\/p>\n<h3>&#8211;engine-path<\/h3>\n<p><strong>Default:<\/strong> <code>~\/.influxdbv2\/engine<br \/><\/code>Persistent storage engine files where InfluxDB stores all Time-Structure Merge Tree (TSM) data on disk.<\/p>\n<h3>Putting it Together&#8230;<\/h3>\n<p>Here&#8217;s how I run it in rancherOS using a volume mount for boltdb and the influx engine:<\/p>\n<pre>docker run -d --name influxdb --restart=unless-stopped \\<br \/>-m \"2048m\" \\<br \/>-p 9999:9999 \\<br \/>--volume \/home\/rancher\/influxdbv2:\/root\/.influxdbv2 \\<br \/>quay.io\/influxdb\/influxdb:2.0.0-alpha --reporting-disabled<\/pre>\n<h2>Docker Dashboard Template<\/h2>\n<p>By default, the Docker dashboard template has a few tiles that aren&#8217;t set up properly for a good first run &#8211; I had to remove this filter for 3 of the tiles to get a proper display of the &#8220;per container&#8221; metrics.<\/p>\n<pre><span class=\"blob-code-inner\"><span class=\"pl-s\">|&gt; filter(fn: (r) =&gt; r.container_name == <span class=\"pl-cce\">\\\"<\/span>my-influxdb2<span class=\"pl-cce\">\\\"<\/span>)<\/span><\/span><\/pre>\n<p><span class=\"blob-code-inner\"><span class=\"pl-s\"><br \/><\/span><\/span><a href=\"https:\/\/blog.jjhayes.net\/wp\/wp-content\/uploads\/2019\/08\/influxdbv2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-254\" src=\"https:\/\/blog.jjhayes.net\/wp\/wp-content\/uploads\/2019\/08\/influxdbv2-1024x363.png\" alt=\"\" width=\"940\" height=\"333\" srcset=\"https:\/\/blog.jjhayes.net\/wp\/wp-content\/uploads\/2019\/08\/influxdbv2-1024x363.png 1024w, https:\/\/blog.jjhayes.net\/wp\/wp-content\/uploads\/2019\/08\/influxdbv2-300x106.png 300w, https:\/\/blog.jjhayes.net\/wp\/wp-content\/uploads\/2019\/08\/influxdbv2-768x273.png 768w\" sizes=\"auto, (max-width: 940px) 100vw, 940px\" \/><\/a><\/p>\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Dockerizing InfluxDB v2 (influxdbv2) By default, the influxdb:2.0.0-alpha docker image uses the following key file locations (per InfluxDBv2 docs), but doesn&#8217;t mention setting them in the docker image documentation. &#8211;bolt-path Default: ~\/.influxdbv2\/influxd.boltInfluxDB uses BoltDB to store data including organization and user information, UI data, REST resources, and other key value data. &#8211;engine-path Default: ~\/.influxdbv2\/enginePersistent storage [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":254,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[45],"tags":[46],"class_list":["post-251","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-docker","tag-docker"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/blog.jjhayes.net\/wp\/wp-content\/uploads\/2019\/08\/influxdbv2.png","jetpack_shortlink":"https:\/\/wp.me\/p3XdjT-43","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/blog.jjhayes.net\/wp\/wp-json\/wp\/v2\/posts\/251","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.jjhayes.net\/wp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.jjhayes.net\/wp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.jjhayes.net\/wp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.jjhayes.net\/wp\/wp-json\/wp\/v2\/comments?post=251"}],"version-history":[{"count":5,"href":"https:\/\/blog.jjhayes.net\/wp\/wp-json\/wp\/v2\/posts\/251\/revisions"}],"predecessor-version":[{"id":258,"href":"https:\/\/blog.jjhayes.net\/wp\/wp-json\/wp\/v2\/posts\/251\/revisions\/258"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.jjhayes.net\/wp\/wp-json\/wp\/v2\/media\/254"}],"wp:attachment":[{"href":"https:\/\/blog.jjhayes.net\/wp\/wp-json\/wp\/v2\/media?parent=251"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.jjhayes.net\/wp\/wp-json\/wp\/v2\/categories?post=251"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.jjhayes.net\/wp\/wp-json\/wp\/v2\/tags?post=251"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}