{"id":1231,"date":"2022-09-06T18:10:09","date_gmt":"2022-09-06T16:10:09","guid":{"rendered":"https:\/\/kairntech.com\/doc\/?page_id=1231"},"modified":"2023-03-14T16:05:25","modified_gmt":"2023-03-14T15:05:25","slug":"operating-guide","status":"publish","type":"page","link":"https:\/\/kairntech.com\/doc\/operating-guide\/","title":{"rendered":"Operating Guide"},"content":{"rendered":"\n<p>All listed commands below come from the environment <strong>UBUNTU 18.04 LTS x64<\/strong>.<\/p>\n\n\n\n<p>In the following notes, the term&nbsp;<em>Sherpa<\/em>&nbsp;is used to qualify the Kairntech platform.<\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"create-a-backup-of-database-content\">Create a backup of database content<\/h2>\n\n\n\n<p>If you need to create a backup of the MongoDB database, here are the commands to process. The dump will be first generated on the running container, then copied on the host.<\/p>\n\n\n\n<p>In case the server is configured with authentication:<\/p>\n\n\n\n<pre class=\"wp-block-code has-cyan-bluish-gray-background-color has-background\"><code>MONGODUMP=\/tmp\/mongodump.gz\nMONGODB_USERNAME=*******\nMONGODB_PASSWORD=***********\n\ndocker exec -i sherpa-mongodb mongodump -u\"${MONGODB_USERNAME}\" -p\"${MONGODB_PASSWORD}\" --gzip --quiet --archive=\"${MONGODUMP}\"<\/code><\/pre>\n\n\n\n<p>In case the server is configured without authentication:<\/p>\n\n\n\n<pre class=\"wp-block-code has-cyan-bluish-gray-background-color has-background\"><code>MONGODUMP=\/tmp\/mongodump.gz\n\ndocker exec -i sherpa-mongodb mongodump --gzip --quiet --archive=\"${MONGODUMP}\"<\/code><\/pre>\n\n\n\n<p>Both commands will generate a file stored at <code>\/tmp\/mongodump.gz<\/code> on the running container. <\/p>\n\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>Thus to retrieve on the host, the generated file, you&#8217;ll need to:<\/p>\n\n\n\n<pre class=\"wp-block-code has-cyan-bluish-gray-background-color has-background\"><code>MONGODUMP=\/tmp\/mongodump.gz\nDUMPS=\/opt\/sherpa-backups\nDATENOW=$( date +%Y%m%d_%H%M%S )\n\ndocker cp sherpa-mongodb:\"${MONGODUMP}\" \"${DUMPS}\"\/mongodump-\"$( hostname )\"-\"${DATENOW}\".gz<\/code><\/pre>\n\n\n\n<p>Finally, the gz MongoDB dump file will be stored, on the host, under path <code>\/opt\/sherpa-backups<\/code>.<\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"restore-a-backup-of-database-content\">Restore a backup of database content<\/h2>\n\n\n\n<p>If you need to restore a MongoDB database content, from a backup, here are the commands to process. The dump will be copied into the running container, and restored on the running container.<\/p>\n\n\n\n<p>In case the server is configured with authentication:<\/p>\n\n\n\n<pre class=\"wp-block-code has-cyan-bluish-gray-background-color has-background\"><code>MONGODUMP=\/opt\/sherpa-backups\/mongodump-sherpa-aws-20220724_120001.gz\nMONGODB_USERNAME=*******\nMONGODB_PASSWORD=***********\n\ndocker cp \"${MONGODUMP}\" sherpa-mongodb:\/mongodump.gz\n\ndocker exec -it sherpa-mongodb mongorestore -u\"${MONGODB_USERNAME}\" -p\"${MONGODB_PASSWORD}\" --drop --gzip --archive=mongodump.gz<\/code><\/pre>\n\n\n\n<p>In case the server is configured without authentication:<\/p>\n\n\n\n<pre class=\"wp-block-code has-cyan-bluish-gray-background-color has-background\"><code>MONGODUMP=\/opt\/sherpa-backups\/mongodump-sherpa-aws-20220821_120001.gz\n\ndocker cp \"${MONGODUMP}\" sherpa-mongodb:\/mongodump.gz\n\ndocker exec -it sherpa-mongodb mongorestore -u\"${MONGODB_USERNAME}\" -p\"${MONGODB_PASSWORD}\" --drop --gzip --archive=mongodump.gz<\/code><\/pre>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"delete-a-specific-elasticsearch-index\">Delete a specific ElasticSearch index<\/h2>\n\n\n\n<p>If you need to delete indexes of a specific project, in the ElasticSearch cluster, you can go with:<\/p>\n\n\n\n<pre class=\"wp-block-code has-cyan-bluish-gray-background-color has-background\"><code>docker exec -it sherpa-elasticsearch \/bin\/bash\n\nINDEXES=$( curl -s -X GET \"localhost:9200\/_cat\/indices\" | grep &lt;MY_PROJECT&gt; | cut -d' ' -f3 )\n\nfor INDEX in ${INDEXES} ; do curl -X DELETE \"localhost:9200\/${INDEX}\" &gt; \/dev\/null 2&gt;&amp;1 ; done<\/code><\/pre>\n\n\n\n<p>When deleting indexes of a given project, an administrator of the platform will have to reindex the whole content of the project (all data are stored on the database).<\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"modify-http-port-of-sherpa-platform\">Modify HTTP port of Sherpa platform<\/h2>\n\n\n\n<p>If you need to set a specific port for Sherpa to listen to, you will need to update <code>docker-compose.yml<\/code> file. By default, Sherpa listens to port <strong>7070<\/strong>.<\/p>\n\n\n\n<p>Change from:<\/p>\n\n\n\n<pre class=\"wp-block-code has-cyan-bluish-gray-background-color has-background\"><code>sherpa-core:\n    ports:\n          - 7070:7070<\/code><\/pre>\n\n\n\n<p>To (in the example, port is set to <strong>7071<\/strong>):<\/p>\n\n\n\n<pre class=\"wp-block-code has-cyan-bluish-gray-background-color has-background\"><code>sherpa-core:\n    ports:\n          - <strong>7071<\/strong>:7070<\/code><\/pre>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"configure-a-secured-https-connexion\">Configure a secured HTTPS connexion<\/h2>\n\n\n\n<p>The platform will be reachable at http:\/\/localhost:7071\/sherpa<\/p>\n\n\n\n<p>If you want Sherpa to be served over HTTPS protocol, you&#8217;ll need to update file <code>docker-compose.yml<\/code> file. By default, Sherpa is served over HTTP protocol.<\/p>\n\n\n\n<p>Change from:<\/p>\n\n\n\n<pre class=\"wp-block-code has-cyan-bluish-gray-background-color has-background\"><code>sherpa-core:\n    environment:\n          - sherpa_httpserver_ssl_enabled=false<\/code><\/pre>\n\n\n\n<p>To:<\/p>\n\n\n\n<pre class=\"wp-block-code has-cyan-bluish-gray-background-color has-background\"><code>sherpa-core:\n    environment:\n          - sherpa_httpserver_ssl_enabled=true<\/code><\/pre>\n\n\n\n<p>The platform will be reachable at http<strong>s<\/strong>:\/\/localhost:7070\/sherpa<\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"modify-default-docker-root-dir\">Modify default Docker Root Dir<\/h2>\n\n\n\n<p>By default, docker working dir, called Docker Root Dir, is located under <code>\/var\/lib\/docker<\/code><\/p>\n\n\n\n<pre class=\"wp-block-code has-cyan-bluish-gray-background-color has-background\"><code>docker info|grep 'Root Dir'\n Docker Root Dir: \/var\/lib\/docker<\/code><\/pre>\n\n\n\n<p>If you need to change this default value, because, for instance, the <code>\/var<\/code> partition does not give enough disk space, this can be achieved by adding a file <code>\/etc\/docker\/daemon.json<\/code> containing:<\/p>\n\n\n\n<pre class=\"wp-block-code has-cyan-bluish-gray-background-color has-background\"><code>cat \/etc\/docker\/daemon.json \n{\n  \"data-root\": \"\/mnt\/diskb\/docker\"\n}\n\nls -l \/etc\/docker\/daemon.json \n-rw-r--r-- 1 root root 299 Dec  6  2021 \/etc\/docker\/daemon.json<\/code><\/pre>\n\n\n\n<p>Once the file has been added, you&#8217;ll have to restart docker service:<\/p>\n\n\n\n<pre class=\"wp-block-code has-cyan-bluish-gray-background-color has-background\"><code>systemctl restart docker<\/code><\/pre>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"update-embedded-documentation\">Update embedded DOCUMENTATION<\/h2>\n\n\n\n<p>In order to benefit a documentation update, corresponding files must be downloaded.<br>These prerequisite files are stored as Docker volumes. In order to download these items, please run:<\/p>\n\n\n\n<pre class=\"wp-block-code has-cyan-bluish-gray-background-color has-background\"><code>sudo su - kairntech\n\ncd ~\/embeddings\n\n# INSTALL VERSION DATED 03\/09\/2023\nexport DOC_VERSION='2023.03.09'\ndocker compose -f docker-compose.doc.volumes.yml -p documentation-sherpa up<\/code><\/pre>\n\n\n\n<p>Once deployed, you should get the following sizes<\/p>\n\n\n\n<pre class=\"wp-block-code has-cyan-bluish-gray-background-color has-background\"><code>sudo du -hs \/var\/lib\/docker\/volumes\/sherpashared_sherpa-doc\/_data\/\n152M    \/var\/lib\/docker\/volumes\/sherpashared_sherpa-doc\/_data\/<\/code><\/pre>\n\n\n\n<p>The Docker container can be removed, once documentation is deployed, via:<\/p>\n\n\n\n<pre class=\"wp-block-code has-cyan-bluish-gray-background-color has-background\"><code>docker rm documentation-sherpa-init-job<\/code><\/pre>\n\n\n\n<p>When updating embedded documentation, a specific volume must be added to the <code>sherpa-core<\/code> volumes section:<\/p>\n\n\n\n<pre class=\"wp-block-code has-cyan-bluish-gray-background-color has-background\"><code>#########################################################################\n# SHERPA CORE\n    sherpa-core:\n    ...\n    volumes:\n        ...\n        - sherpa-doc:\/app\/kairntech\/sherpa\/doc<\/code><\/pre>\n\n\n\n<p>With its corresponding volume declaration (at the end of the <code>docker-compose.yml<\/code> file):<\/p>\n\n\n\n<pre class=\"wp-block-code has-cyan-bluish-gray-background-color has-background\"><code>#########################################################################\nvolumes:\n    ...\n    sherpa-doc:\n      external: true\n      name: sherpashared_sherpa-doc\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>All listed commands below come from the environment UBUNTU 18.04 LTS x64. In the following notes, the term&nbsp;Sherpa&nbsp;is used to qualify the Kairntech platform. Create a backup of database content If you need to create a backup of the MongoDB database, here are the commands to process. The dump will be first generated on the [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-1231","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Operating Guide - Kairntech Documentation<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/kairntech.com\/doc\/operating-guide\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Operating Guide - Kairntech Documentation\" \/>\n<meta property=\"og:description\" content=\"All listed commands below come from the environment UBUNTU 18.04 LTS x64. In the following notes, the term&nbsp;Sherpa&nbsp;is used to qualify the Kairntech platform. Create a backup of database content If you need to create a backup of the MongoDB database, here are the commands to process. The dump will be first generated on the [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/kairntech.com\/doc\/operating-guide\/\" \/>\n<meta property=\"og:site_name\" content=\"Kairntech Documentation\" \/>\n<meta property=\"article:modified_time\" content=\"2023-03-14T15:05:25+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/kairntech.com\/doc\/operating-guide\/\",\"url\":\"https:\/\/kairntech.com\/doc\/operating-guide\/\",\"name\":\"Operating Guide - Kairntech Documentation\",\"isPartOf\":{\"@id\":\"https:\/\/kairntech.com\/doc\/#website\"},\"datePublished\":\"2022-09-06T16:10:09+00:00\",\"dateModified\":\"2023-03-14T15:05:25+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/kairntech.com\/doc\/operating-guide\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/kairntech.com\/doc\/operating-guide\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/kairntech.com\/doc\/operating-guide\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/kairntech.com\/doc\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Operating Guide\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/kairntech.com\/doc\/#website\",\"url\":\"https:\/\/kairntech.com\/doc\/\",\"name\":\"Kairntech Documentation\",\"description\":\"All the information you need to use Kairntech Software, methodology,  user and installation guides.\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/kairntech.com\/doc\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Operating Guide - Kairntech Documentation","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/kairntech.com\/doc\/operating-guide\/","og_locale":"en_GB","og_type":"article","og_title":"Operating Guide - Kairntech Documentation","og_description":"All listed commands below come from the environment UBUNTU 18.04 LTS x64. In the following notes, the term&nbsp;Sherpa&nbsp;is used to qualify the Kairntech platform. Create a backup of database content If you need to create a backup of the MongoDB database, here are the commands to process. The dump will be first generated on the [&hellip;]","og_url":"https:\/\/kairntech.com\/doc\/operating-guide\/","og_site_name":"Kairntech Documentation","article_modified_time":"2023-03-14T15:05:25+00:00","twitter_card":"summary_large_image","twitter_misc":{"Estimated reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/kairntech.com\/doc\/operating-guide\/","url":"https:\/\/kairntech.com\/doc\/operating-guide\/","name":"Operating Guide - Kairntech Documentation","isPartOf":{"@id":"https:\/\/kairntech.com\/doc\/#website"},"datePublished":"2022-09-06T16:10:09+00:00","dateModified":"2023-03-14T15:05:25+00:00","breadcrumb":{"@id":"https:\/\/kairntech.com\/doc\/operating-guide\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/kairntech.com\/doc\/operating-guide\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/kairntech.com\/doc\/operating-guide\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/kairntech.com\/doc\/"},{"@type":"ListItem","position":2,"name":"Operating Guide"}]},{"@type":"WebSite","@id":"https:\/\/kairntech.com\/doc\/#website","url":"https:\/\/kairntech.com\/doc\/","name":"Kairntech Documentation","description":"All the information you need to use Kairntech Software, methodology,  user and installation guides.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/kairntech.com\/doc\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"}]}},"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/kairntech.com\/doc\/wp-json\/wp\/v2\/pages\/1231","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kairntech.com\/doc\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/kairntech.com\/doc\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/kairntech.com\/doc\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/kairntech.com\/doc\/wp-json\/wp\/v2\/comments?post=1231"}],"version-history":[{"count":8,"href":"https:\/\/kairntech.com\/doc\/wp-json\/wp\/v2\/pages\/1231\/revisions"}],"predecessor-version":[{"id":3056,"href":"https:\/\/kairntech.com\/doc\/wp-json\/wp\/v2\/pages\/1231\/revisions\/3056"}],"wp:attachment":[{"href":"https:\/\/kairntech.com\/doc\/wp-json\/wp\/v2\/media?parent=1231"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}