不多说,直接上干货!
前期博客
安装并配置Ambari-server
(1)检查仓库是否可用
[hadoop@ambari01 yum.repos.d]$ pwd
/etc/yum.repos.d
[hadoop@ambari01 yum.repos.d]$ yum repolist
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
* base: centos.ustc.edu.cn
* extras: centos.ustc.edu.cn
* updates: mirrors.zju.edu.cn
Updates-ambari-2.2.1.0 | 2.9 kB :
Updates-ambari-2.2.1.0/primary_db | kB :
repo id repo name status
Updates-ambari-2.2.1.0 ambari-2.2.1.0 - Updates
base CentOS- - Base ,
extras CentOS- - Extras
updates CentOS- - Updates
repolist: ,
[hadoop@ambari01 yum.repos.d]$
(2)安装Ambari-server
[hadoop@ambari01 yum.repos.d]$ pwd
/etc/yum.repos.d
[hadoop@ambari01 yum.repos.d]$ sudo yum install ambari-server
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Install Process
Loading mirror speeds from cached hostfile
* base: mirrors.zju.edu.cn
* extras: mirrors.zju.edu.cn
* updates: mirrors.zju.edu.cn
Updates-ambari-2.2.1.0 | 2.9 kB :
Updates-ambari-2.2.1.0/primary_db | kB :
Resolving Dependencies
--> Running transaction check
---> Package ambari-server.x86_64 :2.2.1.0- will be installed
--> Processing Dependency: postgresql-server >= 8.1 for package: ambari-server-2.2.1.0-.x86_64
--> Running transaction check
---> Package postgresql-server.x86_64 :8.4.-.el6 will be installed
--> Processing Dependency: postgresql-libs(x86-) = 8.4.-.el6 for package: postgresql-server-8.4.-.el6.x86_64
--> Processing Dependency: postgresql(x86-) = 8.4.-.el6 for package: postgresql-server-8.4.-.el6.x86_64
--> Processing Dependency: libpq.so.()(64bit) for package: postgresql-server-8.4.-.el6.x86_64
--> Running transaction check
---> Package postgresql.x86_64 :8.4.-.el6 will be installed
---> Package postgresql-libs.x86_64 :8.4.-.el6 will be installed
--> Finished Dependency Resolution Dependencies Resolved ===============================================================================================================================================================================================
Package Arch Version Repository Size
===============================================================================================================================================================================================
Installing:
ambari-server x86_64 2.2.1.0- Updates-ambari-2.2.1.0 M
Installing for dependencies:
postgresql x86_64 8.4.-.el6 base 2.6 M
postgresql-libs x86_64 8.4.-.el6 base k
postgresql-server x86_64 8.4.-.el6 base 3.4 M Transaction Summary
===============================================================================================================================================================================================
Install Package(s) Total download size: M
Installed size: M
Is this ok [y/N]: y
Downloading Packages:
(/): ambari-server-2.2.1.0-.x86_64.rpm | MB :
(/): postgresql-8.4.-.el6.x86_64.rpm | 2.6 MB :
(/): postgresql-libs-8.4.-.el6.x86_64.rpm | kB :
(/): postgresql-server-8.4.-.el6.x86_64.rpm | 3.4 MB :
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total MB/s | MB :
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : postgresql-libs-8.4.-.el6.x86_64 /
Installing : postgresql-8.4.-.el6.x86_64 /
Installing : postgresql-server-8.4.-.el6.x86_64 /
Installing : ambari-server-2.2.1.0-.x86_64 /
Verifying : postgresql-server-8.4.-.el6.x86_64 /
Verifying : postgresql-8.4.-.el6.x86_64 /
Verifying : postgresql-libs-8.4.-.el6.x86_64 /
Verifying : ambari-server-2.2.1.0-.x86_64 / Installed:
ambari-server.x86_64 :2.2.1.0- Dependency Installed:
postgresql.x86_64 :8.4.-.el6 postgresql-libs.x86_64 :8.4.-.el6 postgresql-server.x86_64 :8.4.-.el6 Complete!
[hadoop@ambari01 yum.repos.d]$
(3)配置Ambari-server
[hadoop@ambari01 yum.repos.d]$ pwd
/etc/yum.repos.d
[hadoop@ambari01 yum.repos.d]$ sudo ambari-server setup
Using python /usr/bin/python2
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):hadoop
Adjusting ambari-server permissions and ownership...
Checking firewall status...
Checking JDK...
[] Oracle JDK 1.8 + Java Cryptography Extension (JCE) Policy Files
[] Oracle JDK 1.7 + Java Cryptography Extension (JCE) Policy Files
[] Custom JDK
==============================================================================
Enter choice ():
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/local/jdk/jdk1..0_60
Validating JDK on Ambari Server...done.
Completing setup...
Configuring database...
Enter advanced database configuration [y/n] (n)? n
Configuring database...
Default properties detected. Using built-in database.
Configuring ambari database...
Checking PostgreSQL...
Running initdb: This may take upto a minute.
Initializing database: [ OK ] About to start PostgreSQL
Configuring local database...
Connecting to local database...done.
Configuring PostgreSQL...
Restarting PostgreSQL
Extracting system views...
.ambari-admin-2.2.1.0..jar
.....
Adjusting ambari-server permissions and ownership...
Ambari Server 'setup' completed successfully.
[hadoop@ambari01 yum.repos.d]$
注意:
如果你是root用户,则这里就写root (推荐)
好比我这里是hadoop用户,则这里就写hadoop(不建议)
(4)查看并启动Ambari-server
[hadoop@ambari01 yum.repos.d]$ sudo service ambari-server status
Using python /usr/bin/python2
Ambari-server status
Ambari Server not running. Stale PID File at: /var/run/ambari-server/ambari-server.pid
[hadoop@ambari01 yum.repos.d]$ sudo service ambari-server start
Using python /usr/bin/python2
Starting ambari-server
Ambari Server running with administrator privileges.
Organizing resource files at /var/lib/ambari-server/resources...
Server PID at: /var/run/ambari-server/ambari-server.pid
Server out at: /var/log/ambari-server/ambari-server.out
Server log at: /var/log/ambari-server/ambari-server.log
Waiting for server start....................
Ambari Server 'start' completed successfully.
[hadoop@ambari01 yum.repos.d]$
(5)在C:\Windows\System32\drivers\etc目录下配置hosts文件
(6)输入地址登录ambari
默认的用户名和密码都为admin
登录之后的界面如下
那么到此为止,我们集群部署前的所有准备工作就做好了,接下来我们就可以部署hadoop集群了。
欢迎大家,加入我的微信公众号:大数据躺过的坑 人工智能躺过的坑
同时,大家可以关注我的个人博客:
http://www.cnblogs.com/zlslch/ 和 http://www.cnblogs.com/lchzls/ http://www.cnblogs.com/sunnyDream/
详情请见:http://www.cnblogs.com/zlslch/p/7473861.html
人生苦短,我愿分享。本公众号将秉持活到老学到老学习无休止的交流分享开源精神,汇聚于互联网和个人学习工作的精华干货知识,一切来于互联网,反馈回互联网。
目前研究领域:大数据、机器学习、深度学习、人工智能、数据挖掘、数据分析。 语言涉及:Java、Scala、Python、Shell、Linux等 。同时还涉及平常所使用的手机、电脑和互联网上的使用技巧、问题和实用软件。 只要你一直关注和呆在群里,每天必须有收获
对应本平台的讨论和答疑QQ群:大数据和人工智能躺过的坑(总群)(161156071)