Running BE on AWS Fargate using ECS - nareshkumarthota/rootrepo GitHub Wiki

Setup Fargate ECS Cluster using below steps

Pre-requisites

  • Container image of TIBCO Business Events. For regsitry setup
  • AWS Fargate requires IAM role for your task definition.
  • Create IAM role and policy

Cluster creation

  • Go to AWS Management Console → Elastic Container Service

  • Click Create Cluster and select cluster template powered by AWS Fargate

  • Select new VPC and click on create cluster.

Running BE application

  • Create Tasks in the ECS.Use the respective Business events container image and add the container ports. The task names and environment variable values to the containers are given in the tables.

  • Create Services in ECS cluster with the respective tasks.The service names are given in the tables.

  • While creating BE Cache node service enable the Service Discovery.

  • While creating the BE Inference Service, select the application load balancer.Create Load Balancer and target groups from here

  • Modify the Inbound and outbound rules of security groups accordingly.

Service Discovery

  • Service discovery in Fargate creates record set in Route 53.
  • Make sure that VPC, which is created while cluster creation is associated with hosted zones. Default hosted zone is local.
  • Service discovery endpoint is configured as per service name in Fargate.
  • Docker environment variable, AS_DISCOVER_URL should be passed as per the name of the service, created for cache agent. For example, if name of the service is discoveryservice, then AS_DISCOVER_URL should be passed as tcp://discoveryservice.local:50000

Key points for Shared nothing application

For Shared Nothing application follow:

  • Create EFS referring here. Choose VPC which was created while creating Fargate Cluster.

  • Create Access Points in EFS with User ID and Group ID as 1000, Directory as /mnt/tibco/be/data-store. Provide all permissions to this User ID and Group ID.

  • Create Volume definition in task definition. Select Volume type as EFS and add EFS details as created above.

  • Attach volume to container part via source volume.

  • Fargate creates new data file in mount path whenever we start new task. But, we need common file name so that data is persisted. So, we need to add following property, which goes in our be-engine.tra file.

     be.engine.cluster.as.hostaware.hostname = <data_filename>
    

    Or you can pass the same from the environment variables as:

     tra.be.engine.cluster.as.hostaware.hostname = <data_filename>
    

Unclustered

Task Name Container name Environment Service Name Number of Service Instances
beinferencenodetask inference-node PU=default* beinferencenodeservice >=1

Cluster with Activespaces cache

Task Name Container name Environment Service Name Number of Service Instances
becachenodetask cache-node AS_DISCOVER_URL=tcp://becachenodeservice.local:50000 PU=cache* becachenodeservice >=1
beinferencenodetask inference-node AS_DISCOVER_URL=tcp://becachenodeservice.local:50000 PU=default* beinferencenodeservice >=1

Cluster with Ignite Cache

Task Name Container name Environment Service Name Number of Service Instances
becachenodetask cache-node IGNITE_DISCOVER_URL=becachenodeservice.local PU=cache* FTL/REALM_SERVER=http://<FTL_SERVER_IP>:<FTL_PORT>** becachenodeservice >=1
beinferencenodetask inference-node IGNITE_DISCOVER_URL=becachenodeservice.local PU=default* FTL/REALM_SERVER=http://<FTL_SERVER_IP>:<FTL_PORT>** beinferencenodeservice >=1

*If global variables are used for FTL, AS4, Mysql or any other configurations in the Tibco Business application, the values should be passed as Container Environment variables during task creation.

** FTL/REALM_SERVER is the Ftl global variable used for sample application.

Access the application

Hit the application using the below url:

    curl http://<LoadbalancerDnsaddress>:<port>/<application-path>

RMS

  • Create a EFS refering here.
  • Deploy the BE application using the above mentioned steps. For enabling RMS Hot deployments add JMX port(Ex:5555) in container ports along with application port in the inference task.
  • Add volumes with volume type as EFS. Use them in the container mount points with container path as "/opt/tibco/be/6.1/rms/shared". Additionally you can mount "/opt/tibco/be/6.1/examples/standard/WebStudio" or "/opt/tibco/be/5.6/rms/config/security". Note that you have to copy required files to mounted paths. Make sure to update your BE version in the volumes.

Create RMS task and service using the below table:

Task Name Container name Environment Service Name Number of Service Instances Container Path
rmstask rms-node PU=default* rmsservice >=1 /opt/tibco/be/6.1/rms/shared/

Create BE application task and service using the below table:

Task Name Container name Environment Service Name Number of Service Instances Container Path
beinferencenodetask inference-node PU=default* beinferencenodeservice >=1 /opt/tibco/be/6.1/rms/shared/

Test RMS Application

  • Access the Webstudio Url using the created rmsservice. Your Webstudio Url will be http://:8090/WebStudio/. Add the JMX host and port of BE application in the WebStudio deployment settings.

  • For testing RMS example, Refer to readme.html available in example/standard/WebStudio folder.

  • Verify the RMS deployment in BE application logs.

TEA

Create TEA server task and service using the below table:

Task Name Container name Environment Service Name Number of Service Instances
teaservertask teaserver-node PU=default* teaserverservice >=1

Create TEA agent task and service using the below table:

Task Name Container name Environment Service Name Number of Service Instances Container Path ReadOnly
teaagenttask teaagent-node BE_TEA_AGENT_AUTO_REGISTER_ENABLE=true, TEA_SERVER_PASSWORD=admin, TEA_SERVER_URL=<TEA_SERVER_URL>, TEA_SERVER_USERNAME=admin teaagentservice 1 /var/run/docker.sock,/var/run/weave/weave.sock true

Note:

  • While creating Tea agent task make sure to add mount points for weave and docker using the mentioned container paths with ReadOnly as true.
  • Set Soft limit as 700 and port mapping for JMX Port(Ex:5566) in the container.

Create BE application task and service using the below table:

Task Name Container name Environment Service Name Number of Service Instances
beinferencenodetask inference-node PU=default* beinferencenodeservice >=1

Note: Deploy any BE application referring to Running BE application.

Access the TEA server url, the agent and BE instance details will be available.

⚠️ **GitHub.com Fallback** ⚠️