Amazon web services elastic/elasticsearch:AWS群集上volumeClaimTemplate的吊舱处于挂起状态
我在aws上安装了kops集群,并且在集群中安装了helm 我正在尝试使用图表进行安装。我需要修改我在下面创建的Amazon web services elastic/elasticsearch:AWS群集上volumeClaimTemplate的吊舱处于挂起状态,amazon-web-services,docker,elasticsearch,kubernetes,Amazon Web Services,Docker,elasticsearch,Kubernetes,我在aws上安装了kops集群,并且在集群中安装了helm 我正在尝试使用图表进行安装。我需要修改我在下面创建的values.yml文件的默认卷大小 # Allocate smaller chunks of memory per pod resources: requests: cpu: "100m" memory: "512M" limits: cpu: "1000m"
values.yml
文件的默认卷大小
# Allocate smaller chunks of memory per pod
resources:
requests:
cpu: "100m"
memory: "512M"
limits:
cpu: "1000m"
memory: "512M"
# Request smaller persistent volume
volumeClaimTemplate:
accessModes: [ "ReadWriteOnce" ]
storageClassName: default
resources:
requests:
storage: 10Gi
我就是这样安装的
helm install elasticsearch -n logging elastic/elasticsearch -f values.yml
安装成功,但现在POD处于挂起状态
[ec2-user@ip-my elastic-search]$ kubectl get pods -n logging
NAME READY STATUS RESTARTS AGE
elasticsearch-master-0 0/1 Pending 0 6m35s
elasticsearch-master-1 0/1 Pending 0 6m35s
elasticsearch-master-2 0/1 Pending 0 6m35s
更新:
[ec2-user@my-ip elastic-search]$ kubectl describe pods -n logging elasticsearch-master-0
Name: elasticsearch-master-0
Namespace: logging
Priority: 0
Node: <none>
Labels: app=elasticsearch-master
chart=elasticsearch
controller-revision-hash=elasticsearch-master-697ffb4548
release=elasticsearch
statefulset.kubernetes.io/pod-name=elasticsearch-master-0
Annotations: <none>
Status: Pending
IP:
IPs: <none>
Controlled By: StatefulSet/elasticsearch-master
Init Containers:
configure-sysctl:
Image: docker.elastic.co/elasticsearch/elasticsearch:7.12.0
Port: <none>
Host Port: <none>
Command:
sysctl
-w
vm.max_map_count=262144
Environment: <none>
Mounts:
/var/run/secrets/kubernetes.io/serviceaccount from default-token-tmqp9 (ro)
Containers:
elasticsearch:
Image: docker.elastic.co/elasticsearch/elasticsearch:7.12.0
Ports: 9200/TCP, 9300/TCP
Host Ports: 0/TCP, 0/TCP
Limits:
cpu: 1
memory: 2Gi
Requests:
cpu: 1
memory: 2Gi
Readiness: exec [sh -c #!/usr/bin/env bash -e
# If the node is starting up wait for the cluster to be ready (request params: "wait_for_status=green&timeout=1s" )
# Once it has started only check that the node itself is responding
START_FILE=/tmp/.es_start_file
# Disable nss cache to avoid filling dentry cache when calling curl
# This is required with Elasticsearch Docker using nss < 3.52
export NSS_SDB_USE_CACHE=no
http () {
local path="${1}"
local args="${2}"
set -- -XGET -s
if [ "$args" != "" ]; then
set -- "$@" $args
fi
if [ -n "${ELASTIC_USERNAME}" ] && [ -n "${ELASTIC_PASSWORD}" ]; then
set -- "$@" -u "${ELASTIC_USERNAME}:${ELASTIC_PASSWORD}"
fi
curl --output /dev/null -k "$@" "http://127.0.0.1:9200${path}"
}
if [ -f "${START_FILE}" ]; then
echo 'Elasticsearch is already running, lets check the node is healthy'
HTTP_CODE=$(http "/" "-w %{http_code}")
RC=$?
if [[ ${RC} -ne 0 ]]; then
echo "curl --output /dev/null -k -XGET -s -w '%{http_code}' \${BASIC_AUTH} http://127.0.0.1:9200/ failed with RC ${RC}"
exit ${RC}
fi
# ready if HTTP code 200, 503 is tolerable if ES version is 6.x
if [[ ${HTTP_CODE} == "200" ]]; then
exit 0
elif [[ ${HTTP_CODE} == "503" && "7" == "6" ]]; then
exit 0
else
echo "curl --output /dev/null -k -XGET -s -w '%{http_code}' \${BASIC_AUTH} http://127.0.0.1:9200/ failed with HTTP code ${HTTP_CODE}"
exit 1
fi
else
echo 'Waiting for elasticsearch cluster to become ready (request params: "wait_for_status=green&timeout=1s" )'
if http "/_cluster/health?wait_for_status=green&timeout=1s" "--fail" ; then
touch ${START_FILE}
exit 0
else
echo 'Cluster is not yet ready (request params: "wait_for_status=green&timeout=1s" )'
exit 1
fi
fi
] delay=10s timeout=5s period=10s #success=3 #failure=3
Environment:
node.name: elasticsearch-master-0 (v1:metadata.name)
cluster.initial_master_nodes: elasticsearch-master-0,elasticsearch-master-1,elasticsearch-master-2,
discovery.seed_hosts: elasticsearch-master-headless
cluster.name: elasticsearch
network.host: 0.0.0.0
ES_JAVA_OPTS: -Xmx1g -Xms1g
node.data: true
node.ingest: true
node.master: true
node.ml: true
node.remote_cluster_client: true
Mounts:
/usr/share/elasticsearch/data from elasticsearch-master (rw)
/var/run/secrets/kubernetes.io/serviceaccount from default-token-tmqp9 (ro)
Conditions:
Type Status
PodScheduled False
Volumes:
elasticsearch-master:
Type: PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
ClaimName: elasticsearch-master-elasticsearch-master-0
ReadOnly: false
default-token-tmqp9:
Type: Secret (a volume populated by a Secret)
SecretName: default-token-tmqp9
Optional: false
QoS Class: Burstable
Node-Selectors: <none>
Tolerations: node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Warning FailedScheduling 23s (x2 over 24s) default-scheduler 0/3 nodes are available: 3 pod has unbound immediate PersistentVolumeClaims.
[ec2-user@my-ip elastic-search]$ kubectl describe statefulset -n logging elasticsearch-master
Name: elasticsearch-master
Namespace: logging
CreationTimestamp: Mon, 19 Apr 2021 03:51:58 +0000
Selector: app=elasticsearch-master
Labels: app=elasticsearch-master
app.kubernetes.io/managed-by=Helm
chart=elasticsearch
heritage=Helm
release=elasticsearch
Annotations: esMajorVersion: 7
meta.helm.sh/release-name: elasticsearch
meta.helm.sh/release-namespace: logging
Replicas: 3 desired | 3 total
Update Strategy: RollingUpdate
Pods Status: 0 Running / 3 Waiting / 0 Succeeded / 0 Failed
Pod Template:
Labels: app=elasticsearch-master
chart=elasticsearch
release=elasticsearch
Init Containers:
configure-sysctl:
Image: docker.elastic.co/elasticsearch/elasticsearch:7.12.0
Port: <none>
Host Port: <none>
Command:
sysctl
-w
vm.max_map_count=262144
Environment: <none>
Mounts: <none>
Containers:
elasticsearch:
Image: docker.elastic.co/elasticsearch/elasticsearch:7.12.0
Ports: 9200/TCP, 9300/TCP
Host Ports: 0/TCP, 0/TCP
Limits:
cpu: 1
memory: 2Gi
Requests:
cpu: 1
memory: 2Gi
Readiness: exec [sh -c #!/usr/bin/env bash -e
# If the node is starting up wait for the cluster to be ready (request params: "wait_for_status=green&timeout=1s" )
# Once it has started only check that the node itself is responding
START_FILE=/tmp/.es_start_file
# Disable nss cache to avoid filling dentry cache when calling curl
# This is required with Elasticsearch Docker using nss < 3.52
export NSS_SDB_USE_CACHE=no
http () {
local path="${1}"
local args="${2}"
set -- -XGET -s
if [ "$args" != "" ]; then
set -- "$@" $args
fi
if [ -n "${ELASTIC_USERNAME}" ] && [ -n "${ELASTIC_PASSWORD}" ]; then
set -- "$@" -u "${ELASTIC_USERNAME}:${ELASTIC_PASSWORD}"
fi
curl --output /dev/null -k "$@" "http://127.0.0.1:9200${path}"
}
if [ -f "${START_FILE}" ]; then
echo 'Elasticsearch is already running, lets check the node is healthy'
HTTP_CODE=$(http "/" "-w %{http_code}")
RC=$?
if [[ ${RC} -ne 0 ]]; then
echo "curl --output /dev/null -k -XGET -s -w '%{http_code}' \${BASIC_AUTH} http://127.0.0.1:9200/ failed with RC ${RC}"
exit ${RC}
fi
# ready if HTTP code 200, 503 is tolerable if ES version is 6.x
if [[ ${HTTP_CODE} == "200" ]]; then
exit 0
elif [[ ${HTTP_CODE} == "503" && "7" == "6" ]]; then
exit 0
else
echo "curl --output /dev/null -k -XGET -s -w '%{http_code}' \${BASIC_AUTH} http://127.0.0.1:9200/ failed with HTTP code ${HTTP_CODE}"
exit 1
fi
else
echo 'Waiting for elasticsearch cluster to become ready (request params: "wait_for_status=green&timeout=1s" )'
if http "/_cluster/health?wait_for_status=green&timeout=1s" "--fail" ; then
touch ${START_FILE}
exit 0
else
echo 'Cluster is not yet ready (request params: "wait_for_status=green&timeout=1s" )'
exit 1
fi
fi
] delay=10s timeout=5s period=10s #success=3 #failure=3
Environment:
node.name: (v1:metadata.name)
cluster.initial_master_nodes: elasticsearch-master-0,elasticsearch-master-1,elasticsearch-master-2,
discovery.seed_hosts: elasticsearch-master-headless
cluster.name: elasticsearch
network.host: 0.0.0.0
ES_JAVA_OPTS: -Xmx1g -Xms1g
node.data: true
node.ingest: true
node.master: true
node.ml: true
node.remote_cluster_client: true
Mounts:
/usr/share/elasticsearch/data from elasticsearch-master (rw)
Volumes: <none>
Volume Claims:
Name: elasticsearch-master
StorageClass: standard
Labels: <none>
Annotations: <none>
Capacity: 10Gi
Access Modes: [ReadWriteOnce]
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal SuccessfulCreate 2m50s statefulset-controller create Pod elasticsearch-master-0 in StatefulSet elasticsearch-master successful
Normal SuccessfulCreate 2m50s statefulset-controller create Pod elasticsearch-master-1 in StatefulSet elasticsearch-master successful
Normal SuccessfulCreate 2m50s statefulset-controller create Pod elasticsearch-master-2 in StatefulSet elasticsearch-master successful
[ec2-user@~]$ kubectl describe pvc -n logging elasticsearch-master-0
Error from server (NotFound): persistentvolumeclaims "elasticsearch-master-0" not found
[ec2-user@ip~]$ kubectl get storageclass
NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE
default kubernetes.io/aws-ebs Delete Immediate false 38d
gp2 kubernetes.io/aws-ebs Delete Immediate false 38d
kops-ssd-1-17 (default) kubernetes.io/aws-ebs Delete WaitForFirstConsumer true 38d
[ec2-user@my-ip弹性搜索]$kubectl描述pods-n日志弹性搜索-master-0
名称:elasticsearch-master-0
名称空间:日志
优先级:0
节点:
标签:app=elasticsearch master
图表=弹性搜索
控制器修订哈希=elasticsearch-master-697ffb4548
释放=弹性搜索
statefulset.kubernetes.io/pod name=elasticsearch-master-0
注释:
状态:待定
知识产权:
IPs:
控制人:StatefulSet/elasticsearch主机
初始化容器:
配置sysctl:
图片:docker.elastic.co/elasticsearch/elasticsearch:7.12.0
端口:
主机端口:
命令:
系统控制
-w
vm.max\u map\u count=262144
环境:
挂载:
/来自default-token-tmqp9(ro)的var/run/secrets/kubernetes.io/serviceCount
容器:
弹性搜索:
图片:docker.elastic.co/elasticsearch/elasticsearch:7.12.0
端口:9200/TCP、9300/TCP
主机端口:0/TCP,0/TCP
限制:
中央处理器:1
内存:2Gi
请求:
中央处理器:1
内存:2Gi
准备就绪:exec[sh-c#!/usr/bin/env bash-e
#如果节点正在启动,请等待集群准备就绪(请求参数:“wait_for_status=green&timeout=1s”)
#一旦启动,只需检查节点本身是否有响应
START\u FILE=/tmp/.es\u START\u FILE
#禁用nss缓存以避免在调用curl时填充dentry缓存
#这是使用nss<3.52的Elasticsearch Docker所必需的
导出NSS\U SDB\U使用\U缓存=否
http(){
本地路径=“${1}”
本地args=“${2}”
设置--XGET-s
如果[“$args”!=”];则
设置--“$@”$args
fi
如果[-n“${ELASTIC\u USERNAME}”]&&&[-n“${ELASTIC\u PASSWORD}”];则
设置--“$@”-u“${ELASTIC_用户名}:${ELASTIC_密码}”
fi
curl--output/dev/null-k“$@”http://127.0.0.1:9200${path}”
}
如果[-f“${START_FILE}”];则
echo“Elasticsearch已在运行,让我们检查节点是否正常”
HTTP_CODE=$(HTTP/“-w%{HTTP_CODE}”)
RC=$?
如果[${RC}-ne 0]];则
echo“curl--output/dev/null-k-XGET-s-w'{http\u code}'\${BASIC\u AUTH}”http://127.0.0.1:9200/ 使用RC${RC}失败
退出${RC}
fi
#如果ES版本为6.x,HTTP代码200和503是可容忍的,则准备就绪
如果[${HTTP_CODE}==“200”];则
出口0
elif[${HTTP_CODE}==“503”&&“7”==“6”];然后
出口0
其他的
echo“curl--output/dev/null-k-XGET-s-w'{http\u code}'\${BASIC\u AUTH}”http://127.0.0.1:9200/ 使用HTTP代码${HTTP\U代码}失败
出口1
fi
其他的
echo“等待elasticsearch集群准备就绪(请求参数:“等待状态=绿色&超时=1s”)”
如果http“/\u群集/运行状况?等待\u status=green&timeout=1s”“--失败”,则
触摸${START_FILE}
出口0
其他的
echo“集群尚未就绪(请求参数:“等待状态=绿色&超时=1s”)”
出口1
fi
fi
]延迟=10s超时=5s周期=10s#成功=3#失败=3
环境:
node.name:elasticsearch-master-0(v1:metadata.name)
cluster.initial_master_节点:elasticsearch-master-0、elasticsearch-master-1、elasticsearch-master-2、,
discovery.seed_主机:elasticsearch主机无头
cluster.name:elasticsearch
network.host:0.0.0.0
ES_JAVA_选项:-Xmx1g-Xms1g
node.data:true
node.ingest:true
node.master:true
node.ml:true
node.remote_cluster_客户端:true
挂载:
/usr/共享/elasticsearch/来自elasticsearch主机(rw)的数据
/来自default-token-tmqp9(ro)的var/run/secrets/kubernetes.io/serviceCount
条件:
类型状态
播客计划错误
卷数:
elasticsearch主机:
类型:PersistentVolumeClaim(对同一命名空间中PersistentVolumeClaim的引用)
索赔名称:elasticsearch-master-elasticsearch-master-0
只读:false
default-token-tmqp9:
类型:Secret(由Secret填充的卷)
SecretName:default-token-tmqp9
可选:false
QoS等级:Burstable
节点选择器:
容差:node.kubernetes.io/未就绪:NoExecute op=存在300秒
node.kubernetes.io/unreachable:NoExecute op=存在300秒
活动:
从消息中键入原因年龄
---- ------ ---- ---- -------
警告失败调度23s(x2/24s)默认调度程序0/3节点可用:3个pod具有未绑定的立即PersistentVolumeClaims。
[ec2-user@my-ip弹性搜索]$kubectl描述状态集-n日志弹性搜索主机
名称:elasticsearch主机
名称空间:日志
CreationTimestamp:2021年4月19日星期一03:51:58+0000
选择器:app=elasticsearch master
标签:app=elasticsearch master
app.kubernetes.io/managed by=Helm
图表=弹性搜索
传统=掌舵
释放=弹性搜索
注释:esMajorVersion:7
meta.helm.sh/release-name:elasticsearch
meta.helm.sh/release-namespace:logging
副本:所需3份|共3份
更新策略:RollingUpdate
Pods状态:0正在运行/3正在等待/0成功/0失败
Pod模板:
标签:app=elasticsearch master
图表=弹性搜索