1. 程式人生 > >cdh-5.10.0搭建安裝

cdh-5.10.0搭建安裝

touch 時間 fec nod tro tools.jar lines png har

1.修改主機名為master, slave1, slave2

vim /etc/sysconfig/network

技術分享

HOSTNAME = master

HOSTNAME = slave1

HOSTNAME = slave2

2.修改hosts文件(三個節點都要設置)

vim /etc/hosts

192.168.1.7 master

192.168.1.8 slave1

192.168.1.9 slave2

技術分享

3.IP設置(三個節點都要設置)

DEVICE=eth0

HWADDR=4C:CC:6A:54:0B:D0

TYPE=Ethernet

UUID=0d5eac54-f26f-430e-8c7a-d2abea4df79e

ONBOOT=yes

NM_CONTROLLED=yes

BOOTPROTO=static

IPADDR=192.168.1.7

GATEWAY=192.168.1.1

NETMASK=255.255.255.0

DNS1=114.114.114.114

DNS2=8.8.8.8

技術分享

4.Selinux(三臺機器都要設置)

service iptables stop

禁用

sudo vim /etc/sysconfig/selinux

內容:

SELINUX=disabled

service iptables status

5.卸載與安裝jdk(三臺機器都要設置)

卸載:

sudo rpm -qa|grep java

sudo rpm -e --nodeps xxx yyy zzz

安裝:

jdk-7u79-linux-x64.gz

tar zxf jdk-7u79-linux-x64.gz

修改配置

vim /etc/profile

export JAVA_HOME=/usr/java/jdk1.7.0_79

export JAVA_BIN=/usr/java/jdk1.7.0_79/bin

export PATH=$PATH:$JAVA_HOME/bin

export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

export JAVA_HOME JAVA_BIN PATH CLASSPATH

初始化:

source /etc/profile

6.ssh免密碼登錄(三臺機器都要設置)

ssh-keygen

cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys

去掉三行註釋

vim /etc/ssh/sshd_config

RSAAuthentication yes

PubkeyAuthentication yes

AuthorizedKeysFile .ssh/authorized_keys

設置免密碼

# cat ~/.ssh/id_rsa.pub | ssh master "cat - >> ~/.ssh/authorized_keys"

# cat ~/.ssh/id_rsa.pub | ssh slave1 "cat - >> ~/.ssh/authorized_keys"

# cat ~/.ssh/id_rsa.pub | ssh slave2 "cat - >> ~/.ssh/authorized_keys"

7.設置NTP服務

1)檢查是否安裝ntp服務器:rpm -q ntp

2)ntp安裝

yum -y install ntp

service ntpd status

chkconfig ntpd on

安裝完成後配置NTP服務為自啟動:

chkconfig ntpd on

chkconfig ntpdate on

查看服務器自啟動狀態

chkconfig --list | grep ntp

ntpd 0:關閉 1:關閉 2:啟用 3:啟用 4:啟用 5:啟用 6:關閉

ntpdate 0:關閉 1:關閉 2:啟用 3:啟用 4:啟用 5:啟用 6:關閉

配置參數:

vim /etc/ntp.conf

restrict 192.168.1.7 mask 255.255.255.0 nomodify notrap

server 192.168.1.7 perfer

server 127.127.1.0 # local clock

fudge 127.127.1.0 stratum 10

註銷:

#server 0.centos.pool.ntp.org iburst

#server 1.centos.pool.ntp.org iburst

#server 2.centos.pool.ntp.org iburst

#server 3.centos.pool.ntp.org iburst

重啟ntp

service ntpd restart

檢查ntp

ntpstat

同步cmserver時間

ntpdate -u 192.168.1.7

8.搭建MySQL數據庫

檢查是否安裝

rpm -qa | grep -i mysql

卸載

yum -y remove mysql-libs*

安裝mysql

cd /usr/sg/mysql

rpm -ivh MySQL-server-5.6.29-1.el6.x86_64.rpm

rpm -ivh MySQL-devel-5.6.29-1.el6.x86_64.rpm

rpm -ivh MySQL-client-5.6.29-1.el6.x86_64.rpm

修改配置文件位置

cp /usr/share/mysql/my-default.cnf /etc/my.cnf

初始化mysql及設置密碼

/usr/bin/mysql_install_db

啟動

service mysql start

cat /root/.mysql_secret #查看root賬號密碼

登陸

mysql -uroot –pqKTaFZnl

修改密碼

SET PASSWORD = PASSWORD(‘root1234‘);

重新登陸

mysql -uroot -proot1234

創建數據庫:

> create database hive DEFAULT CHARSET utf8 COLLATE utf8_general_ci;

> create database amon DEFAULT CHARSET utf8 COLLATE utf8_general_ci;

> create database hue DEFAULT CHARSET utf8 COLLATE utf8_general_ci;

> create database oozie DEFAULT CHARSET utf8 COLLATE utf8_general_ci;

設置遠程登陸

grant all privileges on *.* to [email protected]%‘ identified by ‘root1234‘ with grant option;

生效

flush privileges;

9.下載安裝包:

cm下載

https://archive.cloudera.com/cm5/cm/5/cloudera-manager-el6-cm5.10.0_x86_64.tar.gz

cdh下載

http://archive.cloudera.com/cdh5/parcels/5.10.0/CDH-5.10.0-1.cdh5.10.0.p0.41-el6.parcel

http://archive.cloudera.com/cdh5/parcels/5.10.0/CDH-5.10.0-1.cdh5.10.0.p0.41-el6.parcel.sha1

http://archive.cloudera.com/cdh5/parcels/5.10.0/manifest.json

10.安裝cm

Master:

cp /usr/sg/cm/cloudera-manager-el6-cm5.10.0_x86_64.tar.gz /opt

tar zxf cloudera-manager-el6-cm5.10.0_x86_64.tar.gz

拷貝mysql的jdbc驅動包到/opt/cm-5.10.0/share/cmf/lib

所有節點創建Cloudera SCM User用戶

useradd --system --home=/opt/cm-5.10.0/run/cloudera-scm-server/ --no-create-home --shell=/bin/false --comment "Cloudera SCM User" cloudera-scm

Master上初始化數據庫

/opt/cm-5.10.0/share/cmf/schema/scm_prepare_database.sh mysql cm - -h192.168.1.7 -uroot -proot1234 --scm-host 192.168.1.7 scm scm scm

Master上修改Agent配置

vi /opt/cm-5.10.0/etc/cloudera-scm-agent/config.ini

修改server_host為master

技術分享

同步Agent到其他節點

scp -r /opt/cm-5.10.0 [email protected]:/opt/ &

scp -r /opt/cm-5.10.0 [email protected]:/opt/ &

準備parcles(master)

mv CDH-5.10.0-1.cdh5.10.0.p0.41-el6.parcel /opt/cloudera/parcel-repo/

mv CDH-5.10.0-1.cdh5.10.0.p0.41-el6.parcel.sha1 /opt/cloudera/parcel-repo/

mv manifest.json /opt/cloudera/parcel-repo/

重命名sha文件(master)

mv CDH-5.10.0-1.cdh5.10.0.p0.41-el6.parcel.sha1 CDH-5.10.0-1.cdh5.10.0.p0.41-el6.parcel.sha

啟動master上的server

/opt/cm-5.10.0/etc/init.d/cloudera-scm-server start

設為開機啟動 vi /etc/rc.local(master)

/opt/cm-5.10.0/etc/init.d/cloudera-scm-server start

Master,slave1,slave2啟動agent

/opt/cm-5.10.0/etc/init.d/cloudera-scm-agent start

設為開機啟動 vi /etc/rc.local(每臺機)

/opt/cm-5.10.0/etc/init.d/cloudera-scm-agent start

訪問web頁面http://192.168.1.7:7180

默認用戶名/密碼: admin/admin

技術分享

11.常見問題

1)Cloudera 建議將 /proc/sys/vm/swappiness 設置為 10。當前設置為 60。使用 sysctl 命令在運行時更改該設置並編輯 /etc/sysctl.conf 以在重啟後保存該設置。您可以繼續進行安裝,但可能會遇到問題,Cloudera Manager 報告您的主機由於交換運行狀況不佳。以下主機受到影響:

解決echo 10 > /proc/sys/vm/swappiness

2)

已啟用“透明大頁面”,它可能會導致重大的性能問題。版本為“CentOS release 6.7 (Final)”且發行版為“2.6.32-573.el6.x86_64”的 Kernel 已將 enabled 設置為“[always] madvise never”,並將 defrag 設置為“[always] madvise never”。請運行“echo never > /sys/kernel/mm/transparent_hugepage/defrag”以禁用此設置,然後將同一命令添加到一個 init 腳本中,如 /etc/rc.local,這樣當系統重啟時就會予以設置。或者,升級到 RHEL 6.5 或更新版本,它們不存在此錯誤。將會影響到以下主機:

解決:

方法2:設置/etc/rc.local文件

[[email protected] ~]# vi /etc/rc.local
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don‘t
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local

if test -f /sys/kernel/mm/redhat_transparent_hugepage/enabled; then
echo never > /sys/kernel/mm/redhat_transparent_hugepage/enabled
fi

使用上面的配置後必須重啟操作系統才能生效,你也可以運行下面命令不用重啟操作系統。

You must reboot your system for the setting to take effect, or run the following two echo lines to proceed with the install without rebooting:

[[email protected]~]#echo never > /sys/kernel/mm/redhat_transparent_hugepage/enabled
[[email protected]~]#cat /sys/kernel/mm/redhat_transparent_hugepage/enabled
always madvise [never]
[[email protected] ~]#

Hive 缺失mysql驅動jar無法正常啟動

Oozie缺失mysql驅動jar無法正常啟動

mysql-connector-java-5.1.36-bin.jar 拷貝到/var/lib/oozie

---恢復內容結束---

cdh-5.10.0搭建安裝