...
From the terminal window on the VM where you want to run the main Ambari service, download the Ambari repository. The following commands download Ambari version 2.4.1.0 and install
ambari-server
. To install a different version of Ambari, specify the appropriate repo URL. Choose the appropriate commands for the operating system on your VMs:OS Commands CentOS 6 wget -nv http://public-repo-1.hortonworks.com/ambari/centos6/2.x/updates/2.4.1.0/ambari.repo -O /etc/yum.repos.d/ambari.repo
yum install ambari-server -yCentOS 7 wget -nv http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.4.1.0/ambari.repo -O /etc/yum.repos.d/ambari.repo
yum install ambari-server -yUbuntu 12 wget -nv http://public-repo-1.hortonworks.com/ambari/ubuntu12/2.x/updates/2.4.1.0/ambari.list -O /etc/apt/sources.list.d/ambari.list
apt-key adv --recv-keys --keyserver keyserver.ubuntu.com B9733A7A07513CAD
apt-get update
apt-get install ambari-server -yUbuntu 14 wget -nv http://public-repo-1.hortonworks.com/ambari/ubuntu14/2.x/updates/2.4.1.0/ambari.list -O /etc/apt/sources.list.d/ambari.list
apt-key adv --recv-keys --keyserver keyserver.ubuntu.com B9733A7A07513CAD
apt-get update
apt-get install ambari-server -yTo install Ambari with default settings, set up and start
ambari-server
:Code Block ambari-server setup -s ambari-server start
For more information about installation options and settings, see Apache Ambari Installation.
After Ambari Server has started, launch a browser on your host machine (Mac). Access the Ambari Web UI at
http://<hostname>.ambari.apache.org:8080
. The<hostname>
part of the URL specifies the VM where you installed Ambari; for example:Code Block http://c7001.ambari.apache.org:8080
Note: The Ambari Server can take some time to launch and be ready to accept connections. Keep trying the URL until you see the login page.
Login using default username
admin
, passwordadmin
.Choose On the welcome page, choose "Launch Install Wizard."
Specify a name for your cluster, and then click Next.
On the Select Version page, choose which version of HDP to install, and then click Next.
On the Install Options page, list the FQDNs of the virtual machines. For example:
Code Block c7001.ambari.apache.org c7002.ambari.apache.org c7003.ambari.apache.org
Alternatively, you can use a range expression:
Code Block c70[01-03].ambari.apache.org
Upload the
insecure_private_key
file that you created earlier: browse to theambari-vagrant
directory, navigate to the operating system folder for your VM's, and choose the key file.Specify non-root SSH user
vagrant
.Continue stepping through Installation Wizard, completing onscreen instructions to install your cluster.
...
A Vagrant snapshot saves the current state of a VM so that you can restart the VM from the same point at a future time. Vagrant makes it easy to take snapshots of the entire cluster. (Note: the following plugin overrides the default snapshot command in Vagrant.)
Install the snapshot Install the snapshot plugin:
Code Block vagrant plugin install vagrant-vbox-snapshot --plugin-version=0.0.2
This enables the “vagrant snapshot” command. Note that the above installs version 0.0.2, which allows you to take snapshots of the whole cluster at the same time. Later versions do not support this feature.
Run
vagrant snapshot
to see the syntax. Runvagrant snapshot <command> -h
for more information about a specific command. Here is a summary of commands:
vagrant snapshot back # restore most recent snapshot
vagrant snapshot delete <SNAPSHOT_NAME> # delete specified snapshot
vagrant snapshot go [vm-name] <SNAPSHOT_NAME> # restore specified snapshotvagrant snapshot list # list snapshots
vagrant snapshot take [vm-name] <SNAPSHOT_NAME> # take a snapshot, labeled by SNAPSHOT_NAME
The plugin attempts to take a snapshot of all VMs configured in Vagrantfile
. If you defined three of ten VM's, it will attempt to snapshot all ten. To avoid attempts to snapshot nonexistent VMs, comment out the nonexistent VMs in Vagrantfile
. For example, if you have three VMs running you can , comment out c70[04-10] in Vagrantfile
so that the snapshot commands only operate on c70[01-03].
Note: Upon resuming a snapshot, you may find that time-sensitive services may be down (e.g, such as the (HBase RegionServer, etc.) may be down. If this happens, you will need to restart those services.
Recommendation: After you start the VMs--but before you run anything on the VMs--run vagrant snapshot take init
. This way, allows you can to go back to the initial state of the VMs by running "vagrant snapshot go init
"; this only takes seconds (much faster . This restores your initial state much more quickly than starting the VMs up from scratch by using up.sh or "vagrant up"). Another advantage of this is that you can always go back and reinstalling Ambari and HDP. You can return to the initial state without destroying other named snapshots that you createdcreate later.