下载Ambari的仓库
[root@sandbox ~]# wget -nv http://public-repo-1.hortonworks.com/ambari/centos6/1.x/updates/1.7.0/ambari.repo -O /etc/yum.repos.d/ambari.repo
2015-02-28 09:56:39 URL:http://public-repo-1.hortonworks.com/ambari/centos6/1.x/updates/1.7.0/ambari.repo [472/472] -> "/etc/yum.repos.d/ambari.repo" [1]
确认仓库是否更新完毕
[root@sandbox ~]# yum repolist
Loaded plugins: fastestmirror, priorities
Determining fastest mirrors
epel/metalink | 5.6 kB 00:00
* base: mirror.bit.edu.cn
* epel: ftp.cuhk.edu.hk
* extras: mirrors.hustunique.com
* updates: centos.ustc.edu.cn
HDP-2.2 | 2.9 kB 00:00
HDP-2.2/primary_db | 60 kB 00:00
HDP-UTILS-1.1.0.20 | 2.9 kB 00:00
HDP-UTILS-1.1.0.20/primary_db | 27 kB 00:00
Updates-ambari-1.7.0 | 2.9 kB 00:00
Updates-ambari-1.7.0/primary_db | 3.5 kB 00:00
ambari-1.x | 1.3 kB 00:00
ambari-1.x/primary | 1.9 kB 00:00
ambari-1.x 5/5
base | 3.7 kB 00:00
base/primary_db | 4.6 MB 00:14
epel | 4.4 kB 00:00
epel/primary_db | 6.4 MB 04:27
extras | 3.4 kB 00:00
extras/primary_db | 30 kB 00:00
puppetlabs-deps | 2.5 kB 00:00
puppetlabs-deps/primary_db | 27 kB 00:00
puppetlabs-products | 2.5 kB 00:00
puppetlabs-products/primary_db | 135 kB 00:17
sandbox | 2.9 kB 00:00
sandbox/primary_db | 3.0 kB 00:00
updates | 3.4 kB 00:00
http://centos.ustc.edu.cn/centos/6.6/updates/x86_64/repodata/79a0eeb33435093fbd75412e2a9bb96971236325fe0b09c678a3c24235217af9-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 18 - "transfer closed with 1785207 bytes remaining to read"
Trying other mirror.
updates/primary_db | 2.1 MB 00:03
repo id repo name status
HDP-2.2 HDP 159+23
HDP-UTILS-1.1.0.20 HDP-UTILS 41
Updates-ambari-1.7.0 ambari-1.7.0 - Updates 5
ambari-1.x Ambari 1.x 5
base CentOS-6 - Base 6,518
*epel Extra Packages for Enterprise Linux 6 - x86_64 11,218
extras CentOS-6 - Extras 37
puppetlabs-deps Puppet Labs Dependencies El 6 - x86_64 77
puppetlabs-products Puppet Labs Products El 6 - x86_64 475
sandbox Sandbox repository (tutorials) 2
updates CentOS-6 - Updates 788
repolist: 19,325
[root@sandbox ~]#
我们可以看到Ambari 1.x类似的资源库名称就对了。
安装Ambari服务
我们可以通过ambari-server命令来安装,执行命令后注意2个提示,一个是JDK的安装,一个是数据库配置,这里我们都选择n,默认使用hdp的sandbox的默认配置就好了。
[root@sandbox ~]# yum install ambari-server
Loaded plugins: fastestmirror, priorities
Setting up Install Process
Loading mirror speeds from cached hostfile
* base: mirror.bit.edu.cn
* epel: ftp.cuhk.edu.hk
* extras: mirrors.hustunique.com
* updates: centos.ustc.edu.cn
Package ambari-server-1.7.0-169.noarch already installed and latest version
Nothing to do
[root@sandbox ~]# ambari-server setup
Using python /usr/bin/python2.6
Setup ambari-server
Checking SELinux...
SELinux status is 'disabled'
Ambari-server daemon is configured to run under user 'root'. Change this setting [y/n] (n)? y
Enter user account for ambari-server daemon (root):root
Adjusting ambari-server permissions and ownership...
Checking firewall...
Checking JDK...
Do you want to change Oracle JDK [y/n] (n)? n
Completing setup...
Configuring database...
Enter advanced database configuration [y/n] (n)? n
Default properties detected. Using built-in database.
Checking PostgreSQL...
Configuring local database...
Connecting to local database...done.
Configuring PostgreSQL...
Backup for pg_hba found, reconfiguration not required
Extracting system views...
...
Adjusting ambari-server permissions and ownership...
Ambari Server 'setup' completed successfully.
[root@sandbox ~]#
启动Ambari服务
[root@sandbox ~]# ambari-server start
Using python /usr/bin/python2.6
Starting ambari-server
Ambari Server running with 'root' 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.
[root@sandbox ~]# ambari-server status
Using python /usr/bin/python2.6
Ambari-server status
Ambari Server running
Found Ambari Server PID: 6597 at: /var/run/ambari-server/ambari-server.pid
[root@sandbox ~]#
启动后登陆Ambari
启动Ambari服务后,通过使用网络浏览器来打开Ambari的webui。
1在浏览器中输入http://yourserver:8080,yourserver是ambari服务器主机的名称。例如,我的机器名称sandbox,那么访问链接就是
http://sandbox:8080。
2使用默认的用户名/密码登录到Ambari服务器:admin/admin。您可以
稍后更改这些密码。