CDH5.3.3安装(hadoop集群)

Cloudera Manager提供两种软件包安装源,Package 和 Parcel:
Package就是一个个rpm文件,以yum的方式组织起来。
Parcel是rpm包的压缩格式,以.parcel结尾,所有的rpm压缩在一个文件中,方便下载和分发,使用manifest.json文件对parcel文件进行描述,将parcel文件保存到局域网内的Web服务器上,安装过程中就不需要从互联网上下载文件了,实现了离线安装。

(1) 版本含义介绍:
https://ccp.cloudera.com/display/DOC/CDH+Version+and+Packaging+Information
(2)各版本特性查看:
https://ccp.cloudera.com/display/DOC/CDH+Packaging+Information+for+Previous+Releases
(3)Cloudera Manager下载地址
http://archive.cloudera.com/cm5/cm/5/cloudera-manager-el6-cm5.3.3_x86_64.tar.gz

(4)parcel包,manifest.json文件下载地址
http://archive.cloudera.com/cdh5/parcels/latest/
(5)mysql安装设置
http://www.cloudera.com/content/cloudera/en/documentation/core/latest/topics/cm_ig_mysql.html
(6)MySqlJDBC驱动
http://dev.mysql.com/downloads/connector/j/

Mysql的版本与Mysql JDBC驱动版本对应情况
    Connector/J 5.1 支持Mysql 4.1、Mysql 5.0、Mysql 5.1、Mysql 6.0 alpha这些版本。
    Connector/J 5.0 支持MySQL 4.1、MySQL 5.0 servers、distributed transaction (XA)。
    Connector/J 3.1 支持MySQL 4.1、MySQL 5.0 servers、MySQL 5.0 except distributed transaction (XA) support。
    Connector/J 3.0 支持MySQL 3.x or MySQL 4.1。
(7)jdk
http://www.oracle.com/technetwork/java/javase/downloads/index.html

环境:centos6.5
===============================================================================================================================

安装VNC

rpm -ivh tigervnc-1.1.0-5.el6_4.1.x86_64.rpm
rpm -ivh tigervnc-server-1.1.0-5.el6_4.1.x86_64.rpm

vi /etc/sysconfig/vncservers
VNCSERVERS="1:root"
VNCSERVERARGS[1]="-geometry 800x600 -nolisten tcp -localhost"

vncserver

vi /root/.vnc/xstartup
#twm &
gnome-session &

===============================================================================================================================

1、配置网络(所有节点)
vi /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.10.100   hadoop1
192.168.10.101   hadoop2
192.168.10.102   hadoop3

===============================================================================================================================

2、SSH无密码验证配置(所有节点)

<hadoop1 node>
ssh-keygen -t rsa -P ''
cat $HOME/.ssh/id_rsa.pub >> $HOME/.ssh/authorized_keys
chmod 600 $HOME/.ssh/authorized_keys
ssh localhost
ssh hadoop1

scp $HOME/.ssh/authorized_keys root@hadoop2:$HOME/.ssh/

<hadoop2 node>
ssh-keygen -t rsa -P ''
cat $HOME/.ssh/id_rsa.pub >> $HOME/.ssh/authorized_keys

scp $HOME/.ssh/authorized_keys root@hadoop3:$HOME/.ssh/

<hadoop3 node>
ssh-keygen -t rsa -P ''
cat $HOME/.ssh/id_rsa.pub >> $HOME/.ssh/authorized_keys

scp $HOME/.ssh/authorized_keys root@hadoop1:$HOME/.ssh/
scp $HOME/.ssh/authorized_keys root@hadoop2:$HOME/.ssh/
===============================================================================================================================

3、卸载系统自带OPEN-JDK,安装oracle的java(所有节点)
rpm -qa|grep java
rpm -e --nodeps java-1.6.0-openjdk-1.6.0.0-1.66.1.13.0.el6.x86_64
rpm -e --nodeps java-1.7.0-openjdk-1.7.0.45-2.4.3.3.el6.x86_64
rpm -e --allmatches --nodeps tzdata-java-2013g-1.el6.noarch

rpm -ivh jdk-7u75-linux-x64.rpm
vi /etc/profile
export JAVA_HOME=/usr/java/jdk1.7.0_75
export JRE_HOME=/usr/java/jdk1.7.0_75/jre
export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH

source /etc/profile
echo "JAVA_HOME=/usr/java/latest" >> /etc/environment
=============================================================================================================================

4、关闭防火墙(所有节点)
(临时关闭)
service iptables stop
(重启后生效)
chkconfig iptables off

SELINUX:
(临时生效)
setenforce 0
修改/etc/selinux/config下的SELINUX=disabled (重启后永久生效)
===========================================================================================================================

5、所有节点配置NTP服务,所有datanode节点以master节点为基础同步时间
安装包:

ntpdate-4.2.6p5-1.el6.centos.x86_64
ntp-4.2.6p5-1.el6.centos.x86_64
--------------------------------------------------------------------
<master>
vi /etc/ntp.conf
restrict 0.0.0.0 mask 0.0.0.0 nomodify notrap
server 127.127.1.0
fudge  127.127.1.0 stratum 10
driftfile /var/lib/ntp/drift
broadcastdelay 0.008
keys /etc/ntp/keys
includefile /etc/ntp/crypto/pw
restrict 127.0.0.1
restrict -6 ::1
---------------------------------------------------------------------
<datanode>
restrict 0.0.0.0 mask 0.0.0.0 nomodify notrap
restrict default kod nomodify notrap nopeernoquery
restrict -6 default kod nomodify notrapnopeer noquery
server hadoop1 prefer
fudge  127.127.1.0 stratum 10
driftfile /var/lib/ntp/drift
broadcastdelay 0.008
keys /etc/ntp/keys
restrict 127.0.0.1
restrict -6 ::1
===========================================================================================================================

6、mysql数据库配置安装(master节点),使用嵌入式数据库存在性能问题

mysql5.5以后是通过cmake来编译
tar -zxvf cmake-3.2.1.tar.gz
cd cmake-3.2.1
./configure
make
make install

rpm -qa|grep ncurses-devel
rpm -ivh ncurses-devel-5.7-3.20090208.el6.x86_64.rpm

groupadd mysql
useradd mysql -g mysql -M -s /sbin/nologin
mkdir -p /usr/local/mysql
mkdir -p /usr/local/mysql/data
cd /soft
tar -zxvf mysql-5.6.24.tar.gz
chown -R root:root mysql-5.6.24
cd mysql-5.6.24
cmake . \
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
-DMYSQL_DATADIR=/usr/local/mysql/data \
-DSYSCONFDIR=/etc \
-DWITH_MYISAM_STORAGE_ENGINE=1 \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_MEMORY_STORAGE_ENGINE=1 \
-DWITH_FEDERATED_STORAGE_ENGINE=1 \
-DWITH_READLINE=1 \
-DMYSQL_UNIX_ADDR=/tmp/mysqld.sock \
-DMYSQL_TCP_PORT=3306 \
-DENABLED_LOCAL_INFILE=1 \
-DWITH_PARTITION_STORAGE_ENGINE=1 \
-DEXTRA_CHARSETS=all \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci

make
make install

cd /usr/local/mysql
chown -R mysql:mysql .
chmod -R ug+rwx  /usr/local/mysql/data
scripts/mysql_install_db --datadir=/usr/local/mysql/data --user=mysql

 

vi /root/.bash_profile
PATH=$PATH:$HOME/bin:/usr/local/mysql/bin:/usr/local/mysql/lib
source /root/.bash_profile

vi /etc/my.cnf
#[mysqld] 下面添加:
[mysqld]
port=3306
socket=/tmp/mysqld.sock
user=mysql
basedir=/usr/local/mysql
datadir=/usr/local/mysql/data
default-storage-engine=MyISAM
explicit_defaults_for_timestamp=true
federated
character-set-server=utf8
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
server-id=1
#log_bin=/tmp/1.000001
#slow_query_log=1
#slow_query_log_file=/tmp/mysqlslow.log1
#general_log=1
#general_log_file=/tmp/mysqlgen.log
innodb_log_files_in_group=1
[client]
port=3306
socket=/tmp/mysqld.sock
#user=root
#password=hadoop

cp support-files/mysql.server  /etc/init.d/mysql
chmod 755 /etc/init.d/mysql
vi /etc/init.d/mysql
basedir=/usr/local/mysql
datadir=/usr/local/mysql/data
chkconfig --add mysql
chkconfig --list mysql
chkconfig  mysql on

----------------------------------------------------------------------------------------------------------

官方建议设置:

Here is an option file with Cloudera recommended settings:
[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 = 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. Replace '/var/lib/mysql/mysql_binary_log' with an appropriate path for your system and chown the specified folder to the mysql user.
#log_bin=/var/lib/mysql/mysql_binary_log
#expire_logs_days = 10
#max_binlog_size = 100M

# 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
-----------------------------------------------------------------------------------------------
Note: If you already have the JDBC driver installed on the hosts that need it, you can skip this section. However, MySQL 5.6 requires a driver version 5.1.26 or higher.
===========================================================================================================================

7、创建数据库(master节点)
--hive数据库
create database hive DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
--集群监控数据库
create database amon DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
--hue数据库
create database hue DEFAULT CHARSET utf8 COLLATE utf8_general_ci;

给用户授权(这里密码设为hadoop)
mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'hadoop';  //为root添加远程连接的能力。
mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'hadoop1' IDENTIFIED BY 'hadoop';
mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY 'hadoop';
mysql>use mysql
mysql>update user set Password = password('hadoop') where User='root';
mysql>select Host,User,Password  from user where User='root';
mysql>flush privileges;

===========================================================================================================================

8、安装Cloudera Manager 5(cm5)和Agent,master节点安装

根据自己的系统选择相应的版本,本次安装选用的是cloudera-manager-el6-cm5.3.3_x86_64.tar.gz。
下载完成后只上传到master节点即可。然后解压到/opt目录下,不能解压到其他地方,因为cdh5的源会默认在/opt/cloudera/parcel-repo寻找。给所有节点添加cloudera-scm用户:

tar -zxvf /soft/cloudera-manager-el6-cm5.3.3_x86_64.tar.gz
解压后将cm-5.3.3和cloudera文件夹转移到/opt目录
mv cm-5.3.3/ /opt
mv cloudera /opt/
chown -R root:root /opt/cm-5.3.3
chown -R root:root /opt/cloudera


为Cloudera Manager 5建立数据库:
首先将mysql-connector-java-5.1.33.jar放到/opt/cm-5.3.3/share/cmf/lib/目录下
cp /soft/mysql-connector-java-5.1.33.jar /opt/cm-5.3.3/share/cmf/lib/

给所有节点添加cloudera-scm用户:
useradd --system --home=/opt/cm-5.3.3/run/cloudera-scm-server --no-create-home --shell=/bin/false --comment "Cloudera SCM User" cloudera-scm

Agent配置:
修改/opt/cm-5.3.3/etc/cloudera-scm-agent/config.ini的server_host为主节点的主机名
server_host=hadoop1


准备Parcels,用以安装CDH5(配置源文件)
将CHD5相关的Parcel包放到主节点的/opt/cloudera/parcel-repo/目录中(若无parcel-repo目录需要手动创建)
cd /soft
mv manifest.json /opt/cloudera/parcel-repo/
mv CDH-5.3.3-1.cdh5.3.3.p0.5-el6.parcel.sha1 /opt/cloudera/parcel-repo/
mv CDH-5.3.3-1.cdh5.3.3.p0.5-el6.parcel /opt/cloudera/parcel-repo/

打开manifest.json文件,里面是json格式的配置,我们需要的就是与我们系统版本相对应的hash码,因为我们用的是Centos6.5,所以找到如下位置
"parcelName": "CDH-5.3.3-1.cdh5.3.3.p0.5-el6.parcel"
在这个大括号的最下面找到“hash”所对应的值
"hash": "d25348a155e18e554de70068a319bbd7930c070a"
将“hash”的值复制下来,然后创建一个文件,文件名与你的parel包名一致,并加上.sha后缀。


将下载的CDH-5.3.3-1.cdh5.3.3.p0.5-el6.parcel.sha1,重命名为CDH-5.3.3-1.cdh5.3.3.p0.5-el6.parcel.sha即可
cd /opt/cloudera/parcel-repo/
mv CDH-5.3.3-1.cdh5.3.3.p0.5-el6.parcel.sha1 CDH-5.3.3-1.cdh5.3.3.p0.5-el6.parcel.sha

同步Agent到其他节点
scp -r /opt/cm-5.3.3 root@hadoop2:/opt/
scp -r /opt/cm-5.3.3 root@hadoop3:/opt/

在主节点初始化CM5的数据库:
/opt/cm-5.3.3/share/cmf/schema/scm_prepare_database.sh mysql cm -hlocalhost -uroot -phadoop --scm-host localhost scm scm scm
格式是:scm_prepare_database.sh 数据库类型  数据库 服务器 用户名 密码  –scm-host  Cloudera_Manager_Server所在的机器

相关启动脚本
通过/opt/cm-5.3.3/etc/init.d/cloudera-scm-server start启动服务端。
通过/opt/cm-5.3.3/etc/init.d/cloudera-scm-agent start启动Agent服务。
我们启动的其实是个service脚本,需要停止服务将以上的start参数改为stop就可以了,重启是restart。

1. 在namenode启动server和agent( 主节点也是要做到集群中的, 所以主节点也要开启Agent )
/opt/cm-5.3.3/etc/init.d/cloudera-scm-server start
/opt/cm-5.3.3/etc/init.d/cloudera-scm-agent start
2. 在所有datanode启动agent
/opt/cm-5.3.3/etc/init.d/cloudera-scm-agent start

Cloudera Manager Server和Agent都启动以后,就可以进行CDH5的安装配置了。
这时可以通过浏览器访问主节点的7180端口测试一下了(由于CM Server的启动需要花点时间,这里可能要等待一会才能访问),默认的用户名和密码均为admin
http://192.168.10.100:7180

在局域网内访问: http://192.168.10.100:7180/cmf/login
默认帐号和密码:admin

 

如下三个版本:
 Clouder Express:
 免费版,长期使用
Clouder Enterprise试用版:
 试用60天
Clouder Enterprise:
 需要上传授权许可
 如上我们选择的是Clouder Express版

 

选择需要部署的机器
这里需要说明的是指定主机安装有多种方式:
 1.直接列出ip或则host,多台以逗号、分号、制表符、空格或放置在单独的行。
 2.指定ip的地址范围例如:10.1.1.[1-4] 或则 host[1-3].company.com.3.记得指定的主机需要关闭防火墙,(如果遇到不能安装,最好使用安装cloudera manager虚拟机进行复制)

选择安装包

部署完成

接下来是服务器检查,可能会遇到以下问题:
Cloudera 建议将 /proc/sys/vm/swappiness 设置为 0。当前设置为 60。使用 sysctl 命令在运行时更改该设置并编辑 /etc/sysctl.conf 以在重启后保存该设置。您可以继续进行安装,但可能会遇到问题,Cloudera Manager 报告您的主机由于交换运行状况不佳。以下主机受到影响:
通过echo 0 > /proc/sys/vm/swappiness即可解决。
echo "vm.swappiness = 0" >> /etc/sysctl.conf

 

选择安装服务

 

服务配置,一般情况下保持默认就可以了(Cloudera Manager会根据机器的配置自动进行配置,如果需要特殊调整,自行进行设置就可以了)

 

hive元数据库配置

 

配置参数

 

集群安装完成

 

 


 

 

附:中间安装报错解决

执行错误:
[root@hadoop1 ~]# /opt/cm-5.3.3/share/cmf/schema/scm_prepare_database.sh mysql cm -hlocalhost -uroot -phadoop --scm-host localhost scm scm scm
JAVA_HOME=/usr/local/jdk1.7.0_67
Verifying that we can write to /opt/cm-5.3.3/etc/cloudera-scm-server
[                          main] DbProvisioner                  ERROR Exception when creating/dropping database with user 'root' and jdbc url 'jdbc:mysql://localhost/?useUnicode=true&characterEncoding=UTF-8'
java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:996)[mysql-connector-java-5.1.33.jar:5.1.33]
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3887)[mysql-connector-java-5.1.33.jar:5.1.33]
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3823)[mysql-connector-java-5.1.33.jar:5.1.33]
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:870)[mysql-connector-java-5.1.33.jar:5.1.33]
        at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1659)[mysql-connector-java-5.1.33.jar:5.1.33]
        at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1206)[mysql-connector-java-5.1.33.jar:5.1.33]
        at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2234)[mysql-connector-java-5.1.33.jar:5.1.33]
        at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2265)[mysql-connector-java-5.1.33.jar:5.1.33]
        at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2064)[mysql-connector-java-5.1.33.jar:5.1.33]
        at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:790)[mysql-connector-java-5.1.33.jar:5.1.33]
        at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:44)[mysql-connector-java-5.1.33.jar:5.1.33]
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)[:1.7.0_67]
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)[:1.7.0_67]
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)[:1.7.0_67]
        at java.lang.reflect.Constructor.newInstance(Constructor.java:526)[:1.7.0_67]
        at com.mysql.jdbc.Util.handleNewInstance(Util.java:377)[mysql-connector-java-5.1.33.jar:5.1.33]
        at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:395)[mysql-connector-java-5.1.33.jar:5.1.33]
        at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:325)[mysql-connector-java-5.1.33.jar:5.1.33]
        at java.sql.DriverManager.getConnection(DriverManager.java:571)[:1.7.0_67]
        at java.sql.DriverManager.getConnection(DriverManager.java:215)[:1.7.0_67]
        at com.cloudera.enterprise.dbutil.DbProvisioner.executeSql(DbProvisioner.java:283)[db-common-5.3.3.jar:]
        at com.cloudera.enterprise.dbutil.DbProvisioner.doMain(DbProvisioner.java:95)[db-common-5.3.3.jar:]
        at com.cloudera.enterprise.dbutil.DbProvisioner.main(DbProvisioner.java:110)[db-common-5.3.3.jar:]
[                          main] DbProvisioner                  ERROR Stack Trace:
java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:996)[mysql-connector-java-5.1.33.jar:5.1.33]
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3887)[mysql-connector-java-5.1.33.jar:5.1.33]
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3823)[mysql-connector-java-5.1.33.jar:5.1.33]
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:870)[mysql-connector-java-5.1.33.jar:5.1.33]
        at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1659)[mysql-connector-java-5.1.33.jar:5.1.33]
        at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1206)[mysql-connector-java-5.1.33.jar:5.1.33]
        at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2234)[mysql-connector-java-5.1.33.jar:5.1.33]
        at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2265)[mysql-connector-java-5.1.33.jar:5.1.33]
        at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2064)[mysql-connector-java-5.1.33.jar:5.1.33]
        at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:790)[mysql-connector-java-5.1.33.jar:5.1.33]
        at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:44)[mysql-connector-java-5.1.33.jar:5.1.33]
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)[:1.7.0_67]
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)[:1.7.0_67]
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)[:1.7.0_67]
        at java.lang.reflect.Constructor.newInstance(Constructor.java:526)[:1.7.0_67]
        at com.mysql.jdbc.Util.handleNewInstance(Util.java:377)[mysql-connector-java-5.1.33.jar:5.1.33]
        at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:395)[mysql-connector-java-5.1.33.jar:5.1.33]
        at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:325)[mysql-connector-java-5.1.33.jar:5.1.33]
        at java.sql.DriverManager.getConnection(DriverManager.java:571)[:1.7.0_67]
        at java.sql.DriverManager.getConnection(DriverManager.java:215)[:1.7.0_67]
        at com.cloudera.enterprise.dbutil.DbProvisioner.executeSql(DbProvisioner.java:283)[db-common-5.3.3.jar:]
        at com.cloudera.enterprise.dbutil.DbProvisioner.doMain(DbProvisioner.java:95)[db-common-5.3.3.jar:]
        at com.cloudera.enterprise.dbutil.DbProvisioner.main(DbProvisioner.java:110)[db-common-5.3.3.jar:]
--> Error 1, giving up (use --force if you wish to ignore the error)

 

需要修改mysql登录密码:

解决:
修改MySQL的root用户的密码以及打开远程连接
mysql>use mysql;
mysql>desc user;
mysql>GRANT ALL PRIVILEGES ON *.* TO root@"%" IDENTIFIED BY "hadoop";  //为root添加远程连接的能力。
mysql>update user set Password = password('hadoop') where User='root';
mysql>select Host,User,Password  from user where User='root';
mysql>flush privileges;
mysql>exit

[root@hadoop1 ~]# /opt/cm-5.3.3/share/cmf/schema/scm_prepare_database.sh mysql cm -hlocalhost -uroot -phadoop --scm-host localhost scm scm scm
JAVA_HOME=/usr/local/jdk1.7.0_67
Verifying that we can write to /opt/cm-5.3.3/etc/cloudera-scm-server
Creating SCM configuration file in /opt/cm-5.3.3/etc/cloudera-scm-server
Executing:  /usr/local/jdk1.7.0_67/bin/java -cp /usr/share/java/mysql-connector-java.jar:/usr/share/java/oracle-connector-java.jar:/opt/cm-5.3.3/share/cmf/schema/../lib/* com.cloudera.enterprise.dbutil.DbCommandExecutor /opt/cm-5.3.3/etc/cloudera-scm-server/db.properties com.cloudera.cmf.db.
[                          main] DbCommandExecutor              INFO  Successfully connected to database.
All done, your SCM database is configured correctly!

 

官方关于JDK版本的选择建议:

Java Development Kit Installation

Some installation paths require that you install the Oracle Java Development Kit on hosts before deploying Cloudera Manager, CDH, and managed services. To install the Oracle JDK, follow the instructions in Installing the Oracle JDK. The completed installation, or any already existing installation, must meet the following requirements.

Requirements
•Install a supported version:◦CDH 5 - Supported JDK Versions
◦CDH 4 - Supported JDK Versions
 
•Install the same version of the Oracle JDK on each host.
•Install the JDK in /usr/java/jdk-version.

  Important: •You cannot upgrade from JDK 1.7 to JDK 1.8 while upgrading to CDH 5.3. The cluster must already be running CDH 5.3 when you upgrade to JDK 1.8.
•On SLES 11 platforms, do not install or try to use the IBM Java version bundled with the SLES distribution. CDH does not run correctly with that version.

Installing the Oracle JDK

The Oracle JDK installer is available both as an RPM-based installer for RPM-based systems, and as a binary installer for other systems.
1.Download the .tar.gz file for one of the supported versions of the Oracle JDK from Java SE Downloads, Java SE 7 Downloads, or Java SE 6 Downloads. (These links are correct at the time of writing but change frequently.)
2.Extract the JDK to /usr/java/jdk-version; for example /usr/java/jdk.1.7.0_nn or /usr/java/jdk.1.8.0_nn, where nn is a supported version.
3.Set JAVA_HOME to the directory where the JDK is installed, for exampleexport JAVA_HOME=/usr/java/jdk.1.7.0_nn in the following files on Cloudera Manager Server and cluster hosts:◦Cloudera Manager Server - /etc/default/cloudera-scm-server
◦Cloudera Manager Agent - /etc/default/cloudera-scm-agent or follow the instructions in Configuring a Custom Java Home Location
◦Cloudera Manager package-based or unmanaged deployment - /etc/default/bigtop-utils

Supported JDK Versions
CDH 5 requires the Oracle JDK, and supports the versions shown in the table that follows.
Latest Certified Version
1.7.0_75
1.8.0_40

 

©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页