SlideShare uma empresa Scribd logo
1 de 17
SHIPPING LOGS TO SPLUNK FROM A
CONTAINER IN AWS HOWTO.
ADVANTAGES OF RUNNING
CONTAINERS IN AWS FARGATE.
Необходимо предоставить решение по доставке
логов приложения в Спланк клауд из контейнера в
AWS, с использованием HEC
Миграция java сервисов с AWS EB на AWS Fargate
LOGGING
Неоходимо отказаться от использования on-premises kafka
логгирования и перейти на облачный сервис Спланк используя
HTTP Event Collector;
Отсылаем все что приложение пишет в stdout stderr;
Сделать это нужно не используя CloudWatch;
Мы запускаем контейнеры в AWS EB – 90% и AWS FG – 10%
The HTTP Event Collector (HEC) is a fast and efficient
way to send data to Splunk Enterprise and Splunk Cloud.
Notably, HEC enables you to send data over HTTP
(or HTTPS) directly to Splunk Enterprise or Splunk Cloud
from your application.
Fluentbit – Cloud native log forwarder
Fluentd – Unified logging Layer
Filebeat+Logstash
Filebeat и Fluentd не подошли по причине своей тяжеловесности.
Ради экперимента сделали контейнер c приложением + fluentbit
RUN mkdir -p /home/fluent-bit && cd /home/fluent-bit && 
wget https://fluentbit.io/releases/1.0/fluent-bit-1.0.6.tar.gz && 
tar xzf fluent-bit-1.0.6.tar.gz && 
rm fluent-bit-1.0.6.tar.gz && 
cd fluent-bit-1.0.6 && 
cmake . && make && make install
Возникла необходимость скриптом запускать оба процесса и контролировать
чтобы один из процессов не завершил работу.
[SERVICE]
Flush 5
Daemon on
Log_Level Info
Coro_Stack_Size 8092
[INPUT]
Name tail
Path /var/log/someservice.log
Refresh_Interval 7
Tag app
[FILTER]
Name nest
Match *
Operation nest
Wildcard *
Nest_under event
[FILTER]
Name modify
Match *
Add index main_dev
Add source http:
Add sourcetype someservice
[OUTPUT]
Name splunk
Host *.splunkcloud.com
Port 443
tls On
tls.Verify Off
Splunk_Token SPLUNK_TOKEN_PLACEHOLDER
Splunk_Send_Raw On
Match *
Что рекомендуют на сайте Спланка?
AWS Cloudwatch + AWS lambda
Docker-compose?!!
Application container + Fluentbit container !
Что предлагает AWS EB для мультиконтейнерных приложений?
“AWSEBDockerrunVersion”: 2
https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_docker_v2config.html
https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_docker_v2config.html#create_deploy_docker_v2config_dockerrun_format
{
"AWSEBDockerrunVersion": 2,
"containerDefinitions": [
{
"name": "app",
"image": “some-service:@build_number@",
"essential": true,
"portMappings": [
{
"hostPort": 8080,
"containerPort": 8080
}
],
"links": [
"fluentd"
],
"logConfiguration": {
"logDriver": "fluentd",
"options": {
"fluent-address": "fluentd:24224"
}
}
},
{
"name": "fluentd",
"image": “fluentd-logger:403323",
"essential": true
}
]
}
{
"AWSEBDockerrunVersion": "1",
"Authentication": {
"Bucket": "my-bucket",
"Key": "mydockercfg"
},
"Image": {
"Name": "quay.io/johndoe/private-image",
"Update": "true"
},
"Ports": [
{
"ContainerPort": "1234"
}
],
"Volumes": [
{
"HostDirectory": "/var/app/mydb",
"ContainerDirectory": "/etc/mysql"
}
],
"Logging": "/var/log/nginx"
}
docker run --help
ERROR: Encountered error starting new ECS task: {cancel
the command.
"failures": [
{
"reason": "ATTRIBUTE",
"arn": "arn:aws:ecs:ap-northeast-
1:000000000000:container-instance/00000000-0000-
0000-0000-000000000000"
}
],
"tasks": []
}
ERROR: Failed to start ECS task after retrying 2 times.
ERROR: [Instance: i-00000000] Command failed on
instance. Return code: 1 Output:
beanstalk/hooks/appdeploy/enact/03start-task.sh failed.
For more detail, check /var/log/eb-activity.log using
console or EB CLI
files:
"/home/ec2-user/setup-available-log-dirvers.sh":
mode: "000755"
owner: root
group: root
content: |
#!/bin/sh
set -e
if ! grep splunk /etc/ecs/ecs.config &> /dev/null
then
echo 'ECS_AVAILABLE_LOGGING_DRIVERS=["json-
file","syslog","fluentd", "splunk"]' >> /etc/ecs/ecs.config
fi
container_commands:
01-configure-splunk:
command: /home/ec2-user/setup-available-log-dirvers.sh
02-stop-ecs:
command: stop ecs
03-stop-ecs:
command: start ecs
001_splunk.config
AWS ELASTICBEANSTALK
Почему получилось так что его использовали для
запуска контейнеров
AWS
ELASTICBEANSTALK
 01/2011
 04/23/2014 We are excited to announce that you
can now create and manage Docker containers in
AWS Elastic Beanstalk.
 Elastic Beanstalk is built on top of the proven AWS infrastructure.
It takes full advantage of Amazon EC2, Elastic Load Balancing,
Amazon CloudWatch, Auto Scaling, and other AWS services. You
get all of the economy and scalability of AWS in a form that’s
easier and quicker to deploy than ever before.
 With Elastic Beanstalk you can choose to gradually assert control
over a number of aspects of your application. You can start by
tuning a number of parameters (see my post on the Elastic
Beanstalk Console for more information about this). You can
choose the EC2 instance type that provides the optimal amount of
RAM and CPU power for your application. You can log in to the
EC2 instances to troubleshoot application issues, and you can
even take the default Elastic Beanstalk AMI (Amazon Machine
Image), customize it, and then configure Amazon Beanstalk to use
it for your application. This gradual assertion of control extends all
the way to “eleven” — you can choose to move your application
off of Elastic Beanstalk and manage the raw components yourself
if you so choose.
 Elastic Beanstalk was designed to support multiple languages and
application environments. We are already working with solution
providers to make this happen.
 Each of your Elastic Beanstalk applications will be run on one or
more EC2 instances that are provisioned just for your application.
Applications running on Elastic Beanstalk have the same degree of
security as those running on an EC2 instance that you launch
yourself.
AWS FARGATE
 Announced 11/29/2017
 AWS Fargate is a compute engine for deploying and
managing containers without having to manage any of the
underlying infrastructure. Fargate makes it easy to scale your
applications. You no longer have to worry about provisioning
enough compute resources for your container applications.
You can launch tens or tens of thousands of containers in
seconds.
 Previously, you needed to manage a cluster of Amazon EC2
instances, pick the instance types, manage the scheduling of
the containers, and optimize cluster utilization. With Fargate,
all of this goes away. Fargate seamlessly integrates with
Amazon ECS. You just define your application as you do
today for Amazon ECS. You package your application into
task definitions, specify the CPU and memory needed, define
the networking and IAM policies each container needs. Once
everything is setup, Fargate launches and manages your
containers for you.
 With Fargate, billing is at a per second granularity and you
only pay for what you use. You pay for the amount of vCPU
and memory resources your containerized application
requests. vCPU and memory resources are calculated from
the time your container images are pulled until the Amazon
ECS Task terminates, rounded up to the nearest second.
AWS EB pricing
 There is no additional charge for AWS
Elastic Beanstalk. You pay for AWS
resources (e.g. EC2 instances or S3
buckets) you create to store and run
your application.
Fargate pricing
per vCPU per hour $0.04048
per GB per hour $0.004445
Daily charge using Docker in AWS EB:
t2.small linux
24 * $0.0208 = 0.4992 + 0.0266(EBS price) =
0.5258
Daily charge using Fargate:
1vCPU + 2Gb
24*(0.25*0.04048+2*0.00445) = 0.45648
Effective Jan 07, 2019, we are reducing the price for AWS Fargate by 20% for vCPU and 65%
for memory across all regions where Fargate is currently available.
A few Fargate advantages:
• No cluster to manage
• Seamless scaling
• Much easier to deploy
• Supports shipping logs to SPLUNK out of the box

Mais conteúdo relacionado

Mais procurados

Managing Your Infrastructure as Code by Travis Williams, Solutions Architect,...
Managing Your Infrastructure as Code by Travis Williams, Solutions Architect,...Managing Your Infrastructure as Code by Travis Williams, Solutions Architect,...
Managing Your Infrastructure as Code by Travis Williams, Solutions Architect,...Amazon Web Services
 
Serverless Architectures on AWS Lambda
Serverless Architectures on AWS LambdaServerless Architectures on AWS Lambda
Serverless Architectures on AWS LambdaSerhat Can
 
SRV201 Getting Started with Docker on AWS
SRV201 Getting Started with Docker on AWSSRV201 Getting Started with Docker on AWS
SRV201 Getting Started with Docker on AWSAmazon Web Services
 
Deep Dive on Accelerating Content, APIs, and Applications with Amazon CloudFr...
Deep Dive on Accelerating Content, APIs, and Applications with Amazon CloudFr...Deep Dive on Accelerating Content, APIs, and Applications with Amazon CloudFr...
Deep Dive on Accelerating Content, APIs, and Applications with Amazon CloudFr...Amazon Web Services
 
AWS re:Invent 2016: How Harvard University Improves Scalable Cloud Network Se...
AWS re:Invent 2016: How Harvard University Improves Scalable Cloud Network Se...AWS re:Invent 2016: How Harvard University Improves Scalable Cloud Network Se...
AWS re:Invent 2016: How Harvard University Improves Scalable Cloud Network Se...Amazon Web Services
 
Migrating Monolithic Applications with the Strangler Pattern
Migrating Monolithic Applications with the Strangler Pattern Migrating Monolithic Applications with the Strangler Pattern
Migrating Monolithic Applications with the Strangler Pattern Thanh Nguyen
 
February 2016 Webinar Series - EC2 Container Service Deep Dive
February 2016 Webinar Series - EC2 Container Service Deep Dive February 2016 Webinar Series - EC2 Container Service Deep Dive
February 2016 Webinar Series - EC2 Container Service Deep Dive Amazon Web Services
 
AWS re:Invent 2016: Configuration Management in the Cloud (DEV305)
AWS re:Invent 2016: Configuration Management in the Cloud (DEV305)AWS re:Invent 2016: Configuration Management in the Cloud (DEV305)
AWS re:Invent 2016: Configuration Management in the Cloud (DEV305)Amazon Web Services
 
Self Service Agile Infrastructure for Product Teams - Pop-up Loft Tel Aviv
Self Service Agile Infrastructure for Product Teams - Pop-up Loft Tel AvivSelf Service Agile Infrastructure for Product Teams - Pop-up Loft Tel Aviv
Self Service Agile Infrastructure for Product Teams - Pop-up Loft Tel AvivAmazon Web Services
 
Deep Dive on Microservices and Amazon ECS
Deep Dive on Microservices and Amazon ECSDeep Dive on Microservices and Amazon ECS
Deep Dive on Microservices and Amazon ECSAmazon Web Services
 
Deploy, Manage, and Scale Your Apps with OpsWorks and Elastic Beanstalk
Deploy, Manage, and Scale Your Apps with OpsWorks and Elastic BeanstalkDeploy, Manage, and Scale Your Apps with OpsWorks and Elastic Beanstalk
Deploy, Manage, and Scale Your Apps with OpsWorks and Elastic BeanstalkAmazon Web Services
 
Automating Security in Cloud Workloads with DevSecOps
Automating Security in Cloud Workloads with DevSecOps Automating Security in Cloud Workloads with DevSecOps
Automating Security in Cloud Workloads with DevSecOps Kristana Kane
 
HSBC and AWS Day - Microservices and Serverless
HSBC and AWS Day - Microservices and ServerlessHSBC and AWS Day - Microservices and Serverless
HSBC and AWS Day - Microservices and ServerlessAmazon Web Services
 
SRV302 Deep Dive on Serverless Application Development
SRV302 Deep Dive on Serverless Application DevelopmentSRV302 Deep Dive on Serverless Application Development
SRV302 Deep Dive on Serverless Application DevelopmentAmazon Web Services
 
SRV203 Getting Started with AWS Lambda and the Serverless Cloud
SRV203 Getting Started with AWS Lambda and the Serverless CloudSRV203 Getting Started with AWS Lambda and the Serverless Cloud
SRV203 Getting Started with AWS Lambda and the Serverless CloudAmazon Web Services
 
Serverless Stream Processing with Bill Bejeck
Serverless Stream Processing with Bill BejeckServerless Stream Processing with Bill Bejeck
Serverless Stream Processing with Bill Bejeckconfluent
 
AWS re:Invent 2016: NEW SERVICE: Centrally Manage Multiple AWS Accounts with ...
AWS re:Invent 2016: NEW SERVICE: Centrally Manage Multiple AWS Accounts with ...AWS re:Invent 2016: NEW SERVICE: Centrally Manage Multiple AWS Accounts with ...
AWS re:Invent 2016: NEW SERVICE: Centrally Manage Multiple AWS Accounts with ...Amazon Web Services
 
Getting Started with Docker on AWS
Getting Started with Docker on AWSGetting Started with Docker on AWS
Getting Started with Docker on AWSKristana Kane
 
AWS re:Invent 2016: 6 Million New Registrations in 30 Days: How the Chick-fil...
AWS re:Invent 2016: 6 Million New Registrations in 30 Days: How the Chick-fil...AWS re:Invent 2016: 6 Million New Registrations in 30 Days: How the Chick-fil...
AWS re:Invent 2016: 6 Million New Registrations in 30 Days: How the Chick-fil...Amazon Web Services
 

Mais procurados (20)

Managing Your Infrastructure as Code by Travis Williams, Solutions Architect,...
Managing Your Infrastructure as Code by Travis Williams, Solutions Architect,...Managing Your Infrastructure as Code by Travis Williams, Solutions Architect,...
Managing Your Infrastructure as Code by Travis Williams, Solutions Architect,...
 
Serverless Architectures on AWS Lambda
Serverless Architectures on AWS LambdaServerless Architectures on AWS Lambda
Serverless Architectures on AWS Lambda
 
SRV201 Getting Started with Docker on AWS
SRV201 Getting Started with Docker on AWSSRV201 Getting Started with Docker on AWS
SRV201 Getting Started with Docker on AWS
 
Deep Dive on Accelerating Content, APIs, and Applications with Amazon CloudFr...
Deep Dive on Accelerating Content, APIs, and Applications with Amazon CloudFr...Deep Dive on Accelerating Content, APIs, and Applications with Amazon CloudFr...
Deep Dive on Accelerating Content, APIs, and Applications with Amazon CloudFr...
 
AWS re:Invent 2016: How Harvard University Improves Scalable Cloud Network Se...
AWS re:Invent 2016: How Harvard University Improves Scalable Cloud Network Se...AWS re:Invent 2016: How Harvard University Improves Scalable Cloud Network Se...
AWS re:Invent 2016: How Harvard University Improves Scalable Cloud Network Se...
 
Migrating Monolithic Applications with the Strangler Pattern
Migrating Monolithic Applications with the Strangler Pattern Migrating Monolithic Applications with the Strangler Pattern
Migrating Monolithic Applications with the Strangler Pattern
 
February 2016 Webinar Series - EC2 Container Service Deep Dive
February 2016 Webinar Series - EC2 Container Service Deep Dive February 2016 Webinar Series - EC2 Container Service Deep Dive
February 2016 Webinar Series - EC2 Container Service Deep Dive
 
AWS re:Invent 2016: Configuration Management in the Cloud (DEV305)
AWS re:Invent 2016: Configuration Management in the Cloud (DEV305)AWS re:Invent 2016: Configuration Management in the Cloud (DEV305)
AWS re:Invent 2016: Configuration Management in the Cloud (DEV305)
 
Self Service Agile Infrastructure for Product Teams - Pop-up Loft Tel Aviv
Self Service Agile Infrastructure for Product Teams - Pop-up Loft Tel AvivSelf Service Agile Infrastructure for Product Teams - Pop-up Loft Tel Aviv
Self Service Agile Infrastructure for Product Teams - Pop-up Loft Tel Aviv
 
Deep Dive on Microservices and Amazon ECS
Deep Dive on Microservices and Amazon ECSDeep Dive on Microservices and Amazon ECS
Deep Dive on Microservices and Amazon ECS
 
Deploy, Manage, and Scale Your Apps with OpsWorks and Elastic Beanstalk
Deploy, Manage, and Scale Your Apps with OpsWorks and Elastic BeanstalkDeploy, Manage, and Scale Your Apps with OpsWorks and Elastic Beanstalk
Deploy, Manage, and Scale Your Apps with OpsWorks and Elastic Beanstalk
 
Automating Security in Cloud Workloads with DevSecOps
Automating Security in Cloud Workloads with DevSecOps Automating Security in Cloud Workloads with DevSecOps
Automating Security in Cloud Workloads with DevSecOps
 
HSBC and AWS Day - Microservices and Serverless
HSBC and AWS Day - Microservices and ServerlessHSBC and AWS Day - Microservices and Serverless
HSBC and AWS Day - Microservices and Serverless
 
SRV302 Deep Dive on Serverless Application Development
SRV302 Deep Dive on Serverless Application DevelopmentSRV302 Deep Dive on Serverless Application Development
SRV302 Deep Dive on Serverless Application Development
 
SRV203 Getting Started with AWS Lambda and the Serverless Cloud
SRV203 Getting Started with AWS Lambda and the Serverless CloudSRV203 Getting Started with AWS Lambda and the Serverless Cloud
SRV203 Getting Started with AWS Lambda and the Serverless Cloud
 
Serverless Stream Processing with Bill Bejeck
Serverless Stream Processing with Bill BejeckServerless Stream Processing with Bill Bejeck
Serverless Stream Processing with Bill Bejeck
 
AWS re:Invent 2016: NEW SERVICE: Centrally Manage Multiple AWS Accounts with ...
AWS re:Invent 2016: NEW SERVICE: Centrally Manage Multiple AWS Accounts with ...AWS re:Invent 2016: NEW SERVICE: Centrally Manage Multiple AWS Accounts with ...
AWS re:Invent 2016: NEW SERVICE: Centrally Manage Multiple AWS Accounts with ...
 
Getting Started with Docker on AWS
Getting Started with Docker on AWSGetting Started with Docker on AWS
Getting Started with Docker on AWS
 
AWS re:Invent 2016: 6 Million New Registrations in 30 Days: How the Chick-fil...
AWS re:Invent 2016: 6 Million New Registrations in 30 Days: How the Chick-fil...AWS re:Invent 2016: 6 Million New Registrations in 30 Days: How the Chick-fil...
AWS re:Invent 2016: 6 Million New Registrations in 30 Days: How the Chick-fil...
 
Microsoft Best Practices on AWS
Microsoft Best Practices on AWSMicrosoft Best Practices on AWS
Microsoft Best Practices on AWS
 

Semelhante a Shipping logs to splunk from a container in aws howto

Introduction to Containers - AWS Startup Day Johannesburg.pdf
Introduction to Containers - AWS Startup Day Johannesburg.pdfIntroduction to Containers - AWS Startup Day Johannesburg.pdf
Introduction to Containers - AWS Startup Day Johannesburg.pdfAmazon Web Services
 
How To Run Your Containers on AWS with ECS & Fargate: Collision 2018
How To Run Your Containers on AWS with ECS & Fargate: Collision 2018How To Run Your Containers on AWS with ECS & Fargate: Collision 2018
How To Run Your Containers on AWS with ECS & Fargate: Collision 2018Amazon Web Services
 
AWS Elastic Beanstalk - Running Microservices and Docker
AWS Elastic Beanstalk - Running Microservices and DockerAWS Elastic Beanstalk - Running Microservices and Docker
AWS Elastic Beanstalk - Running Microservices and DockerAmazon Web Services
 
From Docker Straight to AWS
From Docker Straight to AWSFrom Docker Straight to AWS
From Docker Straight to AWSDevOps.com
 
Getting Started with Containers on AWS: Collision 2018
Getting Started with Containers on AWS: Collision 2018Getting Started with Containers on AWS: Collision 2018
Getting Started with Containers on AWS: Collision 2018Amazon Web Services
 
Running containerized application in AWS ECS
Running containerized application in AWS ECSRunning containerized application in AWS ECS
Running containerized application in AWS ECSDevOps Indonesia
 
AWS Fargate AWS UG Dormund 2019 Kazulkin Jung
AWS Fargate AWS UG Dormund 2019 Kazulkin JungAWS Fargate AWS UG Dormund 2019 Kazulkin Jung
AWS Fargate AWS UG Dormund 2019 Kazulkin JungVadym Kazulkin
 
"AWS Fargate: Containerization meets Serverless" at AWS User Group Cologne 20...
"AWS Fargate: Containerization meets Serverless" at AWS User Group Cologne 20..."AWS Fargate: Containerization meets Serverless" at AWS User Group Cologne 20...
"AWS Fargate: Containerization meets Serverless" at AWS User Group Cologne 20...Vadym Kazulkin
 
Building Serverless Container Applications using AWS Fargate and CDK
Building Serverless Container Applications using AWS Fargate and CDK Building Serverless Container Applications using AWS Fargate and CDK
Building Serverless Container Applications using AWS Fargate and CDK Amazon Web Services
 
AWS April Webinar Series - Getting Started with Amazon EC2 Container Service
AWS April Webinar Series - Getting Started with Amazon EC2 Container ServiceAWS April Webinar Series - Getting Started with Amazon EC2 Container Service
AWS April Webinar Series - Getting Started with Amazon EC2 Container ServiceAmazon Web Services
 
A 60-minute tour of AWS Compute (November 2016)
A 60-minute tour of AWS Compute (November 2016)A 60-minute tour of AWS Compute (November 2016)
A 60-minute tour of AWS Compute (November 2016)Julien SIMON
 
Workshop Interstella GTC - Tiffany Jernigan.pdf
Workshop Interstella GTC - Tiffany Jernigan.pdfWorkshop Interstella GTC - Tiffany Jernigan.pdf
Workshop Interstella GTC - Tiffany Jernigan.pdfAmazon Web Services
 
AWS Certified Solutions Architect Associate Notes.pdf
AWS Certified Solutions Architect Associate Notes.pdfAWS Certified Solutions Architect Associate Notes.pdf
AWS Certified Solutions Architect Associate Notes.pdffayoyiwababajide
 
Amazon ECS (December 2015)
Amazon ECS (December 2015)Amazon ECS (December 2015)
Amazon ECS (December 2015)Julien SIMON
 
SRV314 Containerized App Development with AWS Fargate
SRV314 Containerized App Development with AWS FargateSRV314 Containerized App Development with AWS Fargate
SRV314 Containerized App Development with AWS FargateAmazon Web Services
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateAmazon Web Services
 

Semelhante a Shipping logs to splunk from a container in aws howto (20)

Introduction to Containers - AWS Startup Day Johannesburg.pdf
Introduction to Containers - AWS Startup Day Johannesburg.pdfIntroduction to Containers - AWS Startup Day Johannesburg.pdf
Introduction to Containers - AWS Startup Day Johannesburg.pdf
 
How To Run Your Containers on AWS with ECS & Fargate: Collision 2018
How To Run Your Containers on AWS with ECS & Fargate: Collision 2018How To Run Your Containers on AWS with ECS & Fargate: Collision 2018
How To Run Your Containers on AWS with ECS & Fargate: Collision 2018
 
AWS Elastic Beanstalk - Running Microservices and Docker
AWS Elastic Beanstalk - Running Microservices and DockerAWS Elastic Beanstalk - Running Microservices and Docker
AWS Elastic Beanstalk - Running Microservices and Docker
 
From Docker Straight to AWS
From Docker Straight to AWSFrom Docker Straight to AWS
From Docker Straight to AWS
 
Reinvent recap
Reinvent recapReinvent recap
Reinvent recap
 
應用開發新思維
應用開發新思維應用開發新思維
應用開發新思維
 
Getting Started with Containers on AWS: Collision 2018
Getting Started with Containers on AWS: Collision 2018Getting Started with Containers on AWS: Collision 2018
Getting Started with Containers on AWS: Collision 2018
 
Running containerized application in AWS ECS
Running containerized application in AWS ECSRunning containerized application in AWS ECS
Running containerized application in AWS ECS
 
AWS Fargate AWS UG Dormund 2019 Kazulkin Jung
AWS Fargate AWS UG Dormund 2019 Kazulkin JungAWS Fargate AWS UG Dormund 2019 Kazulkin Jung
AWS Fargate AWS UG Dormund 2019 Kazulkin Jung
 
"AWS Fargate: Containerization meets Serverless" at AWS User Group Cologne 20...
"AWS Fargate: Containerization meets Serverless" at AWS User Group Cologne 20..."AWS Fargate: Containerization meets Serverless" at AWS User Group Cologne 20...
"AWS Fargate: Containerization meets Serverless" at AWS User Group Cologne 20...
 
Building Serverless Container Applications using AWS Fargate and CDK
Building Serverless Container Applications using AWS Fargate and CDK Building Serverless Container Applications using AWS Fargate and CDK
Building Serverless Container Applications using AWS Fargate and CDK
 
AWS April Webinar Series - Getting Started with Amazon EC2 Container Service
AWS April Webinar Series - Getting Started with Amazon EC2 Container ServiceAWS April Webinar Series - Getting Started with Amazon EC2 Container Service
AWS April Webinar Series - Getting Started with Amazon EC2 Container Service
 
A 60-minute tour of AWS Compute (November 2016)
A 60-minute tour of AWS Compute (November 2016)A 60-minute tour of AWS Compute (November 2016)
A 60-minute tour of AWS Compute (November 2016)
 
Workshop Interstella GTC - Tiffany Jernigan.pdf
Workshop Interstella GTC - Tiffany Jernigan.pdfWorkshop Interstella GTC - Tiffany Jernigan.pdf
Workshop Interstella GTC - Tiffany Jernigan.pdf
 
Interstella GTC Workshop
Interstella GTC WorkshopInterstella GTC Workshop
Interstella GTC Workshop
 
AWS Certified Solutions Architect Associate Notes.pdf
AWS Certified Solutions Architect Associate Notes.pdfAWS Certified Solutions Architect Associate Notes.pdf
AWS Certified Solutions Architect Associate Notes.pdf
 
Amazon ECS (December 2015)
Amazon ECS (December 2015)Amazon ECS (December 2015)
Amazon ECS (December 2015)
 
SRV314 Containerized App Development with AWS Fargate
SRV314 Containerized App Development with AWS FargateSRV314 Containerized App Development with AWS Fargate
SRV314 Containerized App Development with AWS Fargate
 
AWS cheatsheett.pdf
AWS cheatsheett.pdfAWS cheatsheett.pdf
AWS cheatsheett.pdf
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS Fargate
 

Último

A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Scott Andery
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 

Último (20)

A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 

Shipping logs to splunk from a container in aws howto

  • 1. SHIPPING LOGS TO SPLUNK FROM A CONTAINER IN AWS HOWTO. ADVANTAGES OF RUNNING CONTAINERS IN AWS FARGATE.
  • 2. Необходимо предоставить решение по доставке логов приложения в Спланк клауд из контейнера в AWS, с использованием HEC Миграция java сервисов с AWS EB на AWS Fargate
  • 3. LOGGING Неоходимо отказаться от использования on-premises kafka логгирования и перейти на облачный сервис Спланк используя HTTP Event Collector; Отсылаем все что приложение пишет в stdout stderr; Сделать это нужно не используя CloudWatch; Мы запускаем контейнеры в AWS EB – 90% и AWS FG – 10% The HTTP Event Collector (HEC) is a fast and efficient way to send data to Splunk Enterprise and Splunk Cloud. Notably, HEC enables you to send data over HTTP (or HTTPS) directly to Splunk Enterprise or Splunk Cloud from your application.
  • 4. Fluentbit – Cloud native log forwarder Fluentd – Unified logging Layer Filebeat+Logstash Filebeat и Fluentd не подошли по причине своей тяжеловесности.
  • 5. Ради экперимента сделали контейнер c приложением + fluentbit RUN mkdir -p /home/fluent-bit && cd /home/fluent-bit && wget https://fluentbit.io/releases/1.0/fluent-bit-1.0.6.tar.gz && tar xzf fluent-bit-1.0.6.tar.gz && rm fluent-bit-1.0.6.tar.gz && cd fluent-bit-1.0.6 && cmake . && make && make install Возникла необходимость скриптом запускать оба процесса и контролировать чтобы один из процессов не завершил работу.
  • 6. [SERVICE] Flush 5 Daemon on Log_Level Info Coro_Stack_Size 8092 [INPUT] Name tail Path /var/log/someservice.log Refresh_Interval 7 Tag app [FILTER] Name nest Match * Operation nest Wildcard * Nest_under event [FILTER] Name modify Match * Add index main_dev Add source http: Add sourcetype someservice [OUTPUT] Name splunk Host *.splunkcloud.com Port 443 tls On tls.Verify Off Splunk_Token SPLUNK_TOKEN_PLACEHOLDER Splunk_Send_Raw On Match *
  • 7. Что рекомендуют на сайте Спланка? AWS Cloudwatch + AWS lambda
  • 8. Docker-compose?!! Application container + Fluentbit container ! Что предлагает AWS EB для мультиконтейнерных приложений? “AWSEBDockerrunVersion”: 2 https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_docker_v2config.html https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_docker_v2config.html#create_deploy_docker_v2config_dockerrun_format
  • 9. { "AWSEBDockerrunVersion": 2, "containerDefinitions": [ { "name": "app", "image": “some-service:@build_number@", "essential": true, "portMappings": [ { "hostPort": 8080, "containerPort": 8080 } ], "links": [ "fluentd" ], "logConfiguration": { "logDriver": "fluentd", "options": { "fluent-address": "fluentd:24224" } } }, { "name": "fluentd", "image": “fluentd-logger:403323", "essential": true } ] } { "AWSEBDockerrunVersion": "1", "Authentication": { "Bucket": "my-bucket", "Key": "mydockercfg" }, "Image": { "Name": "quay.io/johndoe/private-image", "Update": "true" }, "Ports": [ { "ContainerPort": "1234" } ], "Volumes": [ { "HostDirectory": "/var/app/mydb", "ContainerDirectory": "/etc/mysql" } ], "Logging": "/var/log/nginx" }
  • 11. ERROR: Encountered error starting new ECS task: {cancel the command. "failures": [ { "reason": "ATTRIBUTE", "arn": "arn:aws:ecs:ap-northeast- 1:000000000000:container-instance/00000000-0000- 0000-0000-000000000000" } ], "tasks": [] } ERROR: Failed to start ECS task after retrying 2 times. ERROR: [Instance: i-00000000] Command failed on instance. Return code: 1 Output: beanstalk/hooks/appdeploy/enact/03start-task.sh failed. For more detail, check /var/log/eb-activity.log using console or EB CLI
  • 12. files: "/home/ec2-user/setup-available-log-dirvers.sh": mode: "000755" owner: root group: root content: | #!/bin/sh set -e if ! grep splunk /etc/ecs/ecs.config &> /dev/null then echo 'ECS_AVAILABLE_LOGGING_DRIVERS=["json- file","syslog","fluentd", "splunk"]' >> /etc/ecs/ecs.config fi container_commands: 01-configure-splunk: command: /home/ec2-user/setup-available-log-dirvers.sh 02-stop-ecs: command: stop ecs 03-stop-ecs: command: start ecs 001_splunk.config
  • 13. AWS ELASTICBEANSTALK Почему получилось так что его использовали для запуска контейнеров
  • 14. AWS ELASTICBEANSTALK  01/2011  04/23/2014 We are excited to announce that you can now create and manage Docker containers in AWS Elastic Beanstalk.  Elastic Beanstalk is built on top of the proven AWS infrastructure. It takes full advantage of Amazon EC2, Elastic Load Balancing, Amazon CloudWatch, Auto Scaling, and other AWS services. You get all of the economy and scalability of AWS in a form that’s easier and quicker to deploy than ever before.  With Elastic Beanstalk you can choose to gradually assert control over a number of aspects of your application. You can start by tuning a number of parameters (see my post on the Elastic Beanstalk Console for more information about this). You can choose the EC2 instance type that provides the optimal amount of RAM and CPU power for your application. You can log in to the EC2 instances to troubleshoot application issues, and you can even take the default Elastic Beanstalk AMI (Amazon Machine Image), customize it, and then configure Amazon Beanstalk to use it for your application. This gradual assertion of control extends all the way to “eleven” — you can choose to move your application off of Elastic Beanstalk and manage the raw components yourself if you so choose.  Elastic Beanstalk was designed to support multiple languages and application environments. We are already working with solution providers to make this happen.  Each of your Elastic Beanstalk applications will be run on one or more EC2 instances that are provisioned just for your application. Applications running on Elastic Beanstalk have the same degree of security as those running on an EC2 instance that you launch yourself.
  • 15. AWS FARGATE  Announced 11/29/2017  AWS Fargate is a compute engine for deploying and managing containers without having to manage any of the underlying infrastructure. Fargate makes it easy to scale your applications. You no longer have to worry about provisioning enough compute resources for your container applications. You can launch tens or tens of thousands of containers in seconds.  Previously, you needed to manage a cluster of Amazon EC2 instances, pick the instance types, manage the scheduling of the containers, and optimize cluster utilization. With Fargate, all of this goes away. Fargate seamlessly integrates with Amazon ECS. You just define your application as you do today for Amazon ECS. You package your application into task definitions, specify the CPU and memory needed, define the networking and IAM policies each container needs. Once everything is setup, Fargate launches and manages your containers for you.  With Fargate, billing is at a per second granularity and you only pay for what you use. You pay for the amount of vCPU and memory resources your containerized application requests. vCPU and memory resources are calculated from the time your container images are pulled until the Amazon ECS Task terminates, rounded up to the nearest second.
  • 16. AWS EB pricing  There is no additional charge for AWS Elastic Beanstalk. You pay for AWS resources (e.g. EC2 instances or S3 buckets) you create to store and run your application. Fargate pricing per vCPU per hour $0.04048 per GB per hour $0.004445 Daily charge using Docker in AWS EB: t2.small linux 24 * $0.0208 = 0.4992 + 0.0266(EBS price) = 0.5258 Daily charge using Fargate: 1vCPU + 2Gb 24*(0.25*0.04048+2*0.00445) = 0.45648 Effective Jan 07, 2019, we are reducing the price for AWS Fargate by 20% for vCPU and 65% for memory across all regions where Fargate is currently available.
  • 17. A few Fargate advantages: • No cluster to manage • Seamless scaling • Much easier to deploy • Supports shipping logs to SPLUNK out of the box