Skip to content

Instantly share code, notes, and snippets.

@krishna209
Last active November 29, 2015 15:23
Show Gist options
  • Save krishna209/6806527142542884ae80 to your computer and use it in GitHub Desktop.
Save krishna209/6806527142542884ae80 to your computer and use it in GitHub Desktop.
Pre-Requisites
1. Disable the IP Tables, so that the daemons on remote machines can talk to ports on the system
sudo service iptables stop
sudo chkconfig iptables off
2. Disable SELinux
sudo /usr/sbin/setenforce 0
sudo sed -i.old s/SELINUX=enforcing/SELINUX=disabled/ /etc/sysconfig/selinux
3. Set the Hostname (replace [name_of_host] with your systems hostname)
sudo hostname [name_of_host]
4. Make sure the /etc/hosts file on each system contains the IP addresses and fully-qualified domain names of all the members in the cluster. Also make sure the /etc/sysconfig/network on each system contains the hostname you just set for the system.
1. use the following command
nfslookup <hostname> : this will display FQDN and ip address which we need to place in /etc/hosts file
5. Validate the hostname settings
1. Run uname -a and verify if the output matches the hostname command
2. Run /sbin/ifconfig and note the inet addr in the eth0 entry
3. Run host -v -t A $(hostname) and make sure that hostname matches the output of the hostname command has the same IP address as reported by ifconfig
6. sync system clock by installing ntp services in cluster (link: http://www.cloudera.com/content/www/en-us/documentation/enterprise/latest/topics/install_cdh_enable_ntp.html)
yum install -y ntp
chkconfig ntpd on
service ntpd start
ntpdate -u <clock server name which will be available in /etc/ntp.conf file>
ex: ntpdate -u 0.centos.pool.ntp.org
hwclock --systohc
7. Check swappiness and set it to 0
checking:
grep vm.swappiness /etc/sysctl.conf
cat /proc/sys/vm/swappiness
Setting:
echo "vm.swappiness = 0" >> /etc/sysctl.conf
echo 0 > /proc/sys/vm/swappiness
7. Set up mysql server (optional step which cloudera manager will install postgres/mysql automatically in the process)
sudo yum install mysql-server
start mysql server
service mysqld start
go to /etc/my.cnf file and change the cnfigurations accordingly
1. Recommended MySQL configurations settings are as follows. You should incorporate these changes as appropriate into your configuration settings.
make sure log-bin path is available otherwise it will throw an error while starting mysql
[mysqld]
transaction-isolation=READ-COMMITTED
# Disabling symbolic-links is recommended to prevent assorted security risks;
# to do so, uncomment this line:
# symbolic-links=0
key_buffer = 16M
key_buffer_size = 32M
max_allowed_packet = 16M
thread_stack = 256K
thread_cache_size = 64
query_cache_limit = 8M
query_cache_size = 64M
query_cache_type = 1
# Important: see Configuring the Databases and Setting max_connections
max_connections = 550
# log-bin should be on a disk with enough free space
log-bin=/x/home/mysql/logs/binary/mysql_binary_log
# For MySQL version 5.1.8 or later. Comment out binlog_format for older versions.
binlog_format = mixed
read_buffer_size = 2M
read_rnd_buffer_size = 16M
sort_buffer_size = 8M
join_buffer_size = 8M
# InnoDB settings
innodb_file_per_table = 1
innodb_flush_log_at_trx_commit = 2
innodb_log_buffer_size = 64M
innodb_buffer_pool_size = 4G
innodb_thread_concurrency = 8
innodb_flush_method = O_DIRECT
innodb_log_file_size = 512M
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
Install mysql connector JAR
yum install mysql-connector-java
8. ensure mysql starts on boot
sudo /sbin/chkconfig mysqld on
sudo /sbin/chkconfig --list mysqld
9. increase LVM to extend volume. (link: https://gist.github.com/krishna209/f1254ed8c72a18aef272#file-lvm-L27)
parted
select /dev/vda
p
mkpart
primary
10.7GB
85.9GB
q
reboot
pvdisplay
pvcreate /dev/vda3
vgdisplay
vgextend VolGroup00 /dev/vda3
pvscan
lvextend /dev/VolGroup00/LogVol00 /dev/vda3
resize2fs /dev/VolGroup00/LogVol00
10. Install JDK on all the machines (recommended to install Oracle JDK)
install jdk
wget --no-check-certificate \
--no-cookies \
--header "Cookie: oraclelicense=accept-securebackup-cookie" \
http://download.oracle.com/otn-pub/java/jdk/7u45-b18/jdk-7u45-linux-x64.rpm \
-O jdk-7u45-linux-x64.rpm
rpm -ivh jdk-7u45-linux-x64.rpm
# update the installed java as the latest version using alternatives
alternatives --install /usr/bin/java java /usr/java/jdk1.7.0_45/bin/java 200000
11. download and install cloudera manager in the host machine
wget http://archive.cloudera.com/cm5/installer/latest/cloudera-manager-installer.bin
chmod u+x cloudera-manager-installer.bin
sudo ./cloudera-manager-installer.bin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment