Skip to content

Running BE on AWS ECS

lakshmimekala edited this page Feb 7, 2024 · 1 revision

You can run TIBCO BusinessEvents application on AWS ECS (EC2/Fargate) Cluster and monitor them by using TIBCO BusinessEvents Enterprise Administrator Agent. Also manage business rules through WebStudio by running RMS on AWS ECS (EC2/Fargate) Cluster.

Table of Contents:

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

ECS FARGATE

  • Login to AWS, Navigate to Elastic Container Service
  • Click Create Cluster and select cluster template powered by AWS Fargate
  • Select new VPC and click on create cluster.

ECS EC2

  • Login to AWS → VPC. Create VPC with 2 private and 2 public subnets. If you are using AWS default option "VPC,subnets,etc." to create the required resources(VPC,Subents,Routetables,Nat gateways,etc), make sure to change the Nat gateways from 'None' to '1 per AZ' or 'In 1 AZ'.
  • Navigate to Elastic Container Service. Create ECS EC2 cluster selecting the VPC and 2 private subnets created in previous steps.

Note: Create all the tasks and services below with network as "awsvpc"

Running BE application

  • Create Task definitions in the ECS.Use the respective Business events container image and add the container ports. The task definition 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 Def Name Container name Environment Service Name Desired Tasks
beinmem inference PU=default* beinmemsvc >=1

Cluster with Activespaces(2.X) cache

Task Def Name Container name Environment Service Name Desired Tasks
becacheas2 cache AS_DISCOVER_URL=tcp://becache
nodeservice.local:50000
PU=cache*
becacheas2 >=1
beinferenceas2 inference AS_DISCOVER_URL=tcp://becache
nodeservice.local:50000
PU=default*
beinferenceas2 >=1

Cluster with Ignite Cache

Task Def Name Container name Environment Service Name Desired Tasks
becacheignite cache IGNITE_DISCOVER_URL=becache
nodeservice.local
PU=cache*
FTL/REALM_SERVER=http://<FTL_SERV
ER_IP>:<FTL_PORT>**
becacheignite >=1
beinfignite inference IGNITE_DISCOVER_URL=becache
nodeservice.local
PU=default*
FTL/REALM_SERVER=http://<FTL_SERV
ER_IP>:<FTL_PORT>**
beinfignite >=1

Cluster with FTL Cache

Task Def Name Container name Environment Service Name Desired Tasks
becacheftl cache PU=cache*
FTL/REALM_SERVER=http://<FTL_SERV
ER_IP>:<FTL_PORT>**
becacheftl >=1
beinferenceftl inference PU=default*
FTL/REALM_SERVER=http://<FTL_SERV
ER_IP>:<FTL_PORT>**
beinferenceftl >=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 Def Name Container name Environment Service Name Desired Tasks Container Path
rms rms PU=default* rmsservice >=1 /opt/tibco/be/6.1/rms/shared/

Create BE application task and service using the below table:

Task Def Name Container name Environment Service Name Desired Tasks Container Path
beinf inference PU=default* beinfservice >=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://External-IP: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

Note:

  • While running Tea on ECS EC2 cluster, make sure to run the services/tasks of Teaserver and Teagent on Private subnet with Network mode as awsvpc.

Create TEA server task and service using the below table:

Task Def Name Container name Environment Service Name Desired Tasks
teaserver teaserver-node PU=default* teaserverservice >=1

Create TEA agent task and service using the below table:

Task Def Name Container name Environment Service Name Desired Tasks Container Path ReadOnly
teaagent teaagent BE_TEA_AGENT_AUTO_REGISTER_ENABLE=true, TEA_SERVER_PASSWORD=admin, TEA_SERVER_URL=<TEA_SERVER_URL>, TEA_SERVER_USERNAME=admin teaagentsvc 1 /var/run/docker.sock,
/var/run/weave/weave.sock
true

Note:

  • Add 8777 port in Port Mappings for Tea Server task.
  • Set Soft limit as 700 and port mapping for 9777 in the container.
  • 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 Def Name Container name Environment Service Name Desired Tasks
beinference inference PU=default* beinference >=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.

Clone this wiki locally