Skip to content

weyseing/typesense

Repository files navigation

Setup

  • Copy .env.exmple to .env.
  • Set ENV value below
    • TYPESENSE_ENDPOINT: This is localhost:8108 for local and LB IP for prod.
  • Up the container with docker compose up -d

ECR Setup

  • Create ECR repository.

image

  • Build & upload to ECR
    • Ensure env below are set .env
      • AWS_ACCOUNT_ID
      • AWS_REGION
      • AWS_ACCESS_KEY_ID
      • AWS_SECRET_ACCESS_KEY
      • AWS_ECR
    • Run cli/deploy_ecr.sh

ECS Setup

  • Create ECS cluster

image

  • Create Task Definition

image image image

  • Create ECS Service

image image

EXEC into ECS Task

  • Create Task Role
    • **MUST** add AmazonSSMManagedInstanceCore policy

image image image

  • Update Task Role in Task Definition

image

  • **MUST** redeploy new ECS Task (via new Task Definition) to reflect Task Role

image

  • Ensure variable below are set in cli/ecs_set_exec.sh

    • REGION
    • CLUSTER_ARN
    • SERVICE_ARN
  • Run cli/ecs_set_exec.sh to turn ON EXEC Settings

image

  • Check EXEC Settings is ON.

image

  • **MUST** redeploy new ECS Task (via Force New Deploy) to reflect EXEC Settings

image

  • Ensure variable below are set in cli/ecs_ssh.sh to enter ECS Task.

    • REGION
    • CLUSTER_ARN
  • Run cli/ecs_ssh.sh <YOUR TASK ID>

image

ALB Setup

  • Create Target Group

image image image

  • Create ALB

image image image image

  • Update ECS

image image image

  • Wait Target to be spinned up

image

  • Test via LB DNS

image image

EFS Setup

  • Create File System

image image

  • Create Access Point

image image image

  • Security Group inbound & outbound
    • EFS security group: Allow port 2049 in Inbound
    • ECS security group: Allow port 2049 in Outbound

image

  • Add IAM Policy to Task Role

image image

  • Set EFS Volume in ECS Task Definition

image image image

  • Deploy NEW ECS task

Check EFS Folder (via EC2)

  • Create EC2 instance

image image image image

  • **MUST** allow PORT 2049 in Security Group

  • Change SSH key permission

    • sudo chmod 400 ssh-key-2.pem
  • SSH inside to EC2

    • ssh -i "ssh-key-2.pem" admin@ec2-13-215-156-78.ap-southeast-1.compute.amazonaws.com
  • Setup amazon-efs-utils

    • Install dependencies

      sudo apt-get update
      sudo apt-get install -y git make libssl-dev build-essential curl pkg-config nfs-common stunnel4
    • Install Rush & Cargo

      curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
      source "$HOME/.cargo/env"
    • Install amazon-efs-utils

      cd ~
      git clone https://github.com/aws/efs-utils.git
      cd efs-utils
      ./build-deb.sh
      ls -l ./build/ # Find the exact .deb filename
      sudo dpkg -i ./build/amazon-efs-utils-<YOUR_VERSION>_amd64.deb # Use the exact filename found
      sudo apt-get install -f
  • Mount to EFS

    sudo mount -t efs -o tls <YOUR EFS ID>:/ <YOUR MOUNT PATH>
    sudo mount -t efs -o tls fs-*****************:/ /mnt/efs
  • Check EFS ID & mount path

    ps aux | grep -i stunnel | grep -i <YOUR EFS ID> --color=auto
    ps aux | grep -i stunnel | grep -i fs-************ --color=auto
    

image

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published