├── .gitignore ├── Vagrantfile ├── provision-base.sh └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .vagrant 3 | *.box 4 | *.iml -------------------------------------------------------------------------------- /Vagrantfile: -------------------------------------------------------------------------------- 1 | # -*- mode: ruby -*- 2 | # vi: set ft=ruby : 3 | 4 | Vagrant.configure("2") do |config| 5 | config.vm.box = "centos/7" 6 | 7 | config.vm.box_check_update = true 8 | 9 | config.vbguest.auto_update = false 10 | 11 | config.vbguest.no_remote = true 12 | 13 | config.vbguest.no_install = true 14 | 15 | config.vm.network "private_network", type: "dhcp" 16 | 17 | # workaround for known issue #2 https://seven.centos.org/2016/12/updated-centos-vagrant-images-available-v1611-01/ 18 | config.vm.synced_folder ".", "/vagrant", disabled: true 19 | 20 | config.vm.provider "virtualbox" do |v| 21 | v.memory = 2048 22 | v.cpus = 2 23 | v.name = 'base.hdp.local' 24 | end 25 | 26 | config.vm.provision "base", type: "shell", path: "provision-base.sh" 27 | 28 | end -------------------------------------------------------------------------------- /provision-base.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # installing required libraries 4 | echo '******* installing required libraries' 5 | yum install scp curl unzip tar wget ntp openssl-devel gcc kernel-devel java-1.8.0-openjdk-devel.x86_64 -y 6 | 7 | # set JAVA_HOME 8 | echo '******* setting JAVA_HOME' 9 | echo "export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk" >> /etc/profile.d/java_env.sh 10 | 11 | # enabling yum fastcache 12 | echo '******* enabling yum fastcache' 13 | yum makecache fast 14 | 15 | # clean yum 16 | echo '******* cleaning yum' 17 | yum clean all 18 | 19 | # update all yum libraries 20 | echo '******* updating all libraries' 21 | yum update -y 22 | 23 | # start ntp as required by HDP 24 | echo '******* installing ntp' 25 | systemctl start ntpd 26 | systemctl enable ntpd 27 | 28 | # disable firewalld as required by HDP 29 | echo '******* disabling firewalld' 30 | systemctl stop firewalld 31 | systemctl disable firewalld 32 | 33 | # disable transparent huge pages as required by HDP 34 | echo '******* disabling transparent huge pages' 35 | echo never > /sys/kernel/mm/transparent_hugepage/enabled 36 | 37 | # disable selinux 38 | echo '******* sestatus before' 39 | sestatus 40 | 41 | echo '******* disabling SELinux' 42 | sed -i "s/^SELINUX=.*/SELINUX=disabled/g" /etc/sysconfig/selinux 43 | sed -i "s/^SELINUX=.*/SELINUX=disabled/g" /etc/selinux/config 44 | 45 | echo '******* sestatus after' 46 | sestatus 47 | 48 | # fix timezone 49 | echo '******* date before' 50 | date 51 | 52 | echo '******* updating timezone' 53 | rm -rf /etc/localtime 54 | ln -s /usr/share/zoneinfo/America/New_York /etc/localtime 55 | 56 | echo '******* date after' 57 | date 58 | 59 | echo '******* update ulimit' 60 | ulimit -n 10000 61 | 62 | echo '******* update umask' 63 | echo umask 0022 >> /etc/profile 64 | 65 | # clean yum 66 | echo '******* cleaning yum' 67 | yum clean all 68 | rm -rf /var/cache/yum -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | >**Most of my focus is now on building Hadoop clusters in Docker. See https://github.com/timveil/docker-hadoop. This repository is no longer maintained.** 2 | 3 | # HDP Vagrant Base 4 | 5 | ## Overview 6 | 7 | This is a Vagrant box that can serve as a sensible base to install the Hortonworks Data Platform (HDP). This box is based on Centos 7 (https://atlas.hashicorp.com/centos/boxes/7) and includes the below 8 | modifications, consistent with Hortonworks documentation (http://docs.hortonworks.com/) 9 | 10 | ## Modifications 11 | 12 | * installation of the following packages 13 | * scp 14 | * curl 15 | * unzip 16 | * tar 17 | * wget 18 | * ntp 19 | * openssl-devel 20 | * gcc (required for VirtualBox Guest Additions) 21 | * kernel-devel (required for VirtualBox Guest Additions) 22 | * java-1.8.0-openjdk-devel.x86_64 (Java to be used by HDP, etc.) 23 | * set `JAVA_HOME` 24 | * enabling yum `fastcache` 25 | * update all yum packages and clean yum history 26 | * enabling and starting `ntp` 27 | * disabling `firewalld` 28 | * disabling `transparent huge pages` 29 | * disabling `selinux` 30 | * updating timezone to New York 31 | * increasing `ulimit` 32 | * updating `umask` 33 | 34 | ## Usage 35 | 36 | To run, execute the following 37 | 38 | ```bash 39 | vagrant up --provider virtualbox 40 | ``` 41 | 42 | ## Release Notes 43 | 44 | The latest release is `v1.0.15`. For detailed release information see https://app.vagrantup.com/timveil/boxes/centos7-hdp-base 45 | 46 | ## Development Notes 47 | 48 | Before packaging box, make sure to change both `vagrant` and `root` password to `vagrant` 49 | 50 | ```bash 51 | sudo su - 52 | 53 | # change root password 54 | passwd 55 | 56 | # change vagrant password 57 | passwd vagrant 58 | ``` 59 | 60 | To package and deploy see https://scotch.io/tutorials/how-to-create-a-vagrant-base-box-from-an-existing-one 61 | 62 | ```bash 63 | vagrant package --output centos7-hdp-base.box 64 | vagrant box add centos7-hdp-base centos7-hdp-base.box --force 65 | ``` 66 | 67 | 68 | --------------------------------------------------------------------------------