Last active
October 30, 2015 14:52
-
-
Save bartekdobija/6a95b5c7352e85d0d401 to your computer and use it in GitHub Desktop.
Cloudera Vagrantfile
This file contains hidden or 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
| $dependency_installation = <<SCRIPT | |
| CLOUDERA_REPO=http://archive.cloudera.com/cdh5/redhat/6/x86_64/cdh/cloudera-cdh5.repo | |
| ANACONDA_INSTALLER=https://3230d63b5fc54e62148e-c95ac804525aac4b6dba79b00b39d1d3.ssl.cf1.rackcdn.com/Anaconda-2.3.0-Linux-x86_64.sh | |
| DEV_USER=hadoop_oozie | |
| DEV_PASSWORD=hadoop | |
| # Anaconda installation | |
| [ ! -d "/usr/local/anaconda" ] \ | |
| && echo "Installing Anaconda..." \ | |
| && wget ${ANACONDA_INSTALLER} -q -P /tmp/ \ | |
| && bash /tmp/Anaconda-2.3.0-Linux-x86_64.sh -b -f -p /usr/local/anaconda | |
| # Add Cloudera repository | |
| [ ! -e /etc/yum.repos.d/cloudera-cdh5.repo ] \ | |
| && wget ${CLOUDERA_REPO} -q -P /etc/yum.repos.d/ \ | |
| && yum clean all | |
| # Cloudera Hadoop installation | |
| yum install -y hadoop zookeeper oozie sqoop hive hive-metastore hive-server2 hive-hcatalog hive-jdbc avro-libs pig kite impala* | |
| # Add a dev user - don't worry about the password | |
| if ! grep ${DEV_USER} /etc/passwd; then | |
| echo "Creating user ${DEV_USER}" && useradd -p $(openssl passwd -1 ${DEV_PASSWORD}) ${DEV_USER} \ | |
| && echo "${DEV_USER} ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/hadoop_oozie | |
| fi | |
| SCRIPT | |
| Vagrant.configure(2) do |config| | |
| config.vm.box = "boxcutter/centos66" | |
| config.vm.hostname = "cdh.home.com" | |
| config.vm.network :public_network, bridge: "en0: Wi-Fi (AirPort)" | |
| config.vm.provider "virtualbox" do |vb| | |
| vb.name = "vagrant-cdh" | |
| vb.cpus = 4 | |
| vb.memory = 8192 | |
| vb.customize ["modifyvm", :id, "--cpuexecutioncap", "100"] | |
| end | |
| config.vm.provision :shell, :name => "dep_installer", :inline => $dependency_installation | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment