我遇到了最奇怪的权限问题_msearch。
当使用相同的查询运行简单的 _search 时,一切都运行得很好。
POST /job/_search
{"query":{"bool":{"must":[{"bool":{"must":{"bool":{"should":[{"multi_match":{"query":"s","fields":["title"],"type":"best_fields","operator":"or","fuzziness":2}},{"multi_match":{"query":"s","fields":["title"],"type":"phrase","operator":"or"}},{"multi_match":{"query":"s","fields":["title"],"type":"phrase_prefix","operator":"or"}}],"minimum_should_match":"1"}}}}]}},"size":10,"_source":{"includes":["*"],"excludes":[]}}
Run Code Online (Sandbox Code Playgroud)
运行它时,_msearch我收到权限错误
POST /job/_msearch
{}
{"query":{"bool":{"must":[{"bool":{"must":{"bool":{"should":[{"multi_match":{"query":"s","fields":["title"],"type":"best_fields","operator":"or","fuzziness":2}},{"multi_match":{"query":"s","fields":["title"],"type":"phrase","operator":"or"}},{"multi_match":{"query":"s","fields":["title"],"type":"phrase_prefix","operator":"or"}}],"minimum_should_match":"1"}}}}]}},"size":10,"_source":{"includes":["*"],"excludes":[]}}
Run Code Online (Sandbox Code Playgroud)
{
"error": {
"root_cause": [
{
"type": "security_exception",
"reason": "no permissions for [indices:data/read/msearch] and User [name=public_api, backend_roles=[], requestedTenant=null]"
}
],
"type": "security_exception",
"reason": "no permissions for [indices:data/read/msearch] and User [name=public_api, backend_roles=[], requestedTenant=null]"
},
"status": 403
}
Run Code Online (Sandbox Code Playgroud)
以下是我在 Kibana 中的权限:
我正在 AWS ElasticSearch Service 中运行 OpenDistro。
我在 AWS 中创建了一个 Elasticsearch 域。
它已添加到公共子网内的 VPC 中,并且我附加了一个当前完全开放的安全组。
我也附上了这个政策:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
"Action": "es:*",
"Resource": "arn:aws:es:eu-central-1:ACCOUNT_ID:domain/DOMAIN_NAME/*"
}
]
}
Run Code Online (Sandbox Code Playgroud)
我正在尝试在本地访问端点,但似乎不允许。
例如 Kibana URL 是:
https://vpc-bla.bla.bla.eu-central-1.es.amazonaws.com/_plugin/kibana/
知道为什么我无法访问此 URL 吗?
networking amazon-web-services elasticsearch aws-elasticsearch
我正在尝试在AWS上创建一个VPC控制的弹性搜索服务.问题是我在运行以下代码时不断收到错误:'ValidationException:在继续操作之前,必须启用服务链接角色以授予Amazon ES访问VPC的权限'.
const AWS = require('aws-sdk');
AWS.config.update({region:'<aws-datacenter>'});
const accessPolicies = {
Statement: [{
Effect: "Allow",
Principal: {
AWS: "*"
},
Action: "es:*",
Resource: "arn:aws:es:<dc>:<accountid>:domain/<domain-name/*"
}]
};
const params = {
DomainName: '<domain>',
/* required */
AccessPolicies: JSON.stringify(accessPolicies),
AdvancedOptions: {
EBSEnabled: "true",
VolumeType: "io1",
VolumeSize: "100",
Iops: "1000"
},
EBSOptions: {
EBSEnabled: true,
Iops: 1000,
VolumeSize: 100,
VolumeType: "io1"
},
ElasticsearchClusterConfig: {
DedicatedMasterCount: 3,
DedicatedMasterEnabled: true,
DedicatedMasterType: "m4.large.elasticsearch",
InstanceCount: 2,
InstanceType: 'm4.xlarge.elasticsearch',
ZoneAwarenessEnabled: true
},
ElasticsearchVersion: '5.5',
SnapshotOptions: {
AutomatedSnapshotStartHour: 3 …Run Code Online (Sandbox Code Playgroud) 我创建了一个AWS elasticsearch实例.我想使用python脚本访问它.我指定了我的AWS配置(访问密钥,密钥,区域).我使用下面的代码来访问AWS ES实例:
from elasticsearch import Elasticsearch, RequestsHttpConnection
from requests_aws4auth import AWS4Auth
AWS_ACCESS_KEY = '**************'
AWS_SECRET_KEY = '*****************'
region = 'us-east-1'
service = 'es'
awsauth = AWS4Auth(AWS_ACCESS_KEY, AWS_SECRET_KEY, region, service)
host = 'https://kbckjsdkcdn.us-east-1.es.amazonaws.com' # For example, my-test-domain.us-east-1.es.amazonaws.com
es = Elasticsearch(
hosts = [{'host': host, 'port': 443}],
http_auth = awsauth,
use_ssl = True,
verify_certs = True,
connection_class = RequestsHttpConnection
)
print es.info()
Run Code Online (Sandbox Code Playgroud)
当我运行上面的代码时,我收到以下错误:
elasticsearch.exceptions.ConnectionError: ConnectionError(HTTPSConnectionPool(host='https', port=443): Max retries exceeded with url: //search-opendata-2xd6pwilq5sv4ahomcuaiyxmqe.us-east-1.es.amazonaws.com:443/ (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x10ee72310>: Failed to establish …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用 terraform 创建 elasticsearch 集群,但出现此错误
11:58:07 * aws_cloudwatch_log_resource_policy.elasticsearch-log-publishing-policy: Writing CloudWatch log resource policy failed: LimitExceededException: Resource limit exceeded.
11:58:07 * aws_elasticsearch_domain.es2: 1 error(s) occurred:
Run Code Online (Sandbox Code Playgroud)
我一开始以为这个资源限制错误是无法创建日志组。但是当我向 AWS 团队提出问题时,他们说“IAD 中此帐户的 CreateLogGroup API 没有限制”
ElasticSearch 大约有 10 个集群正在运行。我不确定超出了哪个资源限制。
有人可以解释一下上面的错误吗?
更新:
data "aws_iam_policy_document" "elasticsearch-log-publishing-policy" {
statement {
actions = [
"logs:CreateLogStream",
"logs:PutLogEvents",
"logs:PutLogEventsBatch",
]
resources = ["arn:aws:logs:*"]
principals {
identifiers = ["es.amazonaws.com"]
type = "Service"
}
}
}
resource "aws_cloudwatch_log_resource_policy" "elasticsearch-log-publishing-policy" {
policy_document = "${data.aws_iam_policy_document.elasticsearch-log-publishing-policy.json}"
policy_name = "elasticsearch-log-publishing-policy"
}
Run Code Online (Sandbox Code Playgroud)
我尝试使用 terraform 目标应用此操作,我认为错误就在这里,AWS 对我们创建的自定义策略数量是否有限制,我找不到请求增加的选项。
我认为AWS ElasticSearch服务带有自动snaphshots /备份.这就是我在文档中找到的内容.这表明他们每天发生一次,并存储在S3上,但我没有看到任何我的S3存储桶的任何备份.如何访问自动快照?
它可能没关系,但我使用以下模板创建我的elasticsearch域明确表示我想要自动备份.
CloudFormation
"SnapshotOptions": {
"AutomatedSnapshotStartHour": "0"
}
Run Code Online (Sandbox Code Playgroud) 我在项目中使用 AWS Elasticsearch 和 async elasticsearch-py 包来连接集群。
AWS Elasticsearch 版本 7.9
Python包:elasticsearch[async]==7.12.0
我无法使用该AWS4Auth库初始化异步 Elasticsearch 客户端(官方 AWS ES 客户端 Python 文档中提到)
它应该成功与客户端连接。但是,它给了我这个错误:
AttributeError: 'AWS4Auth' object has no attribute 'encode'
Run Code Online (Sandbox Code Playgroud)
分享我的代码片段:
AttributeError: 'AWS4Auth' object has no attribute 'encode'
Run Code Online (Sandbox Code Playgroud) amazon-web-services python-3.x elasticsearch aws-elasticsearch
我正在尝试将模板上传到我的AWS托管ElasticSearch.
ElasticSearch以500错误响应,抱怨我需要设置script.painless.regex.enabled为true.我知道你不能elasticsearch.yml直接编辑文件,但是无论如何都要允许在AWS托管ES上的无痛脚本中支持正则表达式?
我正在尝试使用AWS4签名方法将数据发布到AWS管理的Elasticsearch.我想通过postman pre-script实现这一目标.我尝试使用下面的脚本,它完美地用于弹性搜索的GET操作,但它不适用于POST或PUT或DELETE操作并继续给我一个错误消息,签名与POST操作不匹配.有人可以帮助我修复邮差中的前脚本吗?
var date = new Date().toISOString();
var amzdate = date.replace(/[:\-]|\.\d{3}/g, "");
var dateStamp = amzdate.slice(0, -8);
pm.environment.set('authorization', getAuthHeader(request.method, request.url, request.data));
pm.environment.set('xAmzDate', amzdate);
function getPath(url) {
var pathRegex = /.+?\:\/\/.+?(\/.+?)(?:#|\?|$)/;
var result = url.match(pathRegex);
return result && result.length > 1 ? result[1] : '';
}
function getQueryString(url) {
var arrSplit = url.split('?');
return arrSplit.length > 1 ? url.substring(url.indexOf('?') + 1) : '';
}
function getSignatureKey(secretKey, dateStamp, regionName, serviceName) {
var kDate = sign("AWS4" + secretKey, dateStamp);
var kRegion = sign(kDate, …Run Code Online (Sandbox Code Playgroud)javascript amazon-web-services elasticsearch postman aws-elasticsearch
在 AWS 控制台中按下更新服务软件版本后,出现以下消息:已请求发布 ******** 的更新,但正在等待。在更新开始之前,您可以随时取消。”
现在我等了 1 天 - 仍然悬而未决。
任何想法需要多长时间,或者我需要做什么才能将其从待处理状态转移到更新状态,以及我是否应该预计更新过程中会出现任何停机时间,请在此处输入图像描述