# Multi-Node Deployment

Deploying multiple nodes improves availability and throughput for a Kloudless Enterprise deployment. Each node in a multi-node deployment can handle API requests and will distribute work to any other node via a central broker. The processes will not locally store any application or cluster state. As long as they are configured with the same Redis instance and the same database, they will implicitly coordinate and act as a single cluster. This allows for simpler scaling and management of a cluster.

Multi-Node Diagram

# Requirements

  • External Redis (e.g. AWS Elasticache)
  • External PostgreSQL (e.g. AWS RDS)
  • Load Balancer (e.g. AWS ELB)

Each node must be configured to use the same external services and hostname as described in the Redis Configuration, Database Configuration, and Hostname/SSL sections respectively. It is important to note that the external services, mentioned above, are not a managed part of the Kloudless Enterprise deployment. As such, they must be made resilient according to the requirements of your application.

# AWS Deployments

Amazon Web Services has infrastructure components that make it easy to support a multi-node Kloudless Enterprise deployment.

# Database

It is recommended that the RDS for PostgreSQL product is used for the external database. In order to use RDS For production deployments we recommend the following as a starting configuration:

  • DB Instance Class: m4.large
  • DB Engine Version >=9.4
  • 250GB of storage General Purpose SSD
  • Encryption Enabled
  • Multi-AZ
  • Security Groups:
    • On database server:
      • TCP 5432 open to Kloudless Enterprise nodes.
  • Redis

It is recommended that Amazon ElastiCache is used as the external Redis provider for the purposes of ease of management and built-in high availability. Redis is used for process orchestration as well as task distribution, so the ElastiCache instances should be sized accordingly. If using ElastiCache within a VPC, you must first create a Subnet Group that contains the subnets you wish to deploy ElastiCache into For production deployments we recommend the following as a starting configuration:

  • Node Type: m3.medium
  • Number of Replicas: 1
  • Multi-AZ with Auto-Failover: enabled
  • Cluster Mode: disabled
  • Security Groups:
    • On Redis servers:
      • TCP 6379 open to Kloudless Enterprise nodes.
  • Engine Version compatibility: >=3.2.4
  • Port: 6379 Since Elasticache is used only for communication, backups are not necessary. Choosing a maintenance window will be dependent on the requirements of your application, if there is no requirement, leave the defaults.

# Load Balancer

Using a Classic Elastic Load Balancer is the recommended way to balance requests between nodes in the cluster. The following configuration is the recommended starting point:

  • Port Configuration:
    • 443 (HTTPS) -> 80 (HTTP)
    • 8443 (HTTPS) -> 8080 (HTTP)
  • Health Checks:
    • HTTP:80 /health
    • Timeout: 59s
    • Interval: 60s
    • Unhealthy Threshold: 2
    • Healthy Threshold: 2
  • Stickiness: Disabled
  • Idle Timeout: 300s
  • Security Groups:
    • On ELB:
      • TCP 8443 Open to developers (8080 without SSL/TLS)
      • TCP 443 Open to applications (80 without SSL/TLS)
    • On Kloudless Enterprise nodes:
      • TCP 80 Open to ELB
      • TCP 8080 Open to ELB

Once a single node has been configured to use the external services, an AMI should be created from it. Instances brought up from this AMI will already be configured and will be ready to be added to a load balancer to start handling requests. The AMI can also be used as part of an Auto Scaling Group, where nodes can be automatically provisioned and added to a load balancer. For more details about this configuration, please contact support@kloudless.com.