#community-help

Setting Up High Availability Cluster in AWS

TLDR Retheesh needed help setting up a high availability cluster in AWS. Jason recommended using EC2 instances and provided instructions for setting up typesense nodes.

Powered by Struct AI

1

5
3mo
Solved
Join the chat
Jul 09, 2023 (3 months ago)
Retheesh
Photo of md5-3c1b7e848008a98cc6f79755c7826ffa
Retheesh
06:36 PM
Hi Team, I am trying a poc for my organization. I want some help.
Is there any guidance or example available for setting up a high availability cluster in AWS?
I understand from the high availability documentation we need to provide the node IP addresses and peer ports as part of configuration
• I was checking if this is possible in ECS, but seems its not easy as the tasks cannot communicate each other in ECS (dynamic ips in ENI, not sure bridge network might help across hosts).
• Another work around may be create multiple services in ECS with single task and using service discovery and which seems not clean any may become costly
• The only other option I am seeing is individually provision ec2 instances and manually configure each ec2 instances for cluster. Also may be setup a docker swarm using same instances
Can anyone advise here. Is there some simpler or recommended way? Is there also some AWS AMIs available to easily spawn up an ec2 typesense node with necessary configurations?
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
08:00 PM
Typesense requires both persistent disk and an uninterrupted long-running process, since it is an in-memory datastore. ECS I don’t think offers either.

So the best way to deploy Typesense on AWS IMO would be to just use EC2 instances
08:01
Jason
08:01 PM
There’s no official AMI, but the deb / rpm packages should set things up for you with just a simple installation command: https://typesense.org/docs/guide/install-typesense.html#deb-package-on-ubuntu-debian
Jul 10, 2023 (3 months ago)
Retheesh
Photo of md5-3c1b7e848008a98cc6f79755c7826ffa
Retheesh
07:41 AM
Thank you Jason for the reply. I believed in ECS if we use ec2 launch type we can have EFS as persistent disk, but anyway I am not finding a clean way to maintain the connection between the ecs tasks to form a cluster.
Also one more doubt like how much time it takes to reload all the index to in memory from the drive if we restart typesense any time.

1

Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
04:22 PM
Re-indexing time at startup would depend on the size of your dataset. For eg, I have a dataset with 32M records and about 0.2KB per record and that takes about 30 minutes to reindex on startup