-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
568 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,3 +14,5 @@ classes/ | |
.ideaDataSources/ | ||
dataSources/ | ||
tmp.json | ||
*.retry | ||
.vagrant |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
## Installation step | ||
- Create 5 VMs using Vagrant,`cd` to `vagrant` folder and run: `./start.sh`, every VM will get a DNS name | ||
- Make sure the 5 VMs is listed in `inventory.ini` | ||
- Provision all nodes: `cd` to project root, `./provision.sh elk-all` | ||
- Deploy commands: | ||
|
||
|Command|Usage| | ||
| --- | --- | | ||
|`deploy-all.sh`|Deploy the whole ELK stack| | ||
|`deploy-es-all.sh`|Deploy all ES nodes| | ||
|`deploy-es1.sh`|Deploy es1| | ||
|`deploy-es2.sh`|Deploy es2| | ||
|`deploy-es3.sh`|Deploy es3| | ||
|`deploy-kibana.sh`|Deploy Kibana| | ||
|`deploy-logstash.sh`|Deploy Logstash| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env bash | ||
|
||
if [ -z "$1" ] | ||
then | ||
echo "Error: No inventory host provided, the host should exists in inventory.ini file, example: ./provision.sh elk-es1" | ||
exit 1 | ||
fi | ||
|
||
export ANSIBLE_HOST_KEY_CHECKING=false | ||
ansible-playbook -i inventory.ini -v provision-playbook.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
--- | ||
- name: Deploy Elasticsearch node1 | ||
hosts: es1 | ||
become: yes | ||
roles: | ||
- elasticsearch | ||
tags: | ||
- es | ||
- es1 | ||
|
||
- name: Deploy Elasticsearch node2 | ||
hosts: es2 | ||
become: yes | ||
roles: | ||
- elasticsearch | ||
tags: | ||
- es | ||
- es2 | ||
|
||
- name: Deploy Elasticsearch node3 | ||
hosts: es3 | ||
become: yes | ||
roles: | ||
- elasticsearch | ||
tags: | ||
- es | ||
- es3 | ||
|
||
|
||
- name: Deploy Kibana | ||
hosts: kibana | ||
become: yes | ||
roles: | ||
- kibana | ||
tags: | ||
- kibana | ||
|
||
- name: Deploy Logstash | ||
hosts: logstash | ||
become: yes | ||
roles: | ||
- logstash | ||
tags: | ||
- logstash | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
### Introduction | ||
- 5 nodes centos7 cluster with DHCP private network and DNS enabled | ||
- network: private(host and vm can access each other) | ||
- memory: 8096 | ||
- cpu: 4 | ||
- First step: install `landrush` vagrant plugin | ||
|
||
``` bash | ||
vagrant plugin install landrush | ||
``` | ||
- Remember to run `vagrant landrush stop` when you switch wifi | ||
- start: `./start.sh` | ||
- destroy: `./destroy.sh` | ||
- Login: `vagrant ssh nodeName` | ||
- your own public key uploaded to the vm to enable generic SSH | ||
- DNS name:`[xxx].vagrant.local` | ||
|
||
## Node usage | ||
|
||
|Domain Name|Usage| | ||
| --- | --- | | ||
|es1.vagrant.local|ES node 1| | ||
|es2.vagrant.local|ES node 2| | ||
|es3.vagrant.local|ES node 3| | ||
|kibana.vagrant.local|Kibana| | ||
|logstash.vagrant.local|Logstash with Redis as input| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
tld="vagrant.local" | ||
|
||
Vagrant.configure("2") do |config| | ||
config.vm.box = "centos/7" | ||
config.vm.provision "file", source: "~/.ssh/id_rsa.pub", destination: "~/.ssh/my_id_rsa.pub" | ||
config.vm.provision "shell", inline: "cat ~/.ssh/my_id_rsa.pub >> ~/.ssh/authorized_keys", privileged: false | ||
|
||
config.landrush.enabled = true | ||
config.landrush.tld = tld | ||
|
||
(1..3).each do |i| | ||
config.vm.define "es#{i}" do |node| | ||
hostName="es#{i}."+tld | ||
node.vm.hostname = hostName | ||
node.vm.network "private_network", type: "dhcp" | ||
node.vm.provider "virtualbox" do |v| | ||
v.memory = 8192 | ||
v.cpus = 4 | ||
v.name = hostName | ||
end | ||
end | ||
end | ||
|
||
|
||
config.vm.define "kibana" do |node| | ||
hostName="kibana."+tld | ||
node.vm.hostname = hostName | ||
node.vm.network "private_network", type: "dhcp" | ||
node.vm.provider "virtualbox" do |v| | ||
v.memory = 8192 | ||
v.cpus = 4 | ||
v.name = hostName | ||
end | ||
end | ||
|
||
config.vm.define "logstash" do |node| | ||
hostName="logstash."+tld | ||
node.vm.hostname = hostName | ||
node.vm.network "private_network", type: "dhcp" | ||
node.vm.provider "virtualbox" do |v| | ||
v.memory = 8192 | ||
v.cpus = 4 | ||
v.name = hostName | ||
end | ||
end | ||
|
||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/usr/bin/env bash | ||
vagrant destroy -f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env bash | ||
vagrant destroy -f | ||
vagrant up |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[elk-all] | ||
es1 ansible_ssh_host=es1.vagrant.local ansible_user=vagrant | ||
es2 ansible_ssh_host=es2.vagrant.local ansible_user=vagrant | ||
es3 ansible_ssh_host=es3.vagrant.local ansible_user=vagrant | ||
kibana ansible_ssh_host=kibana.vagrant.local ansible_user=vagrant | ||
logstash ansible_ssh_host=logstash.vagrant.local ansible_user=vagrant | ||
|
||
[nexus-all] | ||
nexus ansible_ssh_host=nexus.vagrant.local ansible_user=vagrant |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
- hosts: "{{ host }}" | ||
vars: | ||
docker_registry_host: nexus.vagrant.local:5000 | ||
docker_registry_user: changeme | ||
docker_registry_password: changeme | ||
become: yes | ||
roles: | ||
- provision |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env bash | ||
|
||
if [ -z "$1" ] | ||
then | ||
echo "Error: No inventory host provided, the host should exists in inventory.ini file, example: ./provision.sh elk-es1" | ||
exit 1 | ||
fi | ||
|
||
export ANSIBLE_HOST_KEY_CHECKING=false | ||
ansible-playbook -i inventory.ini -v provision-playbook.yml --extra-vars "host=$1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
- Every Vagrant VM needs to do provision. | ||
- The provision process contains: | ||
- docker and docker-compose | ||
- Beijing Time | ||
- Disable SELinux | ||
- SSH user with in docker/wheel group |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--- | ||
docker_data_dir: /var/lib/docker |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
- name: Reboot system | ||
reboot: |
Oops, something went wrong.