centos64安装CDH

规划:三台机器
192.168.191.231 sniper1        主节点
192.168.191.232 sniper2        从节点
192.168.191.233 sniper3        从节点

安装centos:
下载Centos-6.6-x86_64-bin-DVD1.iso
安装

配置hosts:
cd /etc
vi hosts
192.168.191.231 sniper1        
192.168.191.232 sniper2        
192.168.191.233 sniper3        

配置网络,桥接方式,设置静态ip:
cd /etc/sysconfig/network-scripts
vi ifcfg-eth0
DEVICE="eth0"
BOOTPROTO="static"
IPADDR=192.168.191.231
GATEWAY=192.168.191.1
NETMASK=255.255.255.0
HWADDR="00:0C:29:1F:4E:62"
ONBOOT="yes"
TYPE="Ethernet"
DNS1=223.5.5.5
DNS2=8.8.8.8

DNS3=192.168.191.1


cd /etc/sysconfig
vi network
NETWORKING=yes
HOSTNAME=sniper1        对应host中的配置
GATEWAY=192.168.191.1

service network restart
ping www.baidu.com

安装JDK:
下载64位jdk1.7
安装到/usr/soft/jdk下
vi /etc/profile    追加
JAVA_HOME=/usr/soft/jdk
PATH=$PATH:$JAVA_HOME/bin

export JAVA_HOME PATH

java -version        校验安装是否成功


安装mysql:
yum install -y mysql-server    

service mysqld start    启动服务
service mysqld stop    关闭服务

修改/ect/my.cnf,如果文件不存在,直接创建,修改内容如下:
[mysqld]
transaction-isolation=READ-COMMITTED
# Disabling symbolic-links is recommended to prevent assorted security risks;
# to do so, uncomment this line:
# symbolic-links=0

datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql

key_buffer              = 16M
key_buffer_size         = 32M
max_allowed_packet      = 32M
thread_stack            = 256K
thread_cache_size       = 64
query_cache_limit       = 8M
query_cache_size        = 64M
query_cache_type        = 1

max_connections         = 550

# log_bin should be on a disk with enough free space
# NOTE: replace '/x/home/mysql/logs/binary' below with
#       an appropriate path for your system.
log_bin=/usr/local/mysql/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

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

创建目录:
mkdir -p /usr/local/mysql/mysql/logs/binary/
chown mysql /usr/local/mysql/mysql/logs/binary/
sudo -u mysql touch /usr/local/mysql/mysql/logs/binary/mysql_binary_log.index


配置:/usr/bin/mysql_secure_installation
配置过程中,除了Disallow root login remotely?设置为n,其余全部设置为y。

启动服务,登录:mysql -uroot -p123456
创建数据库:
create database amon DEFAULT CHARACTER SET utf8;
create database rman DEFAULT CHARACTER SET utf8;
create database metastore DEFAULT CHARACTER SET utf8;
create database sentry DEFAULT CHARACTER SET utf8;
create database nav DEFAULT CHARACTER SET utf8;
create database navms DEFAULT CHARACTER SET utf8;
create database scm DEFAULT CHARACTER SET utf8;

GRANT ALL PRIVILEGES ON *.* TO root@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;
FLUSH PRIVILEGES;

show engines,如果发现没有InnoDB引擎,卸载mysql数据库,从新安装,没有InnoDB引擎有可能是在my.cnf中配置了InnoDB相关参数,
去掉在my.cnf中所有有关InnoDB的参数配置,卸载步骤如下:

yum remove -y mysql-server    
rm -rf /var/lib/mysql/ /usr/local/mysql/ /var/log/mysqld.log /var/run/mysqld.pid /etc/my.cnf

重新安装,执行以上步骤;

设置mysql开机启动:
sudo /sbin/chkconfig mysqld on;
sudo /sbin/chkconfig --list mysqld;


配置ssh免密:
每台机器执行以下命令:
cd ~
ssh-keygen -t rsa

登录sniper1
cd ~
cd .ssh
cp id_rsa.pub authorized_keys
scp authorized_keys sniper2:/home/grid/.ssh

登录sniper2
cd ~
cd .ssh
cat id_rsa.pub >> authorized_keys
scp authorized_keys sniper3:/home/grid/.ssh

登录sniper3
cd ~
cd .ssh
cat id_rsa.pub >> authorized_keys
scp authorized_keys sniper1:/home/grid/.ssh
scp authorized_keys sniper2:/home/grid/.ssh

ssh sniper1
ssh sniper2

如果ssh还是不能免密,修改authorized_keys的权限为600:sudo chmod 600 authorized_keys

关闭防火墙:
停用:  service iptables stop
禁用,永久关闭防火墙:chkconfig iptables off
查看防火墙关闭状态:service iptables status

所有节点关闭selinux
    setenforce 0
    /etc/selinux/config文件:SELINUX=disabled

时间同步:  ntpdate utcnist.colorado.edu未完待续。。。










你可能感兴趣的:(centos64安装CDH)