Commit 11f1e1c3 by ChongmingDu

elk mod

parent dda718b4
#!/bin/bash
yum -y install epel-release
yum -y install python-pip
pip install docker-compose
echo "vm.max_map_count = 262144" > /etc/sysctl.conf
#install elasticsearch
# rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
# sudo yum install elasticsearch
# systemctl start elasticsearch.service
# systemctl enalbe elasticsearch.service
#bulid docker compose
cat<< EOF >docker-compose.yml
version: '2.2'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:5.6.12
environment:
discovery.type: single-node
stdin_open: true
tty: true
volumes:
- ./es_data:/
ports:
- 9200:9200/tcp
labels:
io.rancher.container.pull_image: always
kibana:
image: docker.elastic.co/kibana/kibana:5.6.12
environment:
ELASTICSEARCH_URL: http://elasticsearch:9200
stdin_open: true
tty: true
links:
- elasticsearch:elasticsearch
ports:
- 5601:5601/tcp
labels:
io.rancher.container.pull_image: always
EOF
docker-compose up &
\ No newline at end of file
---
- name: "copy elk shell"
copy:
src: elk.sh
dest: /root/elk.sh
- name: "run elk shell script"
shell: /bin/bash /root/elk.sh
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment