ambari的安装
来源:互联网 发布:信息化校园大数据引领 编辑:程序博客网 时间:2024/06/06 02:09
一、环境初始化
1、配置yum源
用的公司配好的yum源,可以自己配置,repo文件也需要放到agent端机器。
[root@hadoop1 yum.repos.d]# cat ambari.repo #VERSION_NUMBER=2.5.1.0-159[ambari-2.5.1.0]name=ambari Version - ambari-2.5.1.0baseurl=http://mirror.xxxx.com/yum/ambari/centos6/gpgcheck=1gpgkey=http://mirror.xxxx.com/yum/ambari/centos6/RPM-GPG-KEY/RPM-GPG-KEY-Jenkinsenabled=1priority=1
2、时间同步
最简单的是手同步执行date -s 'xxx:xxx:xxx'
ntp时间同步服务器
3、检查防火墙
[root@hadoop1 opt]# service iptables status[root@hadoop1 opt]# service iptables stop
4、检查java是否安装
jdk的tar包安装
5、mysql的安装
mysql-5.5.39版本的安装
mysql-5.7.20版本的安装
二、准备工作
1、ambari数据库创建
[ambari@hadoop1 opt]# mysql -uroot -pmysql> create database ambari character set utf8;mysql> create user ambari identified by '1234';mysql> grant all privileges on ambari.* to 'ambari'@'localhost' identified by '1234';mysql> grant all privileges on ambari.* to 'ambari'@'%' identified by '1234';mysql> grant all privileges on ambari.* to 'ambari'@'192.168.30.145' identified by '1234';mysql> flush privileges;Query OK, 0 rows affected (0.00 sec)mysql> quit;Bye
三、ambari的安装
[root@hadoop1 opt]# yum install ambari-server
[root@hadoop1 opt]# ambari-server setup
解决方案:
#除了server端要升级mysql-connetor,agent端也需要安装,切记。[root@hadoop1 opt]# yum install mysql-connector-java -y[root@hadoop1 opt]# cd /usr/share/java/[root@hadoop1 java]# ls
[root@hadoop1 opt]# ambari-server setup[root@hadoop1 mysql]# ambari-server setupUsing python /usr/bin/pythonSetup ambari-serverChecking SELinux...SELinux status is 'disabled'Customize user account for ambari-server daemon [y/n] (n)? yEnter user account for ambari-server daemon (root):ambariAdjusting ambari-server permissions and ownership...Checking firewall status...Checking JDK...Do you want to change Oracle JDK [y/n] (n)? y[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): 3WARNING: 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: /opt/java Validating JDK on Ambari Server...done.Completing setup...Configuring database...Enter advanced database configuration [y/n] (n)? yConfiguring database...==============================================================================Choose one of the following options:[1] - PostgreSQL (Embedded)[2] - Oracle[3] - MySQL / MariaDB[4] - PostgreSQL[5] - Microsoft SQL Server (Tech Preview)[6] - SQL Anywhere[7] - BDB==============================================================================Enter choice (3): 3Hostname (192.168.30.145): 192.168.30.145 Port (3306): 3306Database name (ambari): ambariUsername (ambari): ambariEnter Database Password (1234): Configuring ambari database...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.sqlProceed with configuring remote database connection properties [y/n] (y)? yExtracting system views.............ambari-admin-2.5.1.0.159.jar.Adjusting ambari-server permissions and ownership...Ambari Server 'setup' completed successfully.
ambari数据库脚本导入
[ambari@bgs-8p80-udp-01 soft]# mysql -uambari -pmysql> use ambari;Database changedmysql> source /var/lib/ambari-server/resources/Ambari-DDL-MySQL-CREATE.sql;Query OK, 0 rows affected (0.03 sec)Records: 0 Duplicates: 0 Warnings: 0.....Query OK, 0 rows affected (0.03 sec)Records: 0 Duplicates: 0 Warnings: 0Query OK, 0 rows affected (0.08 sec)Records: 0 Duplicates: 0 Warnings: 0Query OK, 0 rows affected (0.02 sec)Records: 0 Duplicates: 0 Warnings: 0Query OK, 0 rows affected (0.00 sec)
设置Setup-JDBC
[root@hadoop1 opt]# ambari-server setup --jdbc-db=mysql --jdbc-driver=/usr/share/java/mysql-connector-java.jarUsing python /usr/bin/pythonSetup ambari-serverCopying /usr/share/java/mysql-connector-java.jar to /var/lib/ambari-server/resourcesIf you are updating existing jdbc driver jar for mysql with mysql-connector-java.jar. Please remove the old driver jar, from all hosts. Restarting services that need the driver, will automatically copy the new jar to the hosts.JDBC driver was successfully initialized.Ambari Server 'setup' completed successfully.
启动ambari
[root@hadoop1 opt]# ambari-server start
在浏览器中的打开ambari的访问页面,用户名和密码默认为admin。
阅读全文