Skip to content

Instantly share code, notes, and snippets.

View nightmareze1's full-sized avatar

nightmareze1 nightmareze1

View GitHub Profile
[root@ip-10-91-41-215 elk]# docker-compose up --build -d
Creating network "elk_default" with the default driver
Building elasticsearch
Step 1/2 : FROM elasticsearch:5.5.2
---> d1ac13423d3c
Step 2/2 : RUN elasticsearch-plugin install --batch repository-s3
---> Using cache
---> c460367269f5
Successfully built c460367269f5
Successfully tagged elk_elasticsearch:latest
root@jenkins:/kubespray# cat inventory/prod/hosts.ini
[all]
node1 ansible_host=172.16.250.180 ip=172.16.250.180
node2 ansible_host=172.16.250.181 ip=172.16.250.181
node3 ansible_host=172.16.250.182 ip=172.16.250.182
node4 ansible_host=172.16.250.190 ip=172.16.250.190
node5 ansible_host=172.16.250.191 ip=172.16.250.191
[kube-master]
node1
root@jenkins:/kubespray# git diff roles/container-engine/docker/handlers/main.yml
diff - git a/roles/container-engine/docker/handlers/main.yml b/roles/container-engine/docker/handlers/main.yml
index a43d843..6172d79 100644
- - a/roles/container-engine/docker/handlers/main.yml
+++ b/roles/container-engine/docker/handlers/main.yml
@@ -17,10 +17,17 @@
state: restarted
when: ansible_os_family in ['CoreOS', 'Container Linux by CoreOS']
- name: Docker | reload docker
service:
provider "vsphere" {
user = "Administrator@vsphere.local"
password = "PEPITOOOO"
vsphere_server = "VCENTER_IP"
allow_unverified_ssl = "true"
}
data "vsphere_datacenter" "dc" {
name = "DATACENTER"
}
root@jenkins:/haproxy-ansible-kubernetes/ansible/inventory/group_vars# cat haproxy/haproxy.yml
---
haproxy_global_maxconn: 50000
haproxy_global_ulimit: 100042
haproxy_frontends:
- name: 'openshift_router_http'
bind: '*:80'
backends:
- 'openshift_router80'
[root@ip-10-91-41-215 elk]# curl -XGET 'http://localhost:9200/_cluster/allocation/explain' | jq
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 728 100 728 0 0 728 0 0:00:01 --:--:-- 0:00:01 118k
{
"index": "fluentd-20181229",
"shard": 4,
"primary": false,
"current_state": "unassigned",
"unassigned_info": {
Later, The reconfigured all indices with corrects replica the result is:
[root@ip-10-91-41-215 elk]# curl -XGET 'http://localhost:9200/_cat/indices?v'
health status index uuid pri rep docs.count docs.deleted store.size pri.store.size
green open store_zone_pivots1520 ojStgKkbT8Wx1G_CE8XZKw 10 0 457845 0 64.7mb 64.7mb
green open store_zone_pivots1532 nNb0lnM2QpiFZPsFA1GS6Q 10 0 21122 0 65.5mb 65.5mb
green open store_zone_pivots1545 s41e_9wzRKGAojZ4L2amFA 10 0 457937 0 964.8mb 964.8mb
green open store_zone_pivots1541 OQvZFYflTI6vv8Bjc0YBJw 10 0 628574 46450 1.6gb 1.6gb
green open zones33 PuevnPN5QjK9crXabb9ggA 1 0 13 0 267.3kb 267.3kb
green open .kibana QqPVdBAETziTLQvFiN96pw 1 0 3 0 15.1kb 15.1kb
[root@ip-10-91-41-215 elk]# curl -XPUT 'localhost:9200/store_zone_pivots1520/_settings' -d '{"number_of_replicas": 0}'
[root@ip-10-91-41-215 elk]# curl -XGET 'http://localhost:9200/_cat/indices?v
health status index uuid pri rep docs.count docs.deleted store.size pri.store.size
green open store_zone_pivots1520 ojStgKkbT8Wx1G_CE8XZKw 10 0 457845 0 964.7mb 964.7mb
green open fluentd-20181228 nNb0lnM2QpiFZPsFA1GS6Q 10 0 21122 0 65.5mb 65.5mb
[root@ip-10-91-41-215 elk]# curl -X POST "http://localhost:9200/_snapshot/es-backups/mysnapshot/_restore" -d '{
"indices": [
"store_zone_pivots1520"
],
"ignore_unavailable": true,
"include_global_state": false
}'
[root@ip-10-91-41-215 elk]# curl -XDELETE 'http://localhost:9200/_all'
{"acknowledged":true}
[root@ip-10-91-41-215 elk]# curl -XPOST 'http://localhost:9200/_snapshot/es-backups/mysnapshot/_restore'
[root@ip-10-91-41-215 elk]# curl -XGET 'http://localhost:9200/_cat/indices?v'
health status index uuid pri rep docs.count docs.deleted store.size pri.store.size
yellow open store_zone_pivots1520 ojStgKkbT8Wx1G_CE8XZKw 10 5 457845 0 964.7mb 964.7mb
yellow open store_zone_pivots1532 nNb0lnM2QpiFZPsFA1GS6Q 10 7 21122 0 65.5mb 65.5mb
yellow open store_zone_pivots1545 s41e_9wzRKGAojZ4L2amFA 10 8 457937 0 964.8mb 964.8mb
yellow open store_zone_pivots1541 OQvZFYflTI6vv8Bjc0YBJw 10 5 628574 46450 1.6gb 1.6gb