当前位置:网站首页>install ambari
install ambari
2022-08-03 04:05:00 【JACK-JIE】
安装Mysql
- 下载并安装
wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
yum -y install mysql57-community-release-el7-10.noarch.rpm
yum -y install mysql-community-server
- 启动mysqland check the password
Systemctl start mysqld
Grep “password” /var/log/mysqld.log
- 修改root密码
Alter user user() identified by ‘admin123’;
- 修改my.cnf配置文件
# 在[mysqld]下添加
collation_server=utf8_general_ci
character_set_server=utf8
default-storage-engine=INNODB
# 在[client]下添加(如果没有[client],则创建)
default_character-set=utf8
- 查看字符集
mysql> show variables like 'character_set_%';
+--------------------------+----------------------------+
| Variable_name | Value |
+--------------------------+----------------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | utf8 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | utf8 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
8 rows in set (0.00 sec)
- 创建ambariDatabase and users and remote login
mysql> create database ambari character set utf8;
Query OK, 1 row affected (5.00 sec)
mysql> CREATE USER 'ambari'@'%'IDENTIFIED BY 'admin123';
Query OK, 0 rows affected (0.00 sec)
mysql> GRANT ALL PRIVILEGES ON ambari.* TO 'ambari'@'%';
Query OK, 0 rows affected (0.00 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
- 创建hiveDatabase and users and remote login
mysql> create database hive character set utf8;
Query OK, 1 row affected (0.00 sec)
mysql> CREATE USER 'hive'@'%'IDENTIFIED BY 'admin123';
Query OK, 0 rows affected (0.00 sec)
mysql> GRANT ALL PRIVILEGES ON hive.* TO 'hive'@'%';
Query OK, 0 rows affected (0.00 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
- 创建oozieDatabase and users and remote login
mysql> create database oozie character set utf8;
Query OK, 1 row affected (0.00 sec)
mysql> CREATE USER 'oozie'@'%'IDENTIFIED BY 'admin123';
Query OK, 0 rows affected (0.00 sec)
mysql> GRANT ALL PRIVILEGES ON oozie.* TO 'oozie'@'%';
Query OK, 0 rows affected (0.00 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
- 创建rangerDatabase and users and remote login
mysql> create database ranger character set utf8;
Query OK, 1 row affected (0.00 sec)
mysql> CREATE USER 'rangeradmin'@'%'IDENTIFIED BY 'admin123';
Query OK, 0 rows affected (0.00 sec)
mysql> GRANT ALL PRIVILEGES ON ranger.* TO 'rangeradmin'@'%';
Query OK, 0 rows affected (0.00 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
安装apache
- 安装apache
Yum -y install httpd
- 启动
Systemctl start httpd
配置本地yum源
- 配置ambari.repo
[[email protected] yum.repos.d]# cat ambari.repo
# VERSION_NUMBER=2.7.3.0-139
[ambari-2.7.3.0]
# json.url = http://public-repo-1.hortonworks.com/HDP/hdp_urlinfo.json
name=ambari Version - ambari-2.7.3.0
baseurl=http://172.16.10.119/ambari/ambari/centos7/2.7.3.0-139
gpgcheck=1
gpgkey=http://172.16.10.119/ambari/ambari/centos7/2.7.3.0-139/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1
- 配置HDP.repo
[[email protected] yum.repos.d]# cat HDP.repo
# VERSION_NUMBER=3.1.0.0-78
[HDP-3.1.0.0]
name=HDP Version - HDP-3.1.0.0
baseurl=http://172.16.10.119/hdp/HDP/centos7
gpgcheck=1
gpgkey=http://172.16.10.119/hdp/HDP/centos7/3.1.0.0-78/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1
[HDP-UTILS-1.1.0.22]
name=HDP-UTILS Version - HDP-UTILS-1.1.0.22
baseurl=http://172.16.10.119/hdp/HDP-UTILS-1.1.0.22
gpgcheck=1
gpgkey=http://172.16.10.119/hdp/HDP-UTILS-1.1.0.22/HDP-UTILS/centos7/1.1.0.22/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1
[HDP-GPL-3.1.0.0]
name=HDP-UTILS Version - HDP-GPL-3.1.0.0
baseurl=http://172.16.10.119/hdp/HDP-GPL
gpgcheck=1
gpgkey=http://172.16.10.119/hdp/HDP-GPL/centos7/3.1.0.0-78/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1
- Create a source directory and extract the installation package
Mkdir /var/www/html/ambari
Mkdir /var/www/html/hdp
tar -zxvf ambari-2.7.3.0-centos7.tar.gz -C /var/www/html/ambari/
tar -zxvf HDP-3.1.0.0-centos7-rpm.tar.gz -C /var/www/html/hdp/
tar -zxvf HDP-UTILS-1.1.0.22-centos7.tar.gz -C /var/www/html/hdp/HDP-UTILS-1.1.0.22/
tar -zxf HDP-GPL-3.1.0.0-centos7-gpl.tar.gz -C /var/www/html/hdp/
- Generate local sources and create source data
createrepo /var/www/html/hdp/HDP/centos7/
createrepo /var/www/html/hdp/HDP-UTILS-1.1.0.22/
createrepo /var/www/html/hdp/HDP-GPL/
- 分发repo文件
Scp ambari.repo HDP.repo [email protected]:/etc/yum.repo.d/
Scp ambari.repo HDP.repo [email protected]:/etc/yum.repo.d/
配置ssh互信(所有机器都需要执行)
- Generate keys and password-free login
ssh-keygen -t rsa
ssh-copy-id -i [email protected]
ssh-copy-id -i [email protected]
ssh-copy-id -i [email protected]
配置hostsfile and hostname(所有服务器都需要执行
- 配置host文件
Cat /etc/hosts
172.16.10.119 yum yum.hdp
172.16.10.105 nd-00 nd-00.hdp
172.16.10.106 nd-01 nd-01.hdp
172.16.10.107 nd-02 nd-02.hdp
- 配置主机名
Hostnamectl set-hostname nd-00.hdp
修改network文件(所有机器都需要执行)
cat /etc/sysconfig/network
# Created by anaconda
NETWORKING=yes
HOSTNAME=nd-00.hdp
配置JAVA环境
- 解压JDK及配置环境变量
tar -zxf jdk-8u171-linux-x64.tar.gz -C /data/java
tee -a /etc/profile.d/java.sh <<EOF export JAVA_HOME=/data/java/jdk1.8.0_171 export JRE_HOME=/data/java/jdk1.8.0_171/jre export PATH=$PATH:/data/java/jdk1.8.0_171/bin export CLASSPATH=./:/data/java/jdk1.8.0_171/lib:/data/java/jdk1.8.0_171/jre/lib EOF
Source /etc/profile.d/java.sh
安装ambari-server及初始化(只在master安装)
- 下载mysql驱动
mv mysql-connector-java-8.0.5.jar /usr/share/java/mysql-connector-java.jar
- 安装ambari
yum -y install ambari-server
- 初始化ambari
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] Custom JDK
==============================================================================
Enter choice (1): 2 # 选择自定义jdk
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: /data/java/jdk1.8.0_171 # jdk安装路径
Validating JDK on Ambari Server...done.
Check JDK version for Ambari Server...
JDK version found: 8
Minimum JDK version is 8 for Ambari. Skipping to setup different JDK for Ambari Server.
Checking GPL software agreement...
GPL License for LZO: https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html
Enable Ambari Server to download and install GPL Licensed LZO packages [y/n] (n)? y
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 / MariaDB
[4] - PostgreSQL
[5] - Microsoft SQL Server (Tech Preview)
[6] - SQL Anywhere
[7] - BDB
==============================================================================
Enter choice (1): 3 # 选择安装的mysql
Hostname (localhost): nd-00 # 配置hostname
Port (3306): # 默认
Database name (ambari):
Username (ambari):
Enter Database Password (bigdata): # 密码不显示
Re-enter password:
Configuring ambari database...
Should ambari use existing default jdbc /usr/share/java/mysql-connector-java.jar [y/n] (y)? y
Configuring remote database connection properties...
WARNING: Before starting Ambari Server, you must run the following DDL directly from the database shell to create the schema: /var/lib/ambari-server/resources/Ambari-DDL-MySQL-CREATE.sql # 此处需注意,启动ambari之前需要执行此句
Proceed with configuring remote database connection properties [y/n] (y)? y
Extracting system views...
ambari-admin-2.7.3.0.139.jar
....
Ambari repo file contains latest json url http://public-repo-1.hortonworks.com/HDP/hdp_urlinfo.json, updating stacks repoinfos with it...
Adjusting ambari-server permissions and ownership...
Ambari Server 'setup' completed successfully. # 安装成功
- Import as promptedsql文件
Mysql -uambari -p
Use ambari
Source /var/lib/ambari-server/resources/Ambari-DDL-MySQL-CREATE.sql;
- 启动ambari-server
Ambari-server start
安装ambari-agent(Requires installation on all servers)
- 安装及启动
Yum -y install ambari-server
Ambari-agent start
访问Ambari web页面
- 默认端口8080,Username:admin;Password:admin;http://192.168.121.100:8080
- 开始安装集群,启用安装向导创建集群
- 配置集群名称
- 选择版本
- 配置节点、密钥
- 主机确认
- 选择大数据组件
- 节点分配
- 分配从属和客户端
- 定制服务
ambari-server setup --jdbc-db=mysql --jdbc-driver=/usr/share/java/mysql-connector-java.jar
- 集群整体概况,点击部署
- 等待启动完毕,不用担心警告,后期可以调整,搭建完成,可以在展示页面进行查看集群状态.
- 可以查看监控界面,可以看到大数据组件中出现错误,单个组件点开处理,由于本次搭建集群使用虚拟机,性能不好,可以少选择一些组件.
边栏推荐
- 第3周 用1层隐藏层的神经网络分类二维数据
- 这个困扰程序员50年的问题,终于要被解决了?
- v-on指令:为元素绑定事件
- online test paper concept
- Chapter 8 Character Input Output and Input Validation
- Jincang Database Pro*C Migration Guide ( 5. Program Development Example)
- LeetCode算法日记:面试题 03.04. 化栈为队
- OpenFOAM提取等职面并计算面积
- TCP 和UDP 的详细介绍
- ESP8266-Arduino编程实例-LED点阵驱动(基于Max7219)
猜你喜欢
随机推荐
How to write test cases in software testing technology (2)
ESP8266-Arduino编程实例-LED点阵驱动(基于Max7219)
单元测试是什么?怎么写?主要测试什么?
Oracle EMCC可以独立安装吗?还是必须安装到数据库服务器上?
测开:项目管理模块-项目curd开发
【STM32】入门(三):按键使用-GPIO端口输出控制
HI3521D 烧录128M nand flash文件系统过程-一定要注意flash的容量
IDEC和泉触摸屏维修HG2F-SS22V HG4F软件通信分析
Redis-Redisson介绍和用途
Auto.js Pro write the first script hello world
DC-5靶场下载及渗透实战详细过程(DC靶场系列)
基于Streamlit的YOLOv5ToX模型转换工具(适用YOLOv5训练出来的模型转化为任何格式)
肖sir__面试就业课___数据库
OpenFOAM extracts equivalency and calculates area
工程水文学试题库
直播|StarRocks 技术内幕 :低基数全局字典优化
正则表达式与绕过案例
v-on指令:为元素绑定事件
计组错题集
Linux-Docker-Redis安装