Hadoop记录-安装ambari hdp集群
- #!/bin/sh
- #配置用户sudo权限(参考/etc/sudoers文件,在/etc/sudoers.d/新建一个用户配置文件,注意要注销)
- #需要在/etc/sudoers末尾追加:sfapp ALL=(ALL) NOPASSWD:ALL
- #JDK配置,三台机器已配置,略
- #修改hostname和加入主机映射(/etc/hosts)
- #配置网络/etc/sysconfig/network
- #配置无密登录
- #ssh免秘钥登录需在sfapp用户下完成;
- #在10.202.107.27 cnsz22VLK5444执行
- #ssh-keygen #回车
- #ssh-copy-id -i /home/sfapp/.ssh/id_rsa.pub sfapp@10.202.107.28 #拷贝公钥
- #ssh-copy-id -i /home/sfapp/.ssh/id_rsa.pub sfapp@10.202.107.211 #拷贝公钥
- #ssh sfapp@10.202.107.28 #测试登录
- #ssh sfapp@10.202.107.211 #测试登录
- #ssh-keygen -t rsa
- #ssh-copy-id slave1
- #ssh-copy-id slave2
- #ssh-copy-id master
- #在 master机器生成公钥文件
- #ssh-keygen -t rsa
- #cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
- #chmod 600 ~/.ssh/authorized_keys
- #拷贝到其他主机上
- #scp ~/.ssh/authorized_keys root@slave1:~/.ssh/
- #scp ~/.ssh/authorized_keys root@slave2:~/.ssh/
- #ssh cnsz22VLK5444 date
- #ssh cnsz22VLK5445 date
- #ssh cnsz22VLK7714 date
- #修改文件打开限制(所有机器)
- #vim /etc/security/limits.conf
- # End of file
- #* soft nofile 65536
- #* hard nofile 65536
- #* soft nproc 131072
- #* hard nproc 131072
- #sysctl -p
- #关闭防火墙和selinux
- #ssh sfapp@10.202.107.27 "sudo systemctl stop firewalld;sudo systemctl disable firewalld"
- #ssh sfapp@10.202.107.27 "sudo setenforce 0;sudo sed -ri '/^SELINUX/cSELINUX=disabled' /etc/selinux/config"
- #ssh sfapp@10.202.107.28 "sudo systemctl stop firewalld;sudo systemctl disable firewalld"
- #ssh sfapp@10.202.107.28 "sudo setenforce 0;sudo sed -ri '/^SELINUX/cSELINUX=disabled' /etc/selinux/config"
- #ssh sfapp@10.202.107.211 "sudo systemctl stop firewalld;sudo systemctl disable firewalld"
- #ssh sfapp@10.202.107.211 "sudo setenforce 0;sudo sed -ri '/^SELINUX/cSELINUX=disabled' /etc/selinux/config"
- #配置ntp时钟(master做时钟服务器,其他slave同步时钟)
- #sudo yum -y install ntp
- #vim /etc/ntp.conf
- #restrict 10.202.0.0 mask 255.255.255.0
- #注释以下内容
- #server 0.centos.pool.ntp.org iburst
- #server 1.centos.pool.ntp.org iburst
- #server 2.centos.pool.ntp.org iburst
- #server 3.centos.pool.ntp.org iburst
- #server 127.127.1.0
- #fudge 127.127.1.0 stratum 10
- #systemctl start ntpd.service #启动服务
- #systemctl enable ntpd.service #开机自启动
- #从节点同步主节点的十种
- #crontab -e
- #0-59/10 * * * * /usr/sbin/ntpdate 10.202.107.27
- #crontab -l
- #0-59/10 * * * * /usr/sbin/ntpdate 10.202.107.27
- #其他系统设置
- #sudo sh -c "echo umask 0022 >> /etc/profile"
- #yum -y install httpd
- #vim /etc/httpd/conf/httpd.conf 修改端口80为81,修改DocumentRoot 为"/app/ambari"
- #sudo systemctl restart httpd.service
- #chown -R sfapp. /app/ambari 设置sfapp所有
- #浏览器测试登录
- #下载文件
- #HDP:http://public-repo-1.hortonworks.com/HDP/centos7/2.x/updates/2.6.3.0/HDP-2.6.3.0-centos7-rpm.tar.gz
- #ambari:http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.6.0.0/ambari-2.6.0.0-centos7.tar.gz
- #HDP-UTILS:http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.21/repos/centos7/HDP-UTILS-1.1.0.21-centos7.tar.gz
- #上传文件ambari-2.6.0.0-centos7.tar.gz HDP-2.6.3.0-centos7-rpm.tar.gz HDP-UTILS-1.1.0.21-centos7.tar.gz
- #tar -zxvf ambari-2.6.0.0-centos7.tar.gz
- #tar -zxvf HDP-2.6.3.0-centos7-rpm.tar.gz
- #mkdir HDP-UTILS
- #tar -zxvf HDP-UTILS-1.1.0.21-centos7.tar.gz -C HDP-UTILS
- #浏览器测试是否能访问到文件
- #制作本地源
- #yum install yum-utils createrepo yum-plugin-priorities -y
- #createrepo ./
- ##ambari.repo
- #[ambari-2.6.0.0]
- #name=ambari Version - ambari-2.6.0.0
- #baseurl=http://10.202.107.27:81/ambari/centos7/2.6.0.0-267
- #gpgcheck=0
- #gpgkey=http://10.202.107.27:81/ambari/centos7/2.6.0.0-267/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
- #enabled=1
- #priority=1
- ##hdp.repo
- #[HDP-2.6.3.0]
- #name=HDP Version - HDP-2.6.3.0
- #baseurl=http://10.202.107.27:81/HDP/centos7/2.6.3.0-235
- #gpgcheck=1
- #gpgkey=http://10.202.107.27:81/HDP/centos7/2.6.3.0-235/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
- #enabled=1
- #priority=1
- #[HDP-UTILS-1.1.0.21]
- #name=HDP-UTILS Version - HDP-UTILS-1.1.0.21
- #baseurl=http://10.202.107.27:81/HDP-UTILS
- #gpgcheck=1
- #gpgkey=http://10.202.107.27:81/HDP-UTILS/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
- #enabled=1
- #priority=1
- ##cp ambari.repo hdp.repo /etc/yum.repos.d/
- ##scp ambari.repo hdp.repo slave1:/etc/yum.repos.d/
- #yum clean all
- #yum makecache
- #yum repolist
- #安装和配置ambari-server
- #yum -y install ambari-server
- #ambari-server setup
- #n-3-n
- #ambari-server start
- #浏览器测试:ip:8080 admin/admin
- ##安装mysql
- #yum -y install mariadb mariadb-server
- #systemctl start mariadb
- #systemctl enable mariadb
- #mysql_secure_installation
- #Enter current password for root (enter for none):<–初次运行直接回车
- #Set root password? [Y/n] <– 是否设置root用户密码,输入y并回车或直接回车
- #New password: <– 设置root用户的密码
- #Re-enter new password: <– 再输入一次你设置的密码
- #Remove anonymous users? [Y/n] <– 是否删除匿名用户,回车
- #Disallow root login remotely? [Y/n] <–是否禁止root远程登录,回车,
- #Remove test database and access to it? [Y/n] <– 是否删除test数据库,回车
- #Reload privilege tables now? [Y/n] <– 是否重新加载权限表,回车
- #mysql -uroot -ppassword
- #vim /etc/my.cnf
- #在[mysqld]标签下添加
- init_connect='SET collation_connection = utf8_unicode_ci' init_connect='SET NAMES utf8' character-set-server=utf8
- collation-server=utf8_unicode_ci
- skip-character-set-client-handshake
- vim /etc/my.cnf.d/client.cnf
- #在[client]中添加
- default-character-set=utf8
- vim /etc/my.cnf.d/mysql-clients.cnf
- #在[mysql]中添加
- default-character-set=utf8
- #全部配置完成,重启mariadb
- systemctl restart mariadb
- #之后进入MariaDB查看字符集
- mysql> show variables like "%character%";show variables like "%collation%";
- mysql>create user username@localhost identified by 'password';
- mysql>grant all on *.* to username@localhost indentified by 'password';
- mysql>grant all privileges on *.* to username@'%' identified by 'password';
- mysql>grant all privileges on *.* to username@'hostname' identified by 'password' with grant option;
- #其中只授予部分权限把 其中 all privileges或者all改为select,insert,update,delete,create,drop,index,alter,grant,references,reload,shutdown,process,file其中一部分。
- ####创建数据库参考
- CREATE DATABASE ambari;
- use ambari;
- CREATE USER 'ambari'@'%' IDENTIFIED BY 'ambarizk123';
- GRANT ALL PRIVILEGES ON *.* TO 'ambari'@'%';
- CREATE USER 'ambari'@'localhost' IDENTIFIED BY 'ambarizk123';
- GRANT ALL PRIVILEGES ON *.* TO 'ambari'@'localhost';
- CREATE USER 'ambari'@'master' IDENTIFIED BY 'ambarizk123';
- GRANT ALL PRIVILEGES ON *.* TO 'ambari'@'master';
- FLUSH PRIVILEGES;
- source /var/lib/ambari-server/resources/Ambari-DDL-MySQL-CREATE.sql
- show tables;
- use mysql;
- select Host User Password from user where user='ambari';
- CREATE DATABASE hive;
- use hive;
- CREATE USER 'hive'@'%' IDENTIFIED BY 'hive';
- GRANT ALL PRIVILEGES ON *.* TO 'hive'@'%';
- CREATE USER 'hive'@'localhost' IDENTIFIED BY 'hive';
- GRANT ALL PRIVILEGES ON *.* TO 'hive'@'localhost';
- CREATE USER 'hive'@'master' IDENTIFIED BY 'hive';
- GRANT ALL PRIVILEGES ON *.* TO 'hive'@'master';
- FLUSH PRIVILEGES;
- CREATE DATABASE oozie;
- use oozie;
- CREATE USER 'oozie'@'%' IDENTIFIED BY 'oozie';
- GRANT ALL PRIVILEGES ON *.* TO 'oozie'@'%';
- CREATE USER 'oozie'@'localhost' IDENTIFIED BY 'oozie';
- GRANT ALL PRIVILEGES ON *.* TO 'oozie'@'localhost';
- CREATE USER 'oozie'@'master' IDENTIFIED BY 'oozie';
- GRANT ALL PRIVILEGES ON *.* TO 'oozie'@'master';
- FLUSH PRIVILEGES;
- ###配置jdbc驱动
- mkdir /usr/share/java
- #下载并上传mysql-connector-java-5.1.40.jar重命令为mysql-connector-java.jar
- cp /usr/share/java/mysql-connector-java.jar /var/lib/ambari-server/resources/mysql-jdbc-driver.jar
- vim /etc/ambari-server/conf/ambari.properties
- #添加server.jdbc.driver.path=/usr/share/java/mysql-connector-java.jar
- ambari-server setup
- #y-输入用户sfapp-3-配置jdk路径-y-3-配置mysql信息(主机、端口、数据库名、用户、密码)-y
- ambari-server stop
- ambari-server start
- ###网页引导安装
- #Launch Install Wizard-输入集群名字-选择版本、选择操作系统、配置仓库路径
- http://10.202.107.27:81/HDP/centos7/2.6.3.0-235
- http://10.202.107.27:81/HDP-UTILS
- #输入主机名或IP地址,导入主服务器的ssh私钥
- #或者不导入私钥选第二个,在从服务器安装yum -y install ambari-agent sudo ambari-agent restart
- #如果这里出现问题执行
- ambari-server stop
- ambari-server reset #重置命令
- ambari-server setup #重新设置
- ambari-server start
- tail -300f /var/log/ambari-server/ambari-server.log
- #选择安装的服务、配置参数
- #安装完成
- array=("sfapp@cnsz22VLK5444" "sfapp@cnsz22VLK5445" "sfapp@cnsz22VLK7714")
- for i in "${array[@]}"
- do
- if [ ! -n $i ]
- then
- echo "HOSTNAME IS NULL"
- else
- ssh "$i" "ntpdate -u 6.6.1.52" #ssh登录
- echo "$i"
- fi
- done
- beeline -u " jdbc:hive2://10.202.77.201:10000" -n hive -p hive
- set hive.execution.engine=tez;
- hive -service hivemetastore
- hive -service hiveserver2
- hive -S -e "select * from xxx" --S静音模式不打印MR2的进度信息 e加载hql查询语句
- hive -f test.hql --加载一个hql文件
- source test.hql
- for f in 'rpm -qa | grep xxx';do rpm -e --nodeps ${f} done;
Hadoop记录-安装ambari hdp集群的更多相关文章
- cent os 6.5+ambari+HDP集群安装
1. 搭建一个测试集群,集群有4台机器,配置集群中每一台机器的/etc/hosts文件: [root@nn .ssh]# cat /etc/hosts 127.0.0.1 localhost loca ...
- Ambari HDP集群搭建全攻略
世界上最快的捷径,就是脚踏实地,本文已收录[架构技术专栏]关注这个喜欢分享的地方. 最近因为工作上需要重新用Ambari搭了一套Hadoop集群,就把搭建的过程记录了下来,也希望给有同样需求的小伙伴们 ...
- Ambari HDP集群搭建文档
一.配置主机和节点机器之间SSH无密登录 多台外网服务器配置时,需要在/etc/hosts中把本机的IP地址设置为内网IP地址 http://2d67df38.wiz02.com/share/s/0J ...
- 基于Ambari Server部署HDP集群实战案例
基于Ambari Server部署HDP集群实战案例 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.部署Ambari Server端 博主推荐阅读: https://www.c ...
- 菜鸟玩云计算之十八:Hadoop 2.5.0 HA 集群安装第1章
菜鸟玩云计算之十八:Hadoop 2.5.0 HA 集群安装第1章 cheungmine, 2014-10-25 0 引言 在生产环境上安装Hadoop高可用集群一直是一个需要极度耐心和体力的细致工作 ...
- 菜鸟玩云计算之十九:Hadoop 2.5.0 HA 集群安装第2章
菜鸟玩云计算之十九:Hadoop 2.5.0 HA 集群安装第2章 cheungmine, 2014-10-26 在上一章中,我们准备好了计算机和软件.本章开始部署hadoop 高可用集群. 2 部署 ...
- Hadoop 2.7.3 分布式集群安装
1. 集群规划: 192.168.1.252 palo252 Namenode+Datanode 192.168.1.253 palo253 YarnManager+Datanode+Secondar ...
- Hadoop 3.1.1 - 概述 - 集群安装
Hadoop 集群安装 目标 本文描述了如何从少数节点到包含上千节点的大规模集群上安装和配置 Hadoop 集群.如果只是为了尝试,你可以先从单台机器上安装开始(参阅单节点安装). 本文并不包含诸如安 ...
- HDP2.4安装(五):集群及组件安装
HDP(Hortonworks Data Platform)是hortworks推出的100%开源的hadoop发行版本,以YARN 作为其架构中心,包含pig.hive.phoniex.hbase. ...
随机推荐
- UOJ356 [JOI2017春季合宿] Port Facility 【启发式合并】【堆】【并查集】
题目分析: 好像跑得很快,似乎我是第一个启发式合并的. 把玩具看成区间.首先很显然如果有两个玩具的进出时间有$l1<l2<r1<r2$的关系,那么这两个玩具一定在不同的栈中间. 现在 ...
- BZOJ 1497 最大获利
最大权闭合子图 对于这个题,可以抽象成一个图论模型,如果我们把用户与其要求建立的中转站连边,获得的利益看成正权值,付出的代价看成负权值,我们可以发现,选取一个用户的时候,就相当于选取了一个闭合子图. ...
- 聊聊openjdk的BufferPoolMXBean
本文主要研究一下openjdk的BufferPoolMXBean PlatformManagedObjectjava.management/java/lang/management/PlatformM ...
- luogu4728 双递增序列 (dp)
设f[i][j]表示以i位置为第一个序列的结尾,第一个序列的长度为j,第二个序列的结尾的最小值 那么对于f[i][j],有转移$f[i+1][j+1]=min\{f[i+1][j+1],f[i][j] ...
- BZOJ2244 拦截导弹
此题最早看到是在我还什么都不会的去年的暑期集训,是V8讲的DP专题,我当时还跑去问这概率怎么做.这道题要求的是二维最长不上升子序列,加上位置一维就成了三维偏序问题,也就是套用CDQ分治,对位置排序,然 ...
- http://bsideup.blogspot.com/2015/04/spring-boot-thrift-part3.html
Building Microservices with Spring Boot and Apache Thrift. Part 3. Asynchronous services Posted on 4 ...
- Django 数据库常见操作
首先要配置数据映射具体在这个连接里 https://www.cnblogs.com/Niuxingyu/p/10296143.html Django 建立数据库模型 #导包导入django数据库类 f ...
- Nginx上部署HTTPS + HTTP2
Nginx上部署HTTPS依赖OpenSSL库和包含文件,即须先安装好libssl-dev(或者OpenSSL),且ln -s /usr/lib/x86_64-linux-gnu/libssl.so ...
- 苹果电脑利用curl下载数据集
在看tensorflow书上迁徙学习的这一部分的时候,书上说利用 curl http://download.tensorflow.org/example_images/flower_photos.tg ...
- hdu 4333"Revolving Digits"(KMP求字符串最小循环节+拓展KMP)
传送门 题意: 此题意很好理解,便不在此赘述: 题解: 解题思路:KMP求字符串最小循环节+拓展KMP ①首先,根据KMP求字符串最小循环节的算法求出字符串s的最小循环节的长度,记为 k: ②根据拓展 ...