{"id":433,"date":"2024-08-29T00:18:00","date_gmt":"2024-08-29T00:18:00","guid":{"rendered":"http:\/\/blog.firatyasar.com\/?p=433"},"modified":"2025-03-30T00:23:18","modified_gmt":"2025-03-30T00:23:18","slug":"deploy-mongodb-cluster-on-azure-with-canonical-juju-quick-implement","status":"publish","type":"post","link":"https:\/\/blog.firatyasar.com\/?p=433","title":{"rendered":"Deploy MongoDB Cluster on Azure with Canonical Juju &#8211; Quick Implement"},"content":{"rendered":"\n<p><\/p>\n\n\n\n<p>Canonical&#8217;\u0131n CLI arac\u0131 olan ve Charmhub repository&#8217;sini kullanarak kolay \u015fekilde mongodb ve di\u011fer pop\u00fcler opensource ara\u00e7lar\u0131 deploy etmenizi sa\u011flayan bir ara\u00e7 olan juju ile kolayl\u0131kla mongodb cluster&#8217;\u0131 Azure \u00fczerine IaaS olarak nas\u0131l deploy edece\u011finizi g\u00f6steren komut seti s\u0131ral\u0131 olarak a\u015fa\u011f\u0131daki gibidir \ud83d\ude42<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/portworx.com\/wp-content\/uploads\/2023\/09\/Twitter-Social-Graphic-99.png\" alt=\"How to Run HA MongoDB on Microsoft AKS | Portworx\"\/><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code># List Clouds\njuju clouds --all\n \n# Update public Clouds\njuju update-public-clouds\n \n \n# Add Credentials\njuju add-credential azure\n \n\n# Add Juju Controller\njuju bootstrap azure azure-controller --credential frt-azure\n \n# add new juju models\njuju add-model mongodb\n \n# list models\njuju models\n \n# switch between models\njuju switch model\n \n# deploy mongodb\njuju deploy mongodb --channel 5\/stable\n \n# add additional mongodb nodes\njuju add-unit mongodb -n 2\n \n# Set operator user\nexport DB_USERNAME=\"operator\"\n \n# get mongo password\nexport DB_PASSWORD=$(juju run mongodb\/leader get-password| grep password|  awk '{print $2}')\n \n# get primary node ip\nexport HOST_IP=$(juju show-unit mongodb\/0 | grep  public-address | awk '{print $2}')\n \n# SSH primary node\njuju ssh mongodb\/0\n\n# set db name\nexport DB_NAME=\"admin\"\n \n# export replset name\nexport REPL_SET_NAME=\"mongodb\"\n \n# setup URI\nexport URI=mongodb:\/\/$DB_USERNAME:$DB_PASSWORD@$HOST_IP\/$DB_NAME?replicaSet=$REPL_SET_NAME\n \n# SSH to primary mongodb node\njuju ssh mongodb\/0\n \n# Connect via mongodb URI\ncharmed-mongodb.mongo &lt;URI>\n <\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Canonical&#8217;\u0131n CLI arac\u0131 olan ve Charmhub repository&#8217;sini kullanarak kolay \u015fekilde mongodb ve di\u011fer pop\u00fcler opensource ara\u00e7lar\u0131 deploy etmenizi sa\u011flayan bir ara\u00e7 olan juju ile kolayl\u0131kla mongodb cluster&#8217;\u0131 Azure \u00fczerine IaaS olarak nas\u0131l deploy edece\u011finizi g\u00f6steren komut seti s\u0131ral\u0131 olarak a\u015fa\u011f\u0131daki gibidir \ud83d\ude42<\/p>\n","protected":false},"author":1,"featured_media":434,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[184,183,133,182],"_links":{"self":[{"href":"https:\/\/blog.firatyasar.com\/index.php?rest_route=\/wp\/v2\/posts\/433"}],"collection":[{"href":"https:\/\/blog.firatyasar.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.firatyasar.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.firatyasar.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.firatyasar.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=433"}],"version-history":[{"count":1,"href":"https:\/\/blog.firatyasar.com\/index.php?rest_route=\/wp\/v2\/posts\/433\/revisions"}],"predecessor-version":[{"id":435,"href":"https:\/\/blog.firatyasar.com\/index.php?rest_route=\/wp\/v2\/posts\/433\/revisions\/435"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.firatyasar.com\/index.php?rest_route=\/wp\/v2\/media\/434"}],"wp:attachment":[{"href":"https:\/\/blog.firatyasar.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=433"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.firatyasar.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=433"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.firatyasar.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=433"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}