准备资源
JDK
下载地址
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
Mysql
下载地址
https://dev.mysql.com/downloads/mysql/
Ambari HDP
可以根据安装的版本调整版本号
ambari 2.2.2
http://public-repo-1.hortonworks.com/HDP/centos7/2.x/updates/2.4.0.0/HDP-2.4.0.0-centos7-rpm.tar.gz
HDP 2.4.2
http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.2.2.0/ambari-2.2.2.0-centos7.tar.gz
HDP-UTILS 1.1.0
http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.20/repos/centos7/HDP-UTILS-1.1.0.20-centos7.tar.gz
安装MySQL
解压MySQL Tar包
tar xvf mysql-5.7.21-1.el6.x86_64.rpm-bundle.tar
安装顺序
rpm -ivh mysql-community-common-5.7.21-1.el6.x86_64.rpm
rpm -ivh mysql-community-libs-5.7.21-1.el6.x86_64.rpm
rpm -ivh mysql-community-client-5.7.21-1.el6.x86_64.rpm
rpm -ivh mysql-community-server-5.7.21-1.el6.x86_64.rpm
启动,重启与停止
启动
service mysqld start
停止
service mysqld stop
重启
service mysqld restart
修改密码与忘记密码
修改MySQL密码
用mysqladmin
mysqladmin -u root password "newpass"
如果root已经设置过密码,采用如下方法
mysqladmin -u root password oldpass "newpass"
忘记密码修改密码
mysqld_safe --skip-grant-tables
mysql -u root mysql
update mysql.user set authentication_string=password('新密码') where user='root';
flush privileges;
遇到的问题-1
file /usr/share/mysql/charsets/latin5.xml from install of MySQL-server-5.6.19-1.linux_glibc2.5.x86_64 conflicts with file from package mysql-libs-5.1.71-1.el6.x86_64
file /usr/share/mysql/charsets/latin7.xml from install of MySQL-server-5.6.19-1.linux_glibc2.5.x86_64 conflicts with file from package mysql-libs-5.1.71-1.el6.x86_64
file /usr/share/mysql/charsets/macce.xml from install of MySQL-server-5.6.19-1.linux_glibc2.5.x86_64 conflicts with file from package mysql-libs-5.1.71-1.el6.x86_64
file /usr/share/mysql/charsets/macroman.xml from install of MySQL-server-5.6.19-1.linux_glibc2.5.x86_64 conflicts with file from package mysql-libs-5.1.71-1.el6.x86_64
file /usr/share/mysql/charsets/swe7.xml from install of MySQL-server-5.6.19-1.linux_glibc2.5.x86_64 conflicts with file from package mysql-libs-5.1.71-1.el6.x86_64
解决办法(版本号根据冲突的日志分析)
yum -y remove mysql-libs-5.1.71*
遇到的问题-2
You must reset your password using ALTER USER statement before executing this statement.
解决办法
SET PASSWORD = PASSWORD('your new password');
ALTER USER 'root'@'localhost' PASSWORD EXPIRE NEVER;
flush privileges;
创建Ambari所依赖的数据库
安装完成后创建ambari数据库及用户,登录root用户执行下面语句:
create database ambari character set utf8 ;
CREATE USER 'ambari'@'%'IDENTIFIED BY 'Ambari-123';
GRANT ALL PRIVILEGES ON *.* TO 'ambari'@'%';
FLUSH PRIVILEGES;
如果要安装Hive,再创建Hive数据库和用户 再执行下面的语句:
create database hive character set utf8 ;
CREATE USER 'hive'@'%'IDENTIFIED BY 'Hive-123';
GRANT ALL PRIVILEGES ON *.* TO 'hive'@'%';
FLUSH PRIVILEGES;
如果要安装Oozie,再创建Oozie数据库和用户 再执行下面的语句:
create database oozie character set utf8 ;
CREATE USER 'oozie'@'%'IDENTIFIED BY 'Oozie-123';
GRANT ALL PRIVILEGES ON *.* TO 'oozie'@'%';
FLUSH PRIVILEGES;
安装mysql jdbc 驱动:
yum install mysql-connector-java
创建ambari系统用户和用户组(只在主节点操作)
添加ambari安装、运行用户和用户组,也可以不创建新用户,直接使用root或者系统其他账号
adduser ambari
passwd ambari
开启NTP服务(所有集群上节点都需要操作)
yum install ntpd
chkconfig --list ntpd
chkconfig ntpd
service ntpd start
配置yum源
将repo拷贝到yum源目录
mv ambari.repo /etc/yum.repos.d/
mv hdp.repo /etc/yum.repos.d/
更新yum源
yum clean all
yum list update
yum makecache
yum repolist
遇到的问题
页面报出以下错误:
The following hosts have Transparent HugePages (THP) enabled。THP should be disabled to avoid potential Hadoop performance
issues.
解决办法,在Linux下执行:
echo never >/sys/kernel/mm/redhat_transparent_hugepage/defrag
echo never >/sys/kernel/mm/redhat_transparent_hugepage/enabled
echo never >/sys/kernel/mm/transparent_hugepage/enabled
echo never >/sys/kernel/mm/transparent_hugepage/defrag