README.md
1Apache Thrift Centos 6.5 Vagrant Support
2========================================
3This directory is the Vagrant project directory for Apache Thrift running on Centos 6.5. The Vagrantfile in this directory configures a Vagrant provisioned VM launched under VirtualBox. To use this project you must have a recent version of VirtualBox and Vagrant installed (in that order). To run the VM, open a shell, clone Apache Thrift, change to this directory and enter the Vagrant up command.
4
5 $ git clone https://github.com/apache/thrift
6 $ cd thrift/contrib/vagrant/centos-6.5
7 $ vagrant up
8
9This will download and launch the base box VM under VirtualBox and run the Apache Thrift provisioning script. This will take up to an hour depending on your hardware and network. Once complete you can login to the box with Vagrant ssh. The thrift source tree from your host os is mounted at /thrift.
10
11 $ vagrant ssh
12 [vagrant@thrift ~]$ cd /thrift
13 [vagrant@thrift thrift]$ compiler/cpp/thrift --version
14 Thrift version <version>
15
16The provisioning script (inside the Vagrantfile) runs ./bootstrap.sh, ./configure, make and make check, but does not install thrift. To install thrift run "make install".
17
18The Vagrant base box used here is a minimal Centos 6.5 VirtualBox with 2GB RAM and 2 CPUs. For more Vagrant information: https://www.vagrantup.com. A summary of the base box preparation follows:
19
20root password: vagrant
21
22#Create the vagrant user and give it sudo permission
23adduser vagrant
24passwd vagrant
25visudo : vagrant ALL=(ALL) NOPASSWD: ALL
26 #Defaults requiretty
27
28#Shut down the firewall and disable it
29service iptables stop
30chkconfig iptables off
31
32#Setup the vagrant ssh public key to allow vagrant to ssh
33mkdir /home/vagrant/.ssh
34chmod 700 /home/vagrant/.ssh
35cd /home/vagrant/.ssh
36wget --no-check-certificate 'https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub' -O authorized_keys
37chmod 600 /home/vagrant/.ssh/authorized_keys
38chown -R vagrant /home/vagrant/.ssh
39
40#Install EPEL (Extra Packages for Enterprise Linux) but protect the base
41#repositories so that EPEL does not mask base packages
42yum -y install yum-plugin-protectbase
43rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
44
45#Install perl, dynamic kernel modules, dev tools and kernel headers to support
46#Virtual box additions
47yum -y install perl
48yum -y --enablerepo epel install dkms
49yum -y groupinstall "Development Tools"
50yum -y install kernel-devel
51
52#Update everything and reboot
53yum update
54reboot
55
56#Install the VirtualBox Guest additions (using VirtualBox iso)
57mount /dev/cdrom /mnt
58/mnt/VBoxLinuxAdditions.run
59umount /mnt
60
61See the Vagrantfile for further details
62