Giter Club home page Giter Club logo

hdp-provisioning's Introduction

README

This automation tools leverage HashiCorp Terraform and Ansible playbook ansible-hadoop to build Hortonworks HDP cluster on AWS.

Usage

Set AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables, and put customized variables into terraform.tfvars.

Terraform command examples:

Generate and show an execution plan:

../terraform.sh plan

Builds or changes infrastructure:

../terraform.sh apply

Destroy specific resource:

../terraform.sh destroy -target=aws_instance.master -target=aws_instance.slave -target=aws_instance.bastion

Create VPC and subnets

Using terraform script vpc to creates a new AWS VPC and two subnets, one is public subnet, and another on is private subnet.

Create terraform variable file onto vpc directory to override default value.

cd vpc

cat > terraform.tfvars << \EOF
aws_key_name = "main"
ssh_public_key = <<KEY
your_public_key
KEY
EOF

Create AWS VPC ans subnets.

../terraform.sh graph | dot -Tpng > graph.png
../terraform.sh validate
../terraform.sh refresh -resource=aws_default_network_acl.main
../terraform.sh plan
../terraform.sh apply

Create HDP cluster

cd hdp-cluster

cat > terraform.tfvars <<\EOF
aws_vpc_id = "vpc-id"
aws_public_subnet_id = "public-subnet-id"
aws_private_subnet_id = "private-subnet-id"
aws_key_name = "main"
ssh_private_key = <<EOF
your_private_key
KEY
EOF

../terraform.sh plan
../terraform.sh apply

Get bastion instance public ip address from terraform output bastion_public_ip, and login to it.

ssh -i ~/.ssh/id_rsa bastion_public_ip

Test the instance connection:

. /home/ubuntu/.venv/bin/activate
ansible all -m ping
ansible all -m shell -a "date"

Provision HDP cluster:

cd ~/ansible-hadoop/
bash hortonworks_static.sh

The HDP build in AWS private subnet, so access Ambari can be access by ssh port forwarding:

ssh -CN -L 8080:ambari_private_ip:8080 ubuntu@bastion_public_ip
# Username: admin
# Password: admin123
open http://localhost:8080

Related documents:

hdp-provisioning's People

Contributors

mlf4aiur avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.