<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Purvesh Panchal</title>
    <description>The latest articles on DEV Community by Purvesh Panchal (@thepurveshpanchal).</description>
    <link>https://dev.to/thepurveshpanchal</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1104290%2Fee21ea24-a03f-4a57-90b6-e958122482b6.jpeg</url>
      <title>DEV Community: Purvesh Panchal</title>
      <link>https://dev.to/thepurveshpanchal</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/thepurveshpanchal"/>
    <language>en</language>
    <item>
      <title>Automated Deployments of Meteor.js bundle using Terraform</title>
      <dc:creator>Purvesh Panchal</dc:creator>
      <pubDate>Sun, 15 Dec 2024 16:44:15 +0000</pubDate>
      <link>https://dev.to/thepurveshpanchal/automated-deployments-of-meteorjs-bundle-using-terraform-1i3g</link>
      <guid>https://dev.to/thepurveshpanchal/automated-deployments-of-meteorjs-bundle-using-terraform-1i3g</guid>
      <description>&lt;h2&gt;
  
  
  Automating Deployment on EC2 Instance with Terraform and Docker
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;Hey buddy! Tech can be tricky, but you’ve got this. Think of this as a tech chat over coffee...or my personal favorite, chaay (tea).&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Let’s dive into how to automate deploying your Meteor.js project on AWS. By the end of this, you’ll feel like a cloud deployment ninja. Ready? Let’s go!&lt;/p&gt;

&lt;h3&gt;
  
  
  What You’ll Need
&lt;/h3&gt;

&lt;p&gt;Before we roll up our sleeves, let’s gather our stuffff. Here's the checklist:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;AWS Credentials&lt;/strong&gt;: Ensure you have the AWS CLI configured and ready to roll.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Terraform&lt;/strong&gt;: Download and install Terraform if you haven’t already.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;SSH Key Pair&lt;/strong&gt;: Generate an SSH key pair. Keep the private key handy to connect to your instance later.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Domain Name&lt;/strong&gt;: Got a domain? Great! Make sure you can update its A records.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Meteor Bundle&lt;/strong&gt;: Prep your Meteor.js project bundle using this command:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   meteor build &lt;span class="nt"&gt;--server-only&lt;/span&gt; &lt;span class="nt"&gt;--directory&lt;/span&gt; ~/path/to/Dockerfile
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Setup Scripts&lt;/strong&gt;: You’ll need three scripts to set up the server:&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://raw.githubusercontent.com/purvesh-alite/devops-notes/scripts/server-setup-part1.sh" rel="noopener noreferrer"&gt;&lt;code&gt;server-setup-part1.sh&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://raw.githubusercontent.com/purvesh-alite/devops-notes/scripts/mongodb4-setup.sh" rel="noopener noreferrer"&gt;&lt;code&gt;mongodb4-setup.sh&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://raw.githubusercontent.com/purvesh-alite/devops-notes/scripts/server-setup-part2.sh" rel="noopener noreferrer"&gt;&lt;code&gt;server-setup-part2.sh&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Got everything? Awesome! Let’s start building.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Game Plan
&lt;/h3&gt;

&lt;p&gt;Here’s the journey we’re about to go on:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Use Terraform to spin up an EC2 instance on AWS.&lt;/li&gt;
&lt;li&gt;Run some scripts to configure the server, install MongoDB, and deploy your Meteor.js app using Docker.&lt;/li&gt;
&lt;li&gt;Tweak your DNS settings to point your domain to the server’s IP.&lt;/li&gt;
&lt;li&gt;Finalize everything with SSL setup via Certbot.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Easy enough, right? Let’s break it down step by step.&lt;/p&gt;




&lt;h3&gt;
  
  
  Setting Up Terraform
&lt;/h3&gt;

&lt;p&gt;Start by organizing your Terraform project. Create a directory structure like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;project-directory/
├── main.tf
├── variables.tf
├── outputs.tf
├── run.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Step 1: Variables Configuration
&lt;/h4&gt;

&lt;p&gt;In &lt;code&gt;variables.tf&lt;/code&gt;, define all the variables we’ll need. These make the setup flexible:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight hcl"&gt;&lt;code&gt;&lt;span class="nx"&gt;variable&lt;/span&gt; &lt;span class="s2"&gt;"server_name"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;description&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"Server created by Terraform"&lt;/span&gt;
  &lt;span class="nx"&gt;type&lt;/span&gt;        &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;string&lt;/span&gt;
  &lt;span class="nx"&gt;default&lt;/span&gt;     &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"AutomatedDeployment"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;variable&lt;/span&gt; &lt;span class="s2"&gt;"key_pair_name"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;description&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"Key pair name"&lt;/span&gt;
  &lt;span class="nx"&gt;type&lt;/span&gt;        &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;string&lt;/span&gt;
  &lt;span class="nx"&gt;default&lt;/span&gt;     &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"tf-key-pair"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;variable&lt;/span&gt; &lt;span class="s2"&gt;"domain_name"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;description&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"Your domain name"&lt;/span&gt;
  &lt;span class="nx"&gt;type&lt;/span&gt;        &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;string&lt;/span&gt;
  &lt;span class="nx"&gt;default&lt;/span&gt;     &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"xyz.domain.com"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Step 2: The Heart — &lt;code&gt;main.tf&lt;/code&gt;
&lt;/h4&gt;

&lt;p&gt;Here’s where the magic happens. This file sets up everything: EC2 instance, security groups, and provisioning steps.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight hcl"&gt;&lt;code&gt;&lt;span class="nx"&gt;terraform&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;required_providers&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;aws&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;source&lt;/span&gt;  &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"hashicorp/aws"&lt;/span&gt;
      &lt;span class="nx"&gt;version&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"~&amp;gt; 4.16"&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="nx"&gt;required_version&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"&amp;gt;= 1.2.0"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;provider&lt;/span&gt; &lt;span class="s2"&gt;"aws"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;region&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"ca-central-1"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"aws_security_group"&lt;/span&gt; &lt;span class="s2"&gt;"tf-security-group"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;name&lt;/span&gt;        &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;var&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;server_name&lt;/span&gt;
  &lt;span class="nx"&gt;description&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"Security group for ${var.server_name}"&lt;/span&gt;

  &lt;span class="nx"&gt;ingress&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;from_port&lt;/span&gt;   &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;22&lt;/span&gt;
    &lt;span class="nx"&gt;to_port&lt;/span&gt;     &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;22&lt;/span&gt;
    &lt;span class="nx"&gt;protocol&lt;/span&gt;    &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"tcp"&lt;/span&gt;
    &lt;span class="nx"&gt;cidr_blocks&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"0.0.0.0/0"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="nx"&gt;ingress&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;from_port&lt;/span&gt;   &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;80&lt;/span&gt;
    &lt;span class="nx"&gt;to_port&lt;/span&gt;     &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;80&lt;/span&gt;
    &lt;span class="nx"&gt;protocol&lt;/span&gt;    &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"tcp"&lt;/span&gt;
    &lt;span class="nx"&gt;cidr_blocks&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"0.0.0.0/0"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="nx"&gt;ingress&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;from_port&lt;/span&gt;   &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;443&lt;/span&gt;
    &lt;span class="nx"&gt;to_port&lt;/span&gt;     &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;443&lt;/span&gt;
    &lt;span class="nx"&gt;protocol&lt;/span&gt;    &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"tcp"&lt;/span&gt;
    &lt;span class="nx"&gt;cidr_blocks&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"0.0.0.0/0"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="nx"&gt;egress&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;from_port&lt;/span&gt;   &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
    &lt;span class="nx"&gt;to_port&lt;/span&gt;     &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
    &lt;span class="nx"&gt;protocol&lt;/span&gt;    &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"-1"&lt;/span&gt;
    &lt;span class="nx"&gt;cidr_blocks&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"0.0.0.0/0"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"aws_instance"&lt;/span&gt; &lt;span class="s2"&gt;"tf-created-instance"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;ami&lt;/span&gt;           &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"ami-0083d3f8b2a6c7a81"&lt;/span&gt;
  &lt;span class="nx"&gt;instance_type&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"t2.micro"&lt;/span&gt;
  &lt;span class="nx"&gt;key_name&lt;/span&gt;      &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;var&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;key_pair_name&lt;/span&gt;
  &lt;span class="nx"&gt;tags&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;Name&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;var&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;server_name&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Step 3: Outputs
&lt;/h4&gt;

&lt;p&gt;Define what Terraform should output after running:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight hcl"&gt;&lt;code&gt;&lt;span class="nx"&gt;output&lt;/span&gt; &lt;span class="s2"&gt;"public_ip"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;value&lt;/span&gt;       &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;aws_instance&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;tf-created-instance&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;public_ip&lt;/span&gt;
  &lt;span class="nx"&gt;description&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"The public IP address of the instance"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Step 4: Automation Script
&lt;/h4&gt;

&lt;p&gt;In &lt;code&gt;run.sh&lt;/code&gt;, write a script to automate Terraform commands and handle DNS propagation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;#!/bin/bash&lt;/span&gt;
&lt;span class="nb"&gt;set&lt;/span&gt; &lt;span class="nt"&gt;-e&lt;/span&gt;
&lt;span class="nv"&gt;DOMAIN&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"your.domain.com"&lt;/span&gt;

terraform apply &lt;span class="nt"&gt;-auto-approve&lt;/span&gt;

&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Waiting for DNS propagation..."&lt;/span&gt;
&lt;span class="nv"&gt;OLD_IP&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;dig +short &lt;span class="nv"&gt;$DOMAIN&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;while &lt;/span&gt;&lt;span class="nb"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;do
  &lt;/span&gt;&lt;span class="nb"&gt;sleep &lt;/span&gt;10
  &lt;span class="nv"&gt;NEW_IP&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;dig +short &lt;span class="nv"&gt;$DOMAIN&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;
  &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$NEW_IP&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$OLD_IP&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;break
  echo&lt;/span&gt; &lt;span class="s2"&gt;"DNS records not updated yet. Retrying..."&lt;/span&gt;
&lt;span class="k"&gt;done

&lt;/span&gt;terraform apply &lt;span class="nt"&gt;-auto-approve&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Dockerfile for Meteor
&lt;/h3&gt;

&lt;p&gt;Here’s a sample Dockerfile to package your Meteor.js app:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight docker"&gt;&lt;code&gt;&lt;span class="k"&gt;FROM&lt;/span&gt;&lt;span class="s"&gt; node:14.21.3-alpine&lt;/span&gt;

&lt;span class="k"&gt;WORKDIR&lt;/span&gt;&lt;span class="s"&gt; /app&lt;/span&gt;
&lt;span class="k"&gt;COPY&lt;/span&gt;&lt;span class="s"&gt; bundle/ .&lt;/span&gt;
&lt;span class="k"&gt;EXPOSE&lt;/span&gt;&lt;span class="s"&gt; 3000&lt;/span&gt;

&lt;span class="k"&gt;ENV&lt;/span&gt;&lt;span class="s"&gt; PORT=3000 \&lt;/span&gt;
    ROOT_URL="http://localhost:3000" \
    MONGO_URL="&amp;lt;your-MongoDB-url&amp;gt;"

&lt;span class="k"&gt;WORKDIR&lt;/span&gt;&lt;span class="s"&gt; /app/programs/server&lt;/span&gt;
&lt;span class="k"&gt;RUN &lt;/span&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt;

&lt;span class="k"&gt;CMD&lt;/span&gt;&lt;span class="s"&gt; ["sh", "-c", "MONGO_URL=mongodb://user:password@${MONGO_HOST}:27017/wp node /app/main.js"]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Steps to Deploy
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Initialize Terraform&lt;/strong&gt;:
Run this command to set up Terraform:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   terraform init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Deploy with Automation&lt;/strong&gt;:
Run the script to deploy:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   ./run.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;DNS Update&lt;/strong&gt;:&lt;br&gt;
Update your domain’s A record to point to the EC2 instance’s public IP.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Verify&lt;/strong&gt;:&lt;br&gt;
Once DNS propagation is complete, verify your deployment by visiting the domain in a browser.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;




&lt;p&gt;And there you have it! A fully automated Meteor.js app deployment on AWS using Terraform and Docker. Remember, every challenge is just another opportunity to learn. If you hit a rock, take a sip of chaay and troubleshoot like the tech pro you are. Celebrate your deployment success and post it everywhere!😉&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>tutorial</category>
      <category>devops</category>
      <category>meteor</category>
    </item>
    <item>
      <title>How to Run Two MongoDB Instances on the Same Server (Standalone and Replica Set)</title>
      <dc:creator>Purvesh Panchal</dc:creator>
      <pubDate>Sat, 30 Nov 2024 15:04:35 +0000</pubDate>
      <link>https://dev.to/thepurveshpanchal/how-to-run-two-mongodb-instances-on-the-same-server-standalone-and-replica-set-m2n</link>
      <guid>https://dev.to/thepurveshpanchal/how-to-run-two-mongodb-instances-on-the-same-server-standalone-and-replica-set-m2n</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Hey buddy! Tech can be tricky, but you’ve got this. Think of this as a tech chat over coffee...or my personal favorite chaay(tea). Let’s get to it!&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If you're working with MongoDB, there might come a time when you need to run two MongoDB instances on the same server—one as a standalone instance and another as part of a replica set. This guide will walk you through setting up two MongoDB instances on different ports, using separate configurations, all on the same server. By the end of this tutorial, you'll have one standalone MongoDB instance and another configured as a replica set member.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Table of Contents&lt;/strong&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Introduction&lt;/li&gt;
&lt;li&gt;Prerequisites&lt;/li&gt;
&lt;li&gt;Step 1: Prepare Your Server for the Second MongoDB Instance&lt;/li&gt;
&lt;li&gt;Step 2: Configure MongoDB to Run Two Instances on Different Ports&lt;/li&gt;
&lt;li&gt;Step 3: Create Separate Configurations for the Second MongoDB Instance&lt;/li&gt;
&lt;li&gt;Step 4: Start the Second MongoDB Instance&lt;/li&gt;
&lt;li&gt;Step 5: Initialize the Replica Set&lt;/li&gt;
&lt;li&gt;Step 6: Verify and Connect to Both MongoDB Instances&lt;/li&gt;
&lt;li&gt;Conclusion&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Introduction&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Running multiple MongoDB instances on a single server can be useful for testing, staging environments, or setting up replica sets without additional hardware. But hey, it’s a little tricky! Don’t worry, though, we’ll go step-by-step and make sure everything runs smoothly. In this tutorial, you’ll learn how to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Set up one MongoDB instance as standalone.&lt;/li&gt;
&lt;li&gt;Set up a second MongoDB instance with a replica set.&lt;/li&gt;
&lt;li&gt;Run both instances on different ports.&lt;/li&gt;
&lt;li&gt;Manage data directories and log files for each instance.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Prerequisites&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Before starting, just a couple of things to make sure:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You have root or &lt;code&gt;sudo&lt;/code&gt; access to the server.&lt;/li&gt;
&lt;li&gt;MongoDB is already installed and running as a standalone instance on your server.&lt;/li&gt;
&lt;li&gt;You’ve got a basic understanding of MongoDB configuration and Linux commands.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Step 1: Prepare Your Server for the Second MongoDB Instance&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Since you already have one MongoDB instance running, you need separate directories for the second MongoDB instance to store its data and logs.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Create a Separate Data Directory&lt;/strong&gt;
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; /var/lib/mongodb-replicaset
&lt;span class="nb"&gt;sudo chown&lt;/span&gt; &lt;span class="nt"&gt;-R&lt;/span&gt; mongodb:mongodb /var/lib/mongodb-replicaset
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  &lt;strong&gt;Create a Separate Log Directory&lt;/strong&gt;
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; /var/log/mongodb-replicaset
&lt;span class="nb"&gt;sudo chown&lt;/span&gt; &lt;span class="nt"&gt;-R&lt;/span&gt; mongodb:mongodb /var/log/mongodb-replicaset
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  &lt;strong&gt;Step 2: Configure MongoDB to Run Two Instances on Different Ports&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Since MongoDB instances can’t share the same port, you'll want your standalone MongoDB running on the default port (&lt;code&gt;27017&lt;/code&gt;), and the second instance will run on a different port, like &lt;code&gt;27018&lt;/code&gt;.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Step 3: Create Separate Configurations for the Second MongoDB Instance&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Now, you’ll need a new &lt;code&gt;mongod.conf&lt;/code&gt; file for the second instance.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Copy the Default MongoDB Configuration File&lt;/strong&gt;
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo cp&lt;/span&gt; /etc/mongod.conf /etc/mongod-replicaset.conf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  &lt;strong&gt;Edit the Configuration for the Second Instance&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Open the new config file &lt;code&gt;/etc/mongod-replicaset.conf&lt;/code&gt; and tweak the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="c1"&gt;# mongod-replicaset.conf&lt;/span&gt;

&lt;span class="c1"&gt;# Where and how to store data.&lt;/span&gt;
&lt;span class="na"&gt;storage&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;dbPath&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;/var/lib/mongodb-replicaset&lt;/span&gt;
  &lt;span class="na"&gt;journal&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;enabled&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;

&lt;span class="c1"&gt;# Where to write logging data.&lt;/span&gt;
&lt;span class="na"&gt;systemLog&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;destination&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;file&lt;/span&gt;
  &lt;span class="na"&gt;logAppend&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
  &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;/var/log/mongodb-replicaset/mongod.log&lt;/span&gt;

&lt;span class="c1"&gt;# Network interfaces.&lt;/span&gt;
&lt;span class="na"&gt;net&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;port&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;27018&lt;/span&gt;  &lt;span class="c1"&gt;# Different port for the second instance&lt;/span&gt;
  &lt;span class="na"&gt;bindIp&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;0.0.0.0&lt;/span&gt;  &lt;span class="c1"&gt;# Listen on all IP addresses&lt;/span&gt;

&lt;span class="c1"&gt;# Enable replica set&lt;/span&gt;
&lt;span class="na"&gt;replication&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;replSetName&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;rs0&lt;/span&gt;  &lt;span class="c1"&gt;# Replica set name&lt;/span&gt;

&lt;span class="c1"&gt;# Enable security and authentication if required&lt;/span&gt;
&lt;span class="na"&gt;security&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;authorization&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;enabled&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This configuration makes sure the second MongoDB instance runs on port &lt;code&gt;27018&lt;/code&gt; and has its own directories for data and logs.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Step 4: Start the Second MongoDB Instance&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Now it’s time to get the second MongoDB instance up and running. You’ll want to create a separate service for it if you're using &lt;code&gt;systemd&lt;/code&gt;.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Copy the MongoDB Service File&lt;/strong&gt;
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo cp&lt;/span&gt; /lib/systemd/system/mongod.service /lib/systemd/system/mongod-replicaset.service
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  &lt;strong&gt;Edit the New Service File&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;In &lt;code&gt;/lib/systemd/system/mongod-replicaset.service&lt;/code&gt;, change the &lt;code&gt;ExecStart&lt;/code&gt; line to point to your new configuration file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ini"&gt;&lt;code&gt;&lt;span class="nn"&gt;[Service]&lt;/span&gt;
&lt;span class="py"&gt;ExecStart&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;/usr/bin/mongod --config /etc/mongod-replicaset.conf&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  &lt;strong&gt;Reload systemd and Start the Second MongoDB&lt;/strong&gt;
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl daemon-reload
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl start mongod-replicaset
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl &lt;span class="nb"&gt;enable &lt;/span&gt;mongod-replicaset
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, your second MongoDB instance should be up and running on port &lt;code&gt;27018&lt;/code&gt;.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Step 5: Initialize the Replica Set&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Once the second MongoDB instance is running, it's time to initialize the replica set.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Connect to the Second MongoDB Instance&lt;/strong&gt;
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;mongosh &lt;span class="nt"&gt;--port&lt;/span&gt; 27018
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  &lt;strong&gt;Run the Replica Set Initialization Command&lt;/strong&gt;
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;rs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;initiate&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can check the replica set status with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;rs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  &lt;strong&gt;Step 6: Verify and Connect to Both MongoDB Instances&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;You now have two MongoDB instances running on the same server.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Standalone Instance (Port 27017)&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;To connect to the standalone instance, run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;mongosh &lt;span class="nt"&gt;--port&lt;/span&gt; 27017
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  &lt;strong&gt;Replica Set Instance (Port 27018)&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;To connect to the replica set instance, run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;mongosh &lt;span class="nt"&gt;--port&lt;/span&gt; 27018
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  &lt;strong&gt;Conclusion&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;By following this guide, you've successfully set up two MongoDB instances on the same server—one as a standalone instance and the other as part of a replica set. You’ve also learned how to handle data and logs for each instance. &lt;/p&gt;

&lt;p&gt;This approach is perfect for testing or running multiple MongoDB instances without extra hardware. You’ve got it—time to flex those MongoDB skills!&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Frequently Asked Questions&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;1. Can I add more members to the replica set later?&lt;/strong&gt;&lt;br&gt;
Yes, you can add more members to your replica set by using the &lt;code&gt;rs.add()&lt;/code&gt; command.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. How can I secure the second MongoDB instance?&lt;/strong&gt;&lt;br&gt;
Make sure that both instances are secured with authentication, IP-based access control, and firewalls.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Can I run more than two MongoDB instances on the same server?&lt;/strong&gt;&lt;br&gt;
Yes, you can run additional MongoDB instances on the same server as long as they have separate ports, data directories, and configuration files.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. How do I stop the second MongoDB instance?&lt;/strong&gt;&lt;br&gt;
You can stop it by running:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl stop mongod-replicaset
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That’s all, my friend! You’ve optimally used your server resources and got a great setup to manage different environments with MongoDB.&lt;/p&gt;




</description>
    </item>
    <item>
      <title>MySQL Mayhem: How to Reset Your Root Password for MySQL in No Time!</title>
      <dc:creator>Purvesh Panchal</dc:creator>
      <pubDate>Thu, 05 Sep 2024 17:50:26 +0000</pubDate>
      <link>https://dev.to/thepurveshpanchal/mysql-mayhem-how-to-reset-your-root-password-for-mysql-in-no-time-2nla</link>
      <guid>https://dev.to/thepurveshpanchal/mysql-mayhem-how-to-reset-your-root-password-for-mysql-in-no-time-2nla</guid>
      <description>

&lt;p&gt;Hey there, fellow MySQL wrangler! Ever been locked out of your MySQL database because the root password decided to pull a vanishing act? Or maybe it’s just not playing nice? Don’t sweat it! you’re in good company. This happens to pretty much everyone at some point. The good news? It’s an easy fix!&lt;/p&gt;

&lt;p&gt;By the time we’re done here, you’ll be resetting that pesky root password like a seasoned pro. No more pulling your hair out — just pure MySQL mastery.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Knock, Knock! Getting Into MySQL as Root
&lt;/h3&gt;

&lt;p&gt;First thing’s first, let’s get through the front door. Fire up your terminal and hit MySQL as the root user with this command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;mysql &lt;span class="nt"&gt;-u&lt;/span&gt; root
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Boom! You’re in! (Hopefully... 😬 If not, we’ll save that mess for another day.) But let’s assume we’re in—because we're optimistic like that.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Let’s Spy on the Authentication Setup
&lt;/h3&gt;

&lt;p&gt;Now that you’ve got your foot in the door, it’s time to see how MySQL is handling the root user’s login. We need to know what authentication method is being used. Just run this command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="k"&gt;User&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;Host&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;plugin&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;mysql&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;user&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will spit out some handy details—who’s logging in, from where, and, most importantly, how. It’s like a little behind-the-scenes peek at the database’s security setup. Now, based on that, we’ll choose the right path forward. Ready?&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: The Password Fix—Choose Your Adventure!
&lt;/h3&gt;

&lt;p&gt;Alright, now the fun begins. Depending on the authentication method you found in Step 2, here are a few different ways you can reset the root password.&lt;/p&gt;

&lt;h4&gt;
  
  
  Option 1: Old-School Password Authentication
&lt;/h4&gt;

&lt;p&gt;If you see &lt;strong&gt;&lt;code&gt;mysql_native_password&lt;/code&gt;&lt;/strong&gt; listed as the plugin, or if you just want to stick with the classic method of login, this is the command for you:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;UPDATE&lt;/span&gt; &lt;span class="n"&gt;mysql&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;user&lt;/span&gt; &lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="n"&gt;Password&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;PASSWORD&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'your_new_password'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="k"&gt;User&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'root'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;FLUSH&lt;/span&gt; &lt;span class="k"&gt;PRIVILEGES&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Just like that, new password in place! (And don't forget to make it something you’ll actually remember this time... or use a password manager—seriously.)&lt;/p&gt;

&lt;h4&gt;
  
  
  Option 2: Welcome to the Future with &lt;code&gt;caching_sha2_password&lt;/code&gt;
&lt;/h4&gt;

&lt;p&gt;If you’re rolling with MySQL 8.0+ (or just like keeping things secure), your root user might be using &lt;strong&gt;&lt;code&gt;caching_sha2_password&lt;/code&gt;&lt;/strong&gt;. Here’s how to reset the password with the new-age encryption:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;ALTER&lt;/span&gt; &lt;span class="k"&gt;USER&lt;/span&gt; &lt;span class="s1"&gt;'root'&lt;/span&gt;&lt;span class="o"&gt;@&lt;/span&gt;&lt;span class="s1"&gt;'localhost'&lt;/span&gt; &lt;span class="n"&gt;IDENTIFIED&lt;/span&gt; &lt;span class="k"&gt;WITH&lt;/span&gt; &lt;span class="n"&gt;caching_sha2_password&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="s1"&gt;'your_new_password'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;FLUSH&lt;/span&gt; &lt;span class="k"&gt;PRIVILEGES&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Nice, right? Fancy encryption, modern security—everything you need to keep hackers and snoops at bay.&lt;/p&gt;

&lt;h4&gt;
  
  
  Option 3: A Blast from the Past—Switching Back to &lt;code&gt;mysql_native_password&lt;/code&gt;
&lt;/h4&gt;

&lt;p&gt;If, for some reason, you need to revert back to the old-school method (maybe an app you’re using requires it), you can switch the root user back to &lt;strong&gt;&lt;code&gt;mysql_native_password&lt;/code&gt;&lt;/strong&gt; with this command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;ALTER&lt;/span&gt; &lt;span class="k"&gt;USER&lt;/span&gt; &lt;span class="s1"&gt;'root'&lt;/span&gt;&lt;span class="o"&gt;@&lt;/span&gt;&lt;span class="s1"&gt;'localhost'&lt;/span&gt; &lt;span class="n"&gt;IDENTIFIED&lt;/span&gt; &lt;span class="k"&gt;WITH&lt;/span&gt; &lt;span class="n"&gt;mysql_native_password&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="s1"&gt;'your_new_password'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;FLUSH&lt;/span&gt; &lt;span class="k"&gt;PRIVILEGES&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Nothing wrong with a little nostalgia, right? Sometimes the old ways still work best!&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 4: Make Sure MySQL Actually Listens (Apply the Changes)
&lt;/h3&gt;

&lt;p&gt;Now, after you’ve run the right command to reset the password, don’t forget to lock it in! Run this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="n"&gt;FLUSH&lt;/span&gt; &lt;span class="k"&gt;PRIVILEGES&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This makes sure that MySQL actually takes those changes seriously and updates its privileges. It’s like telling MySQL, "Hey, pay attention!"&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 5: Exit Stage Left
&lt;/h3&gt;

&lt;p&gt;You’ve done the hard work—now it’s time to exit the MySQL shell. Just type:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="n"&gt;exit&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And you’re outta there. How smooth was that?&lt;/p&gt;

&lt;h3&gt;
  
  
  Final Thoughts
&lt;/h3&gt;

&lt;p&gt;Congrats! You’ve just wrestled MySQL into submission and reset that elusive root password. Next time, maybe note the password down somewhere safe... or, you know, use a password manager! 😏&lt;/p&gt;

&lt;h3&gt;
  
  
  Troubleshooting Tips: When MySQL Still Plays Hard to Get
&lt;/h3&gt;

&lt;p&gt;Okay, so you’ve followed the steps, and MySQL’s still giving you the cold shoulder? Don’t panic! Here’s a little trick up your sleeve.&lt;/p&gt;

&lt;h4&gt;
  
  
  Problem: &lt;strong&gt;“Access Denied” Errors?&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Sometimes, MySQL can act stubborn when you’re trying to log in, even after resetting the password. If you’re getting an &lt;strong&gt;“Access Denied”&lt;/strong&gt; error, you may need to restart MySQL in safe mode.&lt;/p&gt;

&lt;p&gt;Here’s what to do:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Stop the MySQL service&lt;/strong&gt; by running this command in your terminal:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl stop mysql
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Restart MySQL in safe mode&lt;/strong&gt; with the &lt;code&gt;--skip-grant-tables&lt;/code&gt; option, which lets you bypass the normal login process:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;sudo &lt;/span&gt;mysqld_safe &lt;span class="nt"&gt;--skip-grant-tables&lt;/span&gt; &amp;amp;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Log in to MySQL&lt;/strong&gt; without a password:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   mysql &lt;span class="nt"&gt;-u&lt;/span&gt; root
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Reset the password&lt;/strong&gt; using the same commands from earlier, depending on your authentication method.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Exit MySQL&lt;/strong&gt;, and restart the service normally:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl start mysql
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, try logging in again with your new password. It should work like a charm!&lt;/p&gt;

&lt;p&gt;Now go forth and manage your databases like the MySQL genius you are! 🎉&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Step-by-Step Guide to Secure Elasticsearch with SSL Certs and Authentication</title>
      <dc:creator>Purvesh Panchal</dc:creator>
      <pubDate>Fri, 23 Aug 2024 19:20:58 +0000</pubDate>
      <link>https://dev.to/thepurveshpanchal/step-by-step-guide-to-secure-elasticsearch-with-ssl-certs-and-authentication-pei</link>
      <guid>https://dev.to/thepurveshpanchal/step-by-step-guide-to-secure-elasticsearch-with-ssl-certs-and-authentication-pei</guid>
      <description>&lt;h1&gt;
  
  
  This detailed article will show you how to secure Elasticsearch on Ubuntu 20.04 using X-Pack and SSL/TLS encryption.
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Step 1:&lt;/strong&gt; Install your desired version of Elasticsearch&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.15.0-amd64.deb
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.15.0-amd64.deb.sha512
shasum &lt;span class="nt"&gt;-a&lt;/span&gt; 512 &lt;span class="nt"&gt;-c&lt;/span&gt; elasticsearch-8.15.0-amd64.deb.sha512 
&lt;span class="nb"&gt;sudo &lt;/span&gt;dpkg &lt;span class="nt"&gt;-i&lt;/span&gt; elasticsearch-8.15.0-amd64.deb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 2:&lt;/strong&gt; Enable X-Pack security&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;nano /etc/elasticsearch/elasticsearch.yml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Open the Elasticsearch configuration file for editing.&lt;/li&gt;
&lt;li&gt;Uncomment the line &lt;code&gt;xpack.security.enabled: true&lt;/code&gt; by removing the &lt;code&gt;#&lt;/code&gt; at the beginning.&lt;/li&gt;
&lt;li&gt;Save the changes and exit the text editor.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Step 3:&lt;/strong&gt; Generate SSL certificates&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo mkdir&lt;/span&gt; /etc/elasticsearch/certs
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;openssl
&lt;span class="nb"&gt;sudo &lt;/span&gt;openssl req &lt;span class="nt"&gt;-x509&lt;/span&gt; &lt;span class="nt"&gt;-out&lt;/span&gt; /etc/elasticsearch/certs/elastic1.crt &lt;span class="nt"&gt;-keyout&lt;/span&gt; /etc/elasticsearch/certs/elastic1.key &lt;span class="nt"&gt;-newkey&lt;/span&gt; rsa:2048 &lt;span class="nt"&gt;-nodes&lt;/span&gt; &lt;span class="nt"&gt;-sha256&lt;/span&gt; &lt;span class="nt"&gt;-subj&lt;/span&gt; &lt;span class="s2"&gt;"/C=US/ST=State/L=Location/O=Organization/OU=Organizational Unit/CN=localhost"&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;openssl pkcs12 &lt;span class="nt"&gt;-export&lt;/span&gt; &lt;span class="nt"&gt;-in&lt;/span&gt; /etc/elasticsearch/certs/elastic1.crt &lt;span class="nt"&gt;-inkey&lt;/span&gt; /etc/elasticsearch/certs/elastic1.key &lt;span class="nt"&gt;-out&lt;/span&gt; /etc/elasticsearch/certs/elastic1.p12 &lt;span class="nt"&gt;-name&lt;/span&gt; &lt;span class="s2"&gt;"elasticsearch-cert"&lt;/span&gt;
&lt;span class="nb"&gt;sudo chown&lt;/span&gt; &lt;span class="nt"&gt;-R&lt;/span&gt; elasticsearch:elasticsearch /etc/elasticsearch/certs
&lt;span class="nb"&gt;sudo chmod &lt;/span&gt;0400 /etc/elasticsearch/certs/&lt;span class="k"&gt;*&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;This step generates a self-signed SSL certificate using OpenSSL and converts it to PKCS#12 format.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Step 4:&lt;/strong&gt; Configure SSL settings&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;nano /etc/elasticsearch/elasticsearch.yml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Open the Elasticsearch configuration file for editing.&lt;/li&gt;
&lt;li&gt;Add the following lines at the end of the file to configure SSL settings:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="nx"&gt;xpack&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;security&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;transport&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ssl&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;enabled&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;span class="nx"&gt;xpack&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;security&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;transport&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ssl&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;keystore&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;etc&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;elasticsearch&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;certs&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;elastic1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;p12&lt;/span&gt;
&lt;span class="nx"&gt;xpack&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;security&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;transport&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ssl&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;truststore&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;etc&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;elasticsearch&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;certs&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;elastic1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;p12&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Save the changes and exit the text editor.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Step 5:&lt;/strong&gt; Restart Elasticsearch&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl restart elasticsearch
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;This step restarts Elasticsearch to apply the configuration changes.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Step 6:&lt;/strong&gt; Verify SSL/TLS encryption&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;--cacert&lt;/span&gt; /etc/elasticsearch/certs/elastic1.p12 https://localhost:9200
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;This command tests the SSL/TLS connection using &lt;code&gt;curl&lt;/code&gt; to verify that the SSL/TLS encryption is working properly.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Step 7:&lt;/strong&gt; Configure user authentication and roles&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo /usr/share/elasticsearch/bin/elasticsearch-setup-passwords auto
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;This step sets the password for the built-in &lt;code&gt;elastic&lt;/code&gt; user. Make sure to save the generated password.&lt;/li&gt;
&lt;li&gt;Configure additional users and roles as needed using the &lt;code&gt;elasticsearch-users&lt;/code&gt; command.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Step 8:&lt;/strong&gt; Update firewall rules&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If you have a firewall enabled, allow incoming connections to the Elasticsearch port (default: 9200) and SSL/TLS port (default: 9300) to ensure external access.&lt;/li&gt;
&lt;li&gt;For example, using &lt;code&gt;ufw&lt;/code&gt; firewall:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;ufw allow 9200/tcp
&lt;span class="nb"&gt;sudo &lt;/span&gt;ufw allow 9300/tcp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Adjust the commands based on your specific firewall configuration.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By following these steps, you should be able to secure Elasticsearch using X-Pack with SSL/TLS encryption on Ubuntu 20.04. Remember to adjust any file paths or configurations according to your specific requirements.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How to Configure a 3-Node MongoDB 6 Replica Set: Tested Step-by-Step Guide</title>
      <dc:creator>Purvesh Panchal</dc:creator>
      <pubDate>Sat, 10 Aug 2024 15:53:11 +0000</pubDate>
      <link>https://dev.to/thepurveshpanchal/how-to-configure-a-3-node-mongodb-6-replica-set-tested-step-by-step-guide-5a30</link>
      <guid>https://dev.to/thepurveshpanchal/how-to-configure-a-3-node-mongodb-6-replica-set-tested-step-by-step-guide-5a30</guid>
      <description>&lt;h1&gt;
  
  
  Prerequisites
&lt;/h1&gt;

&lt;p&gt;Before setting up the MongoDB 6.0.10 replica set, ensure you have completed the following prerequisites:&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Install MongoDB 6.0.10
&lt;/h3&gt;

&lt;p&gt;Install MongoDB 6.0.10 using the provided script:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Install required packages&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt-get &lt;span class="nb"&gt;install &lt;/span&gt;gnupg curl &lt;span class="nt"&gt;-y&lt;/span&gt;

&lt;span class="c"&gt;# Import the MongoDB public GPG Key&lt;/span&gt;
curl &lt;span class="nt"&gt;-fsSL&lt;/span&gt; &amp;lt;https://pgp.mongodb.com/server-6.0.asc&amp;gt; | &lt;span class="se"&gt;\\&lt;/span&gt;
   &lt;span class="nb"&gt;sudo &lt;/span&gt;gpg &lt;span class="nt"&gt;-o&lt;/span&gt; /usr/share/keyrings/mongodb-server-6.0.gpg &lt;span class="se"&gt;\\&lt;/span&gt;
   &lt;span class="nt"&gt;--dearmor&lt;/span&gt;

&lt;span class="c"&gt;# Create a list file for MongoDB&lt;/span&gt;
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-6.0.gpg ] &amp;lt;https://repo.mongodb.org/apt/ubuntu&amp;gt; jammy/mongodb-org/6.0 multiverse"&lt;/span&gt; | &lt;span class="nb"&gt;sudo tee&lt;/span&gt; /etc/apt/sources.list.d/mongodb-org-6.0.list

&lt;span class="c"&gt;# Update package list and install MongoDB&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt-get update
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt-get &lt;span class="nb"&gt;install &lt;/span&gt;mongodb-org &lt;span class="nt"&gt;-y&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 2: Add Hosts and Configure Server Hostnames
&lt;/h3&gt;

&lt;p&gt;Add the hostnames and IP addresses of all three servers to the &lt;code&gt;/etc/hosts&lt;/code&gt; file on each server. Use this example as a reference:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;192.168.1.21 primary.mongo
192.168.1.22 secondary1.mongo
192.168.1.23 secondary2.mongo

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 3: Test Hostname Resolution
&lt;/h3&gt;

&lt;p&gt;Ping each server from every other server using their hostnames to verify hostname resolution. &lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ping primary.mongo
ping secondary1.mongo
ping secondary2.mongo

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 4: Create Admin User (If Not Enabled)
&lt;/h3&gt;

&lt;p&gt;If you didn't enable authentication during MongoDB installation, create an admin user. &lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Connect to MongoDB using the MongoDB shell&lt;/span&gt;
mongosh &lt;span class="nt"&gt;--host&lt;/span&gt; &amp;lt;Hostname or IP of each&amp;gt;:27017

&lt;span class="c"&gt;# Switch to the admin database&lt;/span&gt;
use admin

&lt;span class="c"&gt;# Create an admin user with appropriate roles&lt;/span&gt;
db.createUser&lt;span class="o"&gt;({&lt;/span&gt;
    user: &lt;span class="s2"&gt;"admin"&lt;/span&gt;,
    &lt;span class="nb"&gt;pwd&lt;/span&gt;: &lt;span class="s2"&gt;"your_password"&lt;/span&gt;,
    roles: &lt;span class="o"&gt;[&lt;/span&gt;
        &lt;span class="s2"&gt;"userAdminAnyDatabase"&lt;/span&gt;,
        &lt;span class="s2"&gt;"dbAdminAnyDatabase"&lt;/span&gt;,
        &lt;span class="s2"&gt;"readWriteAnyDatabase"&lt;/span&gt;,
        &lt;span class="s2"&gt;"root"&lt;/span&gt;
    &lt;span class="o"&gt;]&lt;/span&gt;
&lt;span class="o"&gt;})&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace &lt;code&gt;"your_password"&lt;/code&gt; with a secure password for the admin user.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 5: Enable Security with Keyfile
&lt;/h3&gt;

&lt;p&gt;Generate a key and store it at &lt;code&gt;/etc/mongodb/keys/mongo-key&lt;/code&gt;,&lt;br&gt;
Just copy &amp;amp; paste the below command on all three servers:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;openssl rand &lt;span class="nt"&gt;-base64&lt;/span&gt; 756 &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; /etc/mongodb/keys/mongo-key
&lt;span class="nb"&gt;sudo chmod &lt;/span&gt;600 /etc/mongodb/keys/mongo-key

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 6: Restart MongoDB and Check Status
&lt;/h3&gt;

&lt;p&gt;Restart MongoDB on all servers and check the status:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;service mongod restart
&lt;span class="nb"&gt;sudo &lt;/span&gt;service mongod status

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 7: Test Connectivity (Optional)
&lt;/h3&gt;

&lt;p&gt;Log in to MongoDB and check if it's working:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;mongosh &lt;span class="nt"&gt;-u&lt;/span&gt; &lt;span class="s2"&gt;"admin_username"&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Let's begin with ReplicaSet Configuration
&lt;/h1&gt;

&lt;p&gt;Now proceed with the main setup steps:&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Update MongoDB Configuration Files
&lt;/h3&gt;

&lt;p&gt;On each server, update the MongoDB configuration file &lt;code&gt;/etc/mongod.conf&lt;/code&gt; with the provided example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;storage:
  dbPath: /opt/mongodb

systemLog:
  destination: file
  logAppend: &lt;span class="nb"&gt;true
  &lt;/span&gt;path: /var/log/mongodb/mongod.log

net:
  port: 27017
  bindIp: 0.0.0.0

processManagement:
  timeZoneInfo: /usr/share/zoneinfo
  fork: &lt;span class="nb"&gt;true

&lt;/span&gt;security:
  authorization: enabled
  keyFile: /etc/mongodb/keys/mongo-key
  transitionToAuth: &lt;span class="nb"&gt;true

&lt;/span&gt;replication:
  replSetName: rs111

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 2: Start MongoDB on Each Server
&lt;/h3&gt;

&lt;p&gt;Start MongoDB on each server using the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;service mongod start
&lt;span class="nb"&gt;sudo &lt;/span&gt;service mongod status

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 3: Connect to Primary's Mongo Shell (mongosh or mongo)
&lt;/h3&gt;

&lt;p&gt;Connect to one of the MongoDB servers using the MongoDB shell (&lt;code&gt;mongosh&lt;/code&gt;). &lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;mongosh &lt;span class="nt"&gt;--host&lt;/span&gt; server_ip:27017

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace &lt;code&gt;server_ip&lt;/code&gt; with the IP address of the server you want to connect to.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 4: Initialize the Replica Set
&lt;/h3&gt;

&lt;p&gt;Inside the MongoDB shell, initialize the replica set with the chosen name (&lt;code&gt;rs111&lt;/code&gt;). Run this command on the server you want as the primary. &lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="nx"&gt;rs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;initiate&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;rs111&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;members&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;host&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;primary.mongo:27017&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;host&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;secondary1.mongo:27017&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;host&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;secondary2.mongo:27017&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace &lt;code&gt;primary_hostname&lt;/code&gt;, &lt;code&gt;secondary1_hostname&lt;/code&gt;, and &lt;code&gt;secondary2_hostname&lt;/code&gt; with the hostnames of your servers. The primary should be the server where you run this command.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 5: Verify Replica Set Status
&lt;/h3&gt;

&lt;p&gt;Verify the status of the replica set by running the following command in the MongoDB shell:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="nx"&gt;rs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To check the status of replicaSet&lt;/p&gt;

&lt;h1&gt;
  
  
  Troubleshooting Common Issues &amp;amp; Notes
&lt;/h1&gt;

&lt;h3&gt;
  
  
  Issue 1: "no reachable/healthy members" or "STARTUP" state
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt; If you encounter these issues, it means that one or more replica set members are not reachable or are still in the startup process. Check network connectivity, MongoDB status, and logs.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;less /var/log/mongodb/mongod.log
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt; Check /etc/hosts in each server, are all three hostnames added and are they using correct IP Addresses.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;192.168.1.21 primary.mongo
192.168.1.22 secondary1.mongo
192.168.1.23 secondary2.mongo
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt; If nothing works reconfigure replicaSet using correct IP Addresses.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;Connect to the primary node of your replica set using the &lt;code&gt;mongo&lt;/code&gt; shell:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;       mongo --host primary_ip:27017
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace &lt;code&gt;primary_ip&lt;/code&gt; with the IP address of your primary node.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;In the &lt;code&gt;mongo&lt;/code&gt; shell, execute the following command to obtain the current replica set configuration:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;        var cfg = rs.conf()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command stores the current replica set configuration in the &lt;code&gt;cfg&lt;/code&gt; variable.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Edit the &lt;code&gt;cfg&lt;/code&gt; variable to update the hostnames with their respective IP addresses. You will need to modify the &lt;code&gt;host&lt;/code&gt; field for each member in the configuration. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;        cfg.members[0].host = "192.168.1.21:27017";
        cfg.members[1].host = "192.168.1.22:27017";
        cfg.members[2].host = "192.168.1.23:27017";
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace &lt;code&gt;primary_ip&lt;/code&gt;, &lt;code&gt;secondary1_ip&lt;/code&gt;, and &lt;code&gt;secondary2_ip&lt;/code&gt; with the actual IP addresses and port numbers for your servers.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;After making the necessary changes, reconfigure the replica set using the updated &lt;code&gt;cfg&lt;/code&gt; variable:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;        rs.reconfig(cfg)     
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command will apply the modified configuration to the replica set.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;To ensure that the changes are applied successfully, you can check the replica set status using:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;        rs.status()

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Verify that the hostnames have been updated with the correct IP addresses in the replica set configuration.&lt;/p&gt;

&lt;p&gt;Make sure to execute these commands carefully and replace the placeholders with your actual server IP addresses and port numbers.&lt;/p&gt;

&lt;h3&gt;
  
  
  Issue 2: Authentication Errors
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Solution:&lt;/strong&gt; If you encounter authentication errors, ensure valid credentials are provided when connecting to MongoDB. Verify user privileges, or check if you’ve created an admin user in secondary servers.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Additional Notes:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Use &lt;code&gt;0.0.0.0&lt;/code&gt; for &lt;code&gt;bindIp&lt;/code&gt; only if you've enabled authentication by adding an admin user in the admin database of all MongoDB instances.&lt;/li&gt;
&lt;li&gt;You can change default “dbPath: /var/lib/mongodb” or choose a different path like “dbPath: /opt/mongodb” in mongod.conf file.&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>Attended Community Meetup by Infinity AI</title>
      <dc:creator>Purvesh Panchal</dc:creator>
      <pubDate>Sun, 25 Jun 2023 15:27:45 +0000</pubDate>
      <link>https://dev.to/thepurveshpanchal/attended-community-meetup-by-infinity-ai-4a90</link>
      <guid>https://dev.to/thepurveshpanchal/attended-community-meetup-by-infinity-ai-4a90</guid>
      <description>&lt;p&gt;Yesterday, I did something I hadn't done in a long time: I attended a community event! And I'm happy that I did. It was "Community Meetup" by Infinity AI(Learn and grow together) , that provided a great overview of the field of AI and ML.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F15slq029ggbyrc55yxzb.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F15slq029ggbyrc55yxzb.jpg" alt="Image description" width="800" height="600"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Mr. Bhargav Patel  was the first speaker to provide his thoughts on AI-ML, LLMs, and MLOps.  As a DevOps Engineer, I knew I had to put everything I had learned to use. That was just the start!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9docge1hsxet2ud8k36d.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9docge1hsxet2ud8k36d.jpg" alt="Image description" width="800" height="600"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But the learning didn't stop there! Mr. Preyan Mehta  Mehta, the second speaker, gave us with insights into the world of Generative AI and Democratically Smart People. It was fascinating to see how AI can help us improve our workflows and optimise processes in this ever-changing world of tech!&lt;/p&gt;

&lt;p&gt;But the highlight of the event was the AI-ML quiz. Out of 53 participants, I came in first place and received this adorable little plant as a prize. 🏆🪴&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz69y0rrm5vcabdgvohfz.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz69y0rrm5vcabdgvohfz.jpg" alt="Image description" width="800" height="1066"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;All in all, it was an incredible experience that left me feeling inspired and motivated to continue learning and growing in the field of AI &amp;amp; ML. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1i3r7991rf4bsfgawrpc.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1i3r7991rf4bsfgawrpc.jpg" alt="Image description" width="800" height="600"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;However, the best part of the event was connecting with other members of the community and learning about upcoming events. It's always great to network with like-minded individuals and share ideas and experiences.&lt;/p&gt;




&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Attended the "Community Meetup" event by Infinity AI(Learn and grow together) &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Bhargav Patel  spoke about AI-ML, LLMs, and MLOps&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Preyan Mehta  Mehta shared insights on Generative AI and Democratically Smart People&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Won first place in the AI-ML quiz and received a cute plant as a prize&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Left feeling inspired and motivated to continue my learning in AI&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Interested in hearing about others' impactful community event experiences&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Have you attended any community events lately that have left a lasting impact on you? Let's start a discussion in the comments below! #InfinityAI #AI #ML #GenerativeAI #CommunityEvents #Networking #DevOps #MLOps #Learning&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>devjournal</category>
      <category>ai</category>
      <category>techtalks</category>
    </item>
  </channel>
</rss>
