This repository has been archived by the owner on May 12, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 508
METRON-1434 - Ability to deploy Metron full dev as a single node (centos6) to AWS with Vagrant and AMI #916
Open
as22323
wants to merge
30
commits into
apache:master
Choose a base branch
from
as22323:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
54f44ac
added section for aws-centos6
as22323 e95d73c
Update README.md
as22323 bb91158
Update README.md
as22323 f794c87
Update README.md
as22323 dd14976
Update README.md
as22323 9779699
Update README.md
as22323 ab403dd
Update README.md
as22323 ce345e9
Update README.md
as22323 a69c231
Update README.md
as22323 6cf22e6
Update README.md
as22323 8a150df
Created Vagrantfile to deploy to aws with centos6
as22323 4c96c08
Create ansible.cfg
as22323 21ed0ee
Create README.md
as22323 04d5d1b
Create hosts
as22323 7b1b2b2
Create all
as22323 4502538
added AWS AMI instructions (3rd option for deployment)
as22323 0a22ae2
Update README.md
as22323 77a6749
added AMI id ami-93cb4ff7
as22323 fdec584
Update README.md
as22323 0c435cf
Update README.md
as22323 5b77997
Update README.md
as22323 6830b75
Added $ warning, Accepting Centos6 AMI Terms, Intro to AWS
as22323 7280d68
Added accepting terms for Centos6 AMI terms
as22323 ce50d41
Update README.md
as22323 5fd24e7
added AWS using Vagrant and AWS using a AMI
as22323 eb4dac1
Update README.md
as22323 f1e3ba6
Update README.md
as22323 e939bfd
Attemptting to change uppercase to lowercase (Metron UI)
as22323 fb960fc
Create README.md
as22323 ab45375
Create Vagrant
as22323 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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,129 @@ | ||
<!-- | ||
Licensed to the Apache Software Foundation (ASF) under one | ||
or more contributor license agreements. See the NOTICE file | ||
distributed with this work for additional information | ||
regarding copyright ownership. The ASF licenses this file | ||
to you under the Apache License, Version 2.0 (the | ||
"License"); you may not use this file except in compliance | ||
with the License. You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
--> | ||
Metron in AWS as a Single Node with CentOS 6 using Vagrant | ||
================== | ||
|
||
This project fully automates the provisioning and deployment of Apache Metron and all necessary prerequisites on a single, virtualized node in AWS EC2. | ||
|
||
Warning: Amazon will charge for the use of their resources when running Apache Metron. The amount will vary based on the number and size of hosts, along with current Amazon pricing structure. Be sure to stop or terminate all of the hosts instantiated by Apache Metron when not in use to avoid unnecessary charges. | ||
|
||
Getting Started | ||
--------------- | ||
### Amazon Web Services | ||
|
||
If you already have an Amazon Web Services account that you have used to deploy EC2 hosts, then you should be able to skip the next few steps. | ||
|
||
1. Head over to [Amazon Web Services](http://aws.amazon.com/) and create an account. As part of the account creation process you will need to provide a credit card to cover any charges that may apply. | ||
|
||
2. Create a set of user credentials through [Amazon's Identity and Access Management (IAM) ](https://console.aws.amazon.com/iam/) dashboard. On the IAM dashboard menu click "Users" and then "Create New User". Provide a name and ensure that "Generate an access key for each user" remains checked. Download the credentials and keep them for later use. | ||
|
||
3. While still in [Amazon's Identity and Access Management (IAM) ](https://console.aws.amazon.com/iam/) dashboard, click on the user that was previously created. Click the "Permissions" tab and then the "Attach Policy" button. Attach the following policies to the user. | ||
|
||
- AmazonEC2FullAccess | ||
- AmazonVPCFullAccess | ||
|
||
|
||
|
||
### Prerequisites | ||
Apache Metron uses the [official, open source CentOS 6](https://aws.amazon.com/marketplace/pp/B00NQAYLWO) Amazon Machine Image (AMI). If you have never used this AMI before then you will need to accept Amazon's terms and conditions. Navigate to the [web page for this AMI](https://aws.amazon.com/marketplace/pp/B00NQAYLWO) and "Accept Software Terms" for the "Manual Launch" tab. | ||
|
||
The computer used to deploy Apache Metron will need to have the following components installed. | ||
|
||
- [Ansible](https://github.com/ansible/ansible) (2.2.2.0) | ||
- [Docker](https://www.docker.com/community-edition) | ||
- [Vagrant](https://www.vagrantup.com) 1.8+ | ||
- [Vagrant Hostmanager Plugin](https://github.com/devopsgroup-io/vagrant-hostmanager) | ||
- [Virtualbox](https://virtualbox.org) 5.0+ | ||
- Python 2.7 | ||
- Maven 3.3.9 | ||
- C++11 compliant compiler, like [GCC](https://gcc.gnu.org/projects/cxx-status.html#cxx11) | ||
|
||
Running the following script can help validate whether you have all the prerequisites installed and running correctly. | ||
|
||
``` | ||
metron-deployment/scripts/platform-info.sh | ||
``` | ||
|
||
#### How do I install these on MacOS? | ||
|
||
Any platform that supports these tools is suitable, but the following instructions cover installation on macOS. The easiest means of installing these tools on a Mac is to use the excellent [Homebrew](http://brew.sh/) project. | ||
|
||
1. Install Homebrew by following the instructions at [Homebrew](http://brew.sh/). | ||
|
||
2. Run the following commands in a terminal to install all of the required tools. | ||
|
||
``` | ||
brew cask install vagrant virtualbox docker | ||
brew cask install caskroom/versions/java8 | ||
brew install [email protected] git | ||
pip install ansible==2.2.2.0 | ||
vagrant plugin install vagrant-hostmanager | ||
vagrant plugin install vagrant-aws | ||
vagrant plugin install vagrant-reload | ||
pip install --upgrade setuptools --user python | ||
open /Applications/Docker.app | ||
``` | ||
3. In your AWS console you need to reserve/create an AWS Elastic IP, a Subnet id, Security Group id, and a key pair (key pair name & *.pem file[remember to set permissions to chmod 400]). | ||
|
||
4. The following will clear existing Vagrant, Docker & Maven builds and deployments. WARNING - THESE STEPS WILL DISTROY ALL LOCAL DOCKER CONTAINERS AND VAGRANT BOXES. It will also create a new Vagrant box. | ||
``` | ||
vagrant halt node1 -f | ||
vagrant halt default -f | ||
vagrant destroy node1 -f | ||
vagrant destroy default -f | ||
for i in `vagrant global-status | grep virtualbox | awk '{print $1 }'` ; do vagrant destroy $i ; done | ||
vagrant global-status --prune | ||
docker rm $(docker ps -aq) | ||
osascript -e 'quit app "Docker"' | ||
open -a Docker | ||
rm -rf /../.m2/repository/* | ||
rm -rf /../.vagrant.d/boxes/* | ||
vagrant box add dummy --force https://github.com/mitchellh/vagrant-aws/raw/master/dummy.box | ||
``` | ||
5. Associate your AWS ids and key information to the following enviroment variables (enter values inside the quotes). | ||
``` | ||
export AWS_ACCESS_KEY_ID='' | ||
export AWS_SECRET_ACCESS_KEY='' | ||
export AWS_KEYNAME='' | ||
export AWS_KEYPATH='../..*.pem' | ||
export AWS_ELASTIC_IP="" | ||
export AWS_SECURITYGROUP_ID="" | ||
export AWS_SUBNET_ID="" | ||
``` | ||
6. Update your local /etc/hosts file to include AWS_ELASTIC_IP which will be tied to "node1" (do only once). | ||
``` | ||
sed -i "$AWS_ELASTIC_IP node1" /etc/hosts | ||
``` | ||
|
||
### Deploy Metron | ||
|
||
1. Ensure that the Docker service is running. | ||
|
||
2. Deploy Metron | ||
|
||
``` | ||
cd metron-deployment/development/aws-centos6 | ||
vagrant up --provider=aws | ||
``` | ||
|
||
### Explore Metron | ||
|
||
Navigate to the following resources to explore your newly minted Apache Metron environment. | ||
|
||
* [Metron Alerts](http://<elasticip>:4201) | ||
* [Ambari](http://<elasticip>:8080) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small nit - this type of roman numeral ordered list won't show up in markdown properly. Throw an extra line before the first item (so it line breaks) and replace "i)" with "1. ", and so on. You can usually experiment be hitting the "view" button on your file in github. See https://github.com/apache/metron/blob/master/metron-deployment/Kerberos-manual-setup.md for another example.