- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试将数据从Amazon Kinesis Data Firehose发送到Amazon Elasticsearch Service,但是它记录了一条错误消息503 Service Unavailable
。但是,我可以到达Elasticsearch端点(https://vpc-XXX.<region>.es.amazonaws.com
)并对其进行查询。我还经历了How can I prevent HTTP 503 Service Unavailable errors in Amazon Elasticsearch Service?,可以确认我的设置有足够的资源。
这是我在保存失败日志的S3备份存储桶中遇到的错误:
{
"attemptsMade": 8,
"arrivalTimestamp": 1599748282943,
"errorCode": "ES.ServiceException",
"errorMessage": "Error received from Elasticsearch cluster. <html><body><h1>503 Service Unavailable</h1>\nNo server is available to handle this request.\n</body></html>",
"attemptEndingTimestamp": 1599748643460,
"rawData": "eyJ0aWNrZXJfc3ltYm9sIjoiQUxZIiwic2VjdG9yIjoiRU5FUkdZIiwiY2hhbmdlIjotNi4zNSwicHJpY2UiOjg4LjgzfQ==",
"subsequenceNumber": 0,
"esDocumentId": "49610662085822146490768158474738345331794592496281976834.0",
"esIndexName": "prometheus-2020-09",
"esTypeName": ""
},
任何人都有如何解决此问题的想法,并将数据索引到Elasticsearch中吗?
最佳答案
原来,我的问题是选择了错误的安全组。
我正在使用与附加到Elasticsearch实例相同的安全组(我将其命名为elasticsearch-${domain_name}
)(该实例允许TCP从firehose_es
安全组进/出端口443)。我应该选择firehose_es
安全组。
根据注释的要求,这是firehose_es
SG的Terraform配置。
resource "aws_security_group" "firehose_es" {
name = "firehose_es"
description = "Firehose to send logs to Elasticsearch"
vpc_id = module.networking.aws_vpc_id
}
resource "aws_security_group_rule" "firehose_es_https_ingress" {
type = "ingress"
from_port = 443
to_port = 443
protocol = "tcp"
security_group_id = aws_security_group.firehose_es.id
cidr_blocks = ["10.0.0.0/8"]
}
resource "aws_security_group_rule" "firehose_es_https_egress" {
type = "egress"
from_port = 443
to_port = 443
protocol = "tcp"
security_group_id = aws_security_group.firehose_es.id
source_security_group_id = aws_security_group.elasticsearch.id
}
// https://docs.aws.amazon.com/firehose/latest/dev/controlling-access.html
data "aws_iam_policy_document" "firehose_es_policy_specific" {
statement {
actions = [
"s3:AbortMultipartUpload",
"s3:GetBucketLocation",
"s3:GetObject",
"s3:ListBucket",
"s3:ListBucketMultipartUploads",
"s3:PutObject"
]
resources = [
aws_s3_bucket.firehose.arn,
"${aws_s3_bucket.firehose.arn}/*"
]
}
statement {
actions = [
"es:DescribeElasticsearchDomain",
"es:DescribeElasticsearchDomains",
"es:DescribeElasticsearchDomainConfig",
"es:ESHttpPost",
"es:ESHttpPut"
]
resources = [
var.elasticsearch_domain_arn,
"${var.elasticsearch_domain_arn}/*",
]
}
statement {
actions = [
"es:ESHttpGet"
]
resources = [
"${var.elasticsearch_domain_arn}/_all/_settings",
"${var.elasticsearch_domain_arn}/_cluster/stats",
"${var.elasticsearch_domain_arn}/${var.name_prefix}${var.name}_${var.app}*/_mapping/type-name",
"${var.elasticsearch_domain_arn}/_nodes",
"${var.elasticsearch_domain_arn}/_nodes/stats",
"${var.elasticsearch_domain_arn}/_nodes/*/stats",
"${var.elasticsearch_domain_arn}/_stats",
"${var.elasticsearch_domain_arn}/${var.name_prefix}${var.name}_${var.app}*/_stats"
]
}
statement {
actions = [
"ec2:DescribeVpcs",
"ec2:DescribeVpcAttribute",
"ec2:DescribeSubnets",
"ec2:DescribeSecurityGroups",
"ec2:DescribeNetworkInterfaces",
"ec2:CreateNetworkInterface",
"ec2:CreateNetworkInterfacePermission",
"ec2:DeleteNetworkInterface",
]
resources = [
"*"
]
}
}
resource "aws_kinesis_firehose_delivery_stream" "ecs" {
name = "${var.name_prefix}${var.name}_${var.app}"
destination = "elasticsearch"
s3_configuration {
role_arn = aws_iam_role.firehose_es.arn
bucket_arn = aws_s3_bucket.firehose.arn
buffer_interval = 60
compression_format = "GZIP"
}
elasticsearch_configuration {
domain_arn = var.elasticsearch_domain_arn
role_arn = aws_iam_role.firehose_es.arn
# If Firehose cannot deliver to Elasticsearch, logs are sent to S3
s3_backup_mode = "FailedDocumentsOnly"
buffering_interval = 60
buffering_size = 5
index_name = "${var.name_prefix}${var.name}_${var.app}"
index_rotation_period = "OneMonth"
vpc_config {
subnet_ids = var.elasticsearch_subnet_ids
security_group_ids = [var.firehose_security_group_id]
role_arn = aws_iam_role.firehose_es.arn
}
}
}
再次阅读
Controlling Access with Amazon Kinesis Data Firehose文章后,我能够弄清自己的错误。
关于amazon-web-services - AWS Kinesis Firehose无法将数据索引到AWS Elasticsearch中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63839946/
我正在将 Java API 用于 Kinesis Firehose,并在可能的情况下利用 putRecordBatch()。但是,在我的应用程序中,我偶尔只发送一条记录,无法等待更多记录或将其缓存在内
我正在处理一个添加到 S3 的 XML 文件并将结果写入到 firehose,并将结果存储在同一个 S3 存储桶中,但目标文件名必须采用特定格式。我检查了文档,但看不到任何设置文件名格式的方法。我能找
按照此 guide 并创建 Kinesis Firehose 流。 我已按照指南进行操作,当我开始创建订阅过滤器(步骤 12)时,我在尝试发送到 S3 时遇到此错误: 调用 PutSubscripti
AWS Firehose已于今天发布。我正在研究它,并试图弄清楚如何使用AWS CLI将数据放入流中。我有一个简单的JSON有效负载和对应的Redshift表,其中的列映射到JSON属性。我尝试了各种
我正在尝试使用 Firehose API (JS)我不断收到以下错误: "InvalidArgumentException: Firehose is unable to assume role arn
我试图了解是否可以使用 kinesis firehose 将数据索引到 elasticsearch 到多个索引,方法是将索引名称和类型传递给它(类似于 elasticsaerch bulk api)
是否可以异步向 AWS 发送请求?在真正意义上。 如果我尝试以某种方式发送消息,则消息未送达: $firehose = new FirehoseClient($args); /
我将 AWS Kinesis Firehose 与自定义数据转换结合使用。 Lambda 用 Python 3.6 编写并返回如下所示的字符串: { "records": [
我有一个应用程序,我想构建一个包含 2-3 种组合事件类型的“最近事件”/firehose feed,例如帖子、评论和帖子点赞,以及其他内容 + 稍后可能会更多。我假设这是通过查询添加到数据库中的最后
我遇到了这个最可怕的场景,我想读取 kinesis firehose 在我们的 S3 上创建的文件。 Kinesis firehose 创建的文件并不是每个 json 对象都在一个新行上,而是一个 j
这个 11 年级的问题自 2010 年以来一直困扰着我,即使在大学毕业后我仍然无法弄清楚/找到解决方案。 Problem Description There is a very unusual str
我有以下 lambda 函数作为 Kinesis firehose 记录转换的一部分,它将 msgpack 记录从 kinesis 输入流转换为 json。 Lambda 运行时:python 3.6
我有一个用例,我必须每秒从不同的生产者收集数千条记录,并使用 AWS firehose 将它们推送到 Elasticsearch 。我还在 firehose 上使用数据转换 lambda,它在将记录传
所以我们有 100 种不同类型的消息进入我们的 Kinesis 流。我们只想保存 4 种类型。我知道 Kinesis 可以转换消息,但它也可以过滤吗?这是怎么做到的? 最佳答案 过滤只是一种转换,您可
账户 A 是我在其中创建 Kinesis 流的应用程序账户,我想在账户 B 中创建 Firehose 以从账户 A Kinesis 流中读取。这可能吗?我尝试按照 ( https://medium.c
将记录写入到配置为 S3 作为输出目标的 AWS Firehose 时,此数据在写入 S3 之前缓冲了多长时间?或者是否有最小尺寸阈值? 例如,我正在执行以下操作来添加记录: aws cli: aws
我正在为 S3 设置 Kinesis Firehose 传输流,我注意到您可以设置自定义 KMS key 以用于加密 S3 上的文件。 但是,如果 S3 存储桶已启用 KMS 加密,则无论如何都会对文
我已经阅读了很多关于向 firehose 添加换行符的类似问题,但它们都围绕着将换行符添加到源代码中。问题是我无权访问源,第三方正在将数据传输到我们的 Kinesis 实例,我无法将 '\n' 添加到
我正在尝试将一些数据从 API(谷歌股票/金融 API)写入我的 AWS Firehose 流。我已经在 Eclipse 上下载并安装了 AWS 插件,在 AWS 上设置了我的 Firehose 流,
您好,我正在尝试将 kinesis firehose 与 S3 结合使用。我试着阅读那些 s3 文件。我正在使用 GO 阅读它。 但是,我无法解析 JSON,因为值只是在没有任何分隔符的情况下附加。
我是一名优秀的程序员,十分优秀!