How to create a Centos7 CDP-DC Base VM for sandbox/learning purposes
$ cd ~
$ mkdir cdpvm
$ cd cdpvm
$ wget https://cloud.centos.org/centos/7/vagrant/x86_64/images/CentOS-7-x86_64-Vagrant-2004_01.VirtualBox.box
$ wget https://raw.githubusercontent.com/carrossoni/CDPDCTrial/master/scripts/VMSetup.sh
- Go to the folder that you've downloaded your VM file (cd ~/cdpvm) and initialize the Virtual Machine using the following command:
$ vagrant box add CentOS-7-x86_64-Vagrant-2004_01.VirtualBox.box --name centos7
$ vagrant plugin install vagrant-disksize
$ vagrant init centos7
- After this step, you should have a file called "Vagrantfile" in the same directory, open the file with an editor (vim for example) and below the line config.vm.box = "centos7" add the following:
config.vm.network "public_network"
config.vm.network :forwarded_port, guest: 7180, host: 7180
config.vm.network :forwarded_port, guest: 8889, host: 8889
config.vm.network :forwarded_port, guest: 9870, host: 9870
config.vm.network :forwarded_port, guest: 6080, host: 6080
config.vm.network :forwarded_port, guest: 21050, host: 21050
config.vm.hostname = "localhost"
config.disksize.size = "80GB"
config.vm.provision "shell", path: "VMSetup.sh"
config.vm.provider "virtualbox" do |vb|
# Display the VirtualBox GUI when booting the machine
vb.gui = true
# Customize the amount of memory on the VM:
vb.memory = "12024"
vb.cpus = "8"
end
- Save the file and now we can init and bring up the VM:
$ vagrant up
- Now it'll ask to bridge to your public network (only for the first time) normally it's the one that you're connected on the internet, in my case is en0:

- After this, the VM will be provisioned and automated CDP process will start, this will take up to one hour depending on your connection since also it'll configure the VM and also install all the components for Cloudera Manager and the Services in an automated process located in https://github.com/carrossoni/CDPDCTrial/
- The template and the cluster created at the end will contain the following services:
HUE
HDFS
Hive Metastore
Impala
Ranger
Zookeeper
- After the install you can add more services like Nifi, Kafka etc. depending on the number of resources that you've reserved for the VM.
- After the execution you should see the exit below (this will take up about 30 min to one hour depending on your connection since it'll download all the packages and parcels necessary for provisioning CDP Runtime):

- After this the VM will reboot to do a fresh start, wait around 5 minutes for the services spin up and go to the next step.
- Troubleshooting:
- If the install process failed, likely it's a problem during the VM configuration if CM was installed you can try going to https://localhost:7180 directrly and finish the install process manually via Cloudera Manager UI
- To ssh there's two options, the easy one is to simple go to directory that the Vagrantfile is located (that you have used to perform the setup of the VM) and type:
$ vagrant ssh
- The other option is to configure your VM in the Virtualbox UI to attach a USB and copy the clouderakey.pem file that was created during the automation process. Then you are able to ssh the machine via "ssh -i clouderakey.pem vagrant@cloudera"
After ssh using both scenarios you can sudo the box and start looking the machine, try to see if the hostname and ip in /etc/hosts is configured properly (most common issue since depends of your machine network).
If after the template import you have an error message, cloudera manager can show what's happening, work in the error and then resume the import cluster template process in the running commands tab. If you are in this step now normally is a matter to view logs and/or see if there isn't resources available, at the end you can restart the cluster to see if it's something that was stuck. This is normal since we are working in a constrained environment.
Step 2: Cloudera Data Platform Access
- After the automated process our CDP Runtime is ready (actually we've provisioned in only one step)! In your machine browser you can connect to the CM with the following URL:
http://localhost:7180

- Password will be admin/admin after the first login you can choose the 60-day trial option and click in "Continue":

- The Welcome page appears, click in the Cloudera Logo on the top left since we've already added a new cluster with the automated process:


- At this point all the services are initiated, some errors may happen since we are working on a resource constraint environment, usually follow the logs that it'll be easy to see in Cloudera Manager what's happening, also you can suppress warning messages if it's not something critical.













