代码改变世界

centos6.5下 hdp-2.4.2安装

2018-03-06 13:18  staryea-bigdata  阅读(451)  评论(0编辑  收藏  举报

(1)准备工作

/usr/sbin/sestatus -v
getenforce
1、/usr/sbin/sestatus -v ##如果SELinux status参数为enabled即为开启状态
SELinux status: enabled
2、getenforce ##也可以用这个命令检查
关闭SELinux:
1、临时关闭(不用重启机器):
setenforce 0 ##设置SELinux 成为permissive模式
##setenforce 1 设置SELinux 成为enforcing模式
2、修改配置文件需要重启机器:
修改/etc/selinux/config 文件
将SELINUX=enforcing改为SELINUX=disabled

修改参数配置
vi /etc/security/limits.conf
* hard nofile 204800
* soft nofile 204800


vi /etc/security/limits.d/90-nproc.conf
* soft nproc 204800
root soft nproc unlimited

vi /etc/sysctl.conf
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_fin_timeout = 30
net.ipv4.tcp_keepalive_time = 1200
net.ipv4.ip_local_port_range = 1024 65000
net.ipv4.tcp_max_tw_buckets = 5000

sysctl -p 让以上配置生效

(二)配置httpd环境 在nn主机上
配置环境:

httpd服务,服务根目录是 /var/www/html
vi /etc/httpd/conf/httpd.conf
启用ServerName:把 #ServerName www.example.com:80 修改为 ServerName hostname:80

修改访问权限:

复制代码
<Directory />

Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all

</Directory>
复制代码
将红色部分的Deny修改为Allow

service httpd start


(三)编写yum文件

cd /etc/yum.repos.d
vi centos6.5.repo
[Centos6.5]
name=Centos6.5
baseurl=file:///media
gpgcheck=0
enabled=1


cd /var/www/html/HDP
新建 hdp_urlinfo.json
{
"HDP-2.4": {
"latest": {
"redhat6": "http://cnn1/HDP/centos6/2.x/updates/2.4.2.0/hdp.repo"
}
}
}

(四)安装数据库

安装Mysql数据库,并修改my.cnf配置

[mysqld]下
修改数据存储datadir
新增新增超时设置
wait_timeout=31536000 #365天
interactive_timeout=31536000 #365天
设置表名不区分大小写
lower_case_table_names=1

(五)创建Ambari 用户

mysql -uroot
grant usage on *.* to 'ambari'@'localhost' identified by 'ambari' with grant option;
create database ambari;
grant all on ambari.* to ambari@'%' identified by 'ambari';
grant all on ambari.* to ambari@localhost identified by 'ambari';
grant all on ambari.* to ambari@cnn1 identified by 'ambari';
FLUSH PRIVILEGES ;

(六)配置ambari-server

root@staryea-nn-01 soft]# ambari-server setup
Using python /usr/bin/python
Setup ambari-server
Checking SELinux...
SELinux status is 'disabled'
Customize user account for ambari-server daemon [y/n] (n)? y
Enter user account for ambari-server daemon (root):root
Adjusting ambari-server permissions and ownership...
Checking firewall status...
Checking JDK...
[1] Oracle JDK 1.8 + Java Cryptography Extension (JCE) Policy Files 8
[2] Oracle JDK 1.7 + Java Cryptography Extension (JCE) Policy Files 7
[3] Custom JDK
==============================================================================
Enter choice (1): 3
WARNING: JDK must be installed on all hosts and JAVA_HOME must be valid on all hosts.
WARNING: JCE Policy files are required for configuring Kerberos security. If you plan to use Kerberos,please make sure JCE Unlimited Strength Jurisdiction Policy Files are valid on all hosts.
Path to JAVA_HOME: /usr/java/jdk1.7.0_80
Validating JDK on Ambari Server...done.
Completing setup...
Configuring database...
Enter advanced database configuration [y/n] (n)? y
Configuring database...
==============================================================================
Choose one of the following options:
[1] - PostgreSQL (Embedded)
[2] - Oracle
[3] - MySQL
[4] - PostgreSQL
[5] - Microsoft SQL Server (Tech Preview)
[6] - SQL Anywhere
==============================================================================
Enter choice (1): 3
Database name (ambari):
Postgres schema (ambari):
Username (ambari):
Enter Database Password (bigdata): ambari
Default properties detected. Using built-in database.
Configuring ambari database...
Checking PostgreSQL...
Running initdb: This may take upto a minute.
正在初始化数据库:[确定]

About to start PostgreSQL
Configuring local database...
Connecting to local database...done.
Configuring PostgreSQL...
Extracting system views...
ambari-admin-2.2.1.1.70.jar
......
Adjusting ambari-server permissions and ownership...
Ambari Server 'setup' completed successfully.

(如果使用mysql数据库)
Choose one of the following options:
[1] - PostgreSQL (Embedded)
[2] - Oracle
[3] - MySQL
[4] - PostgreSQL
[5] - Microsoft SQL Server (Tech Preview)
[6] - SQL Anywhere
==============================================================================
Enter choice (3): 3
Hostname (localhost): hadoop1
Port (3306):
Database name (ambari): ambari
Username (ambari): ambari
Enter Database Password (bigdata): ambari
Re-enter password: ambari
Configuring ambari database...
Copying JDBC drivers to server resources...
Configuring remote database connection properties...
WARNING: Before starting Ambari Server, you must run the following DDL against the database to create the schema: /var/lib/ambari-server/resources/Ambari-DDL-MySQL-CREATE.sql
Proceed with configuring remote database connection properties [y/n] (y)? y
Extracting system views...
.......
Adjusting ambari-server permissions and ownership...
Ambari Server 'setup' completed successfully


mysql ambari -uambari -p </var/lib/ambari-server/resources/Ambari-DDL-MySQL-CREATE.sql


(七)启动ambari 服务
[root@staryea-nn-01 soft]# ambari-server start

 

(八)访问WEB安装界面

http://ip:8080

admin/admin进行安装