fix elasticsearch by creating a distributed glusterfs filesystem for elasticsearch data

update graylog
This commit is contained in:
2017-06-16 22:47:03 -04:00
parent 7e22e561cd
commit 76c0d85fb9
8 changed files with 41 additions and 125 deletions

View File

@@ -56,10 +56,11 @@
jenkins: jenkins:
host: gluster:/jenkins host: gluster:/jenkins
mount: /var/lib/jenkins mount: /var/lib/jenkins
elasticsearch:
host: gluster:/elasticsearch
mount: /data/elasticsearch
roles: roles:
# - _install_updates
# - Datadog.datadog
- dockerhost - dockerhost
- geerlingguy.nginx - geerlingguy.nginx
- certbot - certbot

View File

@@ -1,40 +0,0 @@
---
# docker-compose file for graylog
# DOCKER_HOST=dkhost03:2376 docker-compose up -d
# DOCKER_HOST=dkhost03:2376 docker stack deploy -c docker-compose.yml graylog
version: '3'
services:
graylog:
image: graylog2/server:latest
volumes:
- /opt/shared/graylog/data/journal:/usr/share/graylog/data/journal
- /opt/shared/graylog/config:/usr/share/graylog/data/config
environment:
GRAYLOG_PASSWORD_SECRET: gsahu1dj901hdaiuafg3g1q
GRAYLOG_ROOT_PASSWORD_SHA2: d0fc133359968fbc38a267f29606c9dc805af7bcc231df9b9acd2e8e6e894ede
GRAYLOG_WEB_ENDPOINT_URI: http://logs.xai-corp.net:10090/api/
GRAYLOG_REST_LISTEN_URI: http://0.0.0.0:9000/api/
GRAYLOG_MONGODB_URI: mongodb://mongo/graylog
GRAYLOG_ELASTICSEARCH_CLUSTER_NAME: es.xai-corp.net
depends_on:
- mongo
- elasticsearch
ports:
- "10090:9000"
- "12201:12201/udp"
- "1514:1514/udp"
- "514:514/udp
deploy:
mode: replicated
replicas: 1
restart_policy:
condition: any
delay: "1s"
max_attempts: 3
networks:
default:
external:
name: prod-private

View File

@@ -1,26 +0,0 @@
---
# docker-compose file for graylog
# DOCKER_HOST=dkhost03:2376 docker-compose up -d
# DOCKER_HOST=dkhost03:2376 docker stack deploy -c docker-compose.yml graylog
version: '3'
services:
test:
image: alpine
command: ping nosql
depends_on:
- mongo
- elasticsearch
deploy:
mode: replicated
replicas: 1
restart_policy:
condition: any
delay: "1s"
max_attempts: 3
networks:
default:
external:
name: prod-private

View File

@@ -6,46 +6,6 @@
version: '3' version: '3'
services: services:
mongo:
image: "mongo:3"
volumes:
- /opt/shared/graylog/data/mongo:/data/db
ports:
- "27017:27017"
deploy:
mode: replicated
replicas: 1
restart_policy:
condition: any
delay: "1s"
max_attempts: 10
resources:
limits:
cpus: '0.1'
memory: 512M
elasticsearch:
image: "elasticsearch:2"
command: "elasticsearch -Des.cluster.name='graylog'"
volumes:
- /opt/shared/graylog/data/elasticsearch:/usr/share/elasticsearch/data
ports:
- "9350:9350"
- "9300:9300"
- "9200:9200"
- "10091:80"
deploy:
mode: replicated
replicas: 1
restart_policy:
condition: any
delay: "1s"
max_attempts: 10
resources:
limits:
cpus: '0.1'
memory: 512M
graylog: graylog:
image: graylog2/server:latest image: graylog2/server:latest
volumes: volumes:
@@ -54,9 +14,10 @@ services:
environment: environment:
GRAYLOG_PASSWORD_SECRET: gsahu1dj901hdaiuafg3g1q GRAYLOG_PASSWORD_SECRET: gsahu1dj901hdaiuafg3g1q
GRAYLOG_ROOT_PASSWORD_SHA2: d0fc133359968fbc38a267f29606c9dc805af7bcc231df9b9acd2e8e6e894ede GRAYLOG_ROOT_PASSWORD_SHA2: d0fc133359968fbc38a267f29606c9dc805af7bcc231df9b9acd2e8e6e894ede
GRAYLOG_WEB_ENDPOINT_URI: http://logs.xai-corp.net:10090/api/ GRAYLOG_WEB_ENDPOINT_URI: https://logs.xai-corp.net/api/
GRAYLOG_REST_LISTEN_URI: http://0.0.0.0:9000/api/ GRAYLOG_REST_LISTEN_URI: http://0.0.0.0:9000/api/
GRAYLOG_MONGODB_URI: mongodb://mongo/graylog GRAYLOG_MONGODB_URI: mongodb://mongo/graylog
GRAYLOG_ELASTICSEARCH_CLUSTER_NAME: es.xai-corp.net
depends_on: depends_on:
- mongo - mongo
- elasticsearch - elasticsearch
@@ -64,10 +25,16 @@ services:
- "10090:9000" - "10090:9000"
- "12201:12201/udp" - "12201:12201/udp"
- "1514:1514/udp" - "1514:1514/udp"
- "514:514/udp"
deploy: deploy:
mode: replicated mode: replicated
replicas: 1 replicas: 1
restart_policy: restart_policy:
condition: any condition: any
delay: "1s" delay: "1s"
max_attempts: 10 max_attempts: 3
networks:
default:
external:
name: prod-private

View File

@@ -1,7 +1,7 @@
--- ---
# docker-compose file for graylog # docker-compose file for graylog
# DOCKER_HOST=dkhost03:2376 docker-compose up -d # DOCKER_HOST=dkhost03:2376 docker-compose up -d
# DOCKER_HOST=dkhost03:2376 docker stack deploy -c docker-compose-elasticsearch.yml services # DOCKER_HOST=dkhost03:2376 docker stack deploy -c docker-compose.yml services
version: '3' version: '3'
services: services:
@@ -11,8 +11,8 @@ services:
# image: docker.elastic.co/elasticsearch/elasticsearch:5.4.1 # image: docker.elastic.co/elasticsearch/elasticsearch:5.4.1
command: "elasticsearch -Des.cluster.name='es.xai-corp.net'" command: "elasticsearch -Des.cluster.name='es.xai-corp.net'"
volumes: volumes:
- /opt/shared/elasticsearch/data:/usr/share/elasticsearch/data - /data/elasticsearch/data:/usr/share/elasticsearch/data
- /opt/shared/elasticsearch/confg:/usr/share/elasticsearch/config - /data/elasticsearch/config:/usr/share/elasticsearch/config
ports: ports:
# - "9350:9350" # - "9350:9350"
# - "9300:9300" # - "9300:9300"
@@ -24,23 +24,23 @@ services:
restart_policy: restart_policy:
condition: any condition: any
delay: "1s" delay: "1s"
max_attempts: 3 max_attempts: 1
resources: resources:
limits: limits:
cpus: '1' cpus: '1'
memory: 512M memory: 512M
ui: ui:
image: appbaseio/dejavu image: mobz/elasticsearch-head:2
ports: ports:
- "1358:1358" - "1358:9100"
deploy: deploy:
mode: replicated mode: replicated
replicas: 1 replicas: 1
restart_policy: restart_policy:
condition: any condition: any
delay: "1s" delay: "1s"
max_attempts: 3 max_attempts: 1
networks: networks:

View File

@@ -1,7 +1,7 @@
--- ---
# docker-compose file for graylog # docker-compose file for graylog
# DOCKER_HOST=dkhost03:2376 docker-compose up -d # DOCKER_HOST=dkhost03:2376 docker-compose up -d
# DOCKER_HOST=dkhost03:2376 docker stack deploy -c docker-compose-mongodb.yml services # DOCKER_HOST=dkhost03:2376 docker stack deploy -c docker-compose.yml services
version: '3' version: '3'
services: services:

View File

@@ -16,6 +16,7 @@
- /data/glusterfs/gitea/brick1 - /data/glusterfs/gitea/brick1
- /data/glusterfs/jenkins/brick1 - /data/glusterfs/jenkins/brick1
- /data/glusterfs/tmp/brick1 - /data/glusterfs/tmp/brick1
- /data/glusterfs/elasticsearch/brick1
volumes: volumes:
vmshares: vmshares:
- /data/glusterfs/vmshares/brick1/brick - /data/glusterfs/vmshares/brick1/brick
@@ -23,8 +24,11 @@
- /data/glusterfs/gitea/brick1/brick - /data/glusterfs/gitea/brick1/brick
jenkins: jenkins:
- /data/glusterfs/jenkins/brick1/brick - /data/glusterfs/jenkins/brick1/brick
# tmp: distributed_volumes:
# - /data/glusterfs/tmp/brick1/brick tmp:
- /data/glusterfs/tmp/brick1/brick
elasticsearch:
- /data/glusterfs/elasticsearch/brick1/brick
roles: roles:
- glusterfs - glusterfs

View File

@@ -34,13 +34,23 @@
with_dict: "{{volumes}}" with_dict: "{{volumes}}"
run_once: true run_once: true
# manage volumes #- name: create tmp gluster volumes
- name: create tmp gluster volumes # gluster_volume:
# state: present
# name: "tmp"
# brick: '/data/glusterfs/tmp/brick1/brick'
# rebalance: no
# replicas: 1
# cluster: "{{cluster}}"
# run_once: true
- name: create distributed gluster volumes
gluster_volume: gluster_volume:
state: present state: present
name: "tmp" name: "{{ item.key }}"
brick: '/data/glusterfs/tmp/brick1/brick' brick: '{{ item.value | join(",")}}'
rebalance: no rebalance: no
replicas: 2 replicas: false
cluster: "{{cluster}}" cluster: "{{cluster}}"
with_dict: "{{distributed_volumes}}"
run_once: true run_once: true