大数据学习资料领取地址 (免费)无套路 1.1 内存分配 将3台虚拟机分配好内存 建议8G、4G、4G 1.2 本次安装需要的jar包 #注意:必须是Oracle JDK、不要使用OpenJDK 1.3 更改Yum源 在三台节点(所有agent的节点)上执行下载第三方依赖 更改为阿里yum源 wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo yum clean all yum makecache 1.4 安装JDK #建议放在在这个目录下 tar -zxvf jdk-8u144-linux-x64.tar.gz -C /usr/java/ #有时候会有权限问题的坑 chown -R root:root /usr/java/ 1.5 安装配置mysql 此处略,看之前的文档及视频 注意点:此处用的是5.7的版本,远程使用时,记得更改给root改为"%"权限 (1)集群监控数据库 create database amon DEFAULT CHARSET utf8 COLLATE utf8_general_ci; grant all on amon.* TO 'amon'@'%' IDENTIFIED BY 'amon'; (2)hive数据库 create database hive DEFAULT CHARSET utf8 COLLATE utf8_general_ci; grant all on hive.* TO 'hive'@'%' IDENTIFIED BY 'hive'; (3)oozie数据库 create database oozie DEFAULT CHARSET utf8 COLLATE utf8_general_ci; grant all on oozie.* TO 'oozie'@'%' IDENTIFIED BY 'oozie'; (4)hue数据库 create database hue DEFAULT CHARSET utf8 COLLATE utf8_general_ci; grant all on oozie.* TO 'hue'@'%' IDENTIFIED BY 'hue'; 1.6 关闭SELINUX和防火墙 1) 临时关闭: setenforce 0 2) 修改配置文件/etc/selinux/config(重启生效) #将SELINUX=enforcing 改为 SELINUX=disabled #关闭防火墙 systemctl stop firewalld #禁用防火墙 systemctl disable firewalld #查看防火墙是否关闭 systemctl status firewalld 1.7 hosts映射 vi /etc/hosts 192.168.1.111 bigdata111 192.168.1.112 bigdata112 192.168.1.113 bigdata113 注:企业中不设置免密 1.8 下载第三方依赖 在三台节点(所有agent的节点)上执行下载第三方依赖 yum -y install chkconfig python bind-utils psmisc libxslt zlib sqlite cyrus-sasl-plain cyrus-sasl-gssapi fuse fuse-libs redhat-lsb 1.9 ssh免密登录 #生成公钥 ssh-keygen -t esa #拷贝公钥到其他节点(九遍) ssh-copy-id bigdata111 ssh-copy-id bigdata112 ssh-copy-id bigdata113 1.10 NTP时间和时钟同步服务(可略过) #查看时间帮助 timedatectl --help #设置为上海的时区 timedatectl set-timezone Asia/Shanghai #生产环境中一般会手动安装NTP服务(自己练习一下步骤可以省略) yum -y install ntp vi /etc/ntp.conf 添加如下 #time 前四行是使用网络时间 server 0.asia.pool.ntp.org server 1.asia.pool.ntp.org server 2.asia.pool.ntp.org server 3.asia.pool.ntp.org #生产中不能使用联网的话, 使用本地时间 server 192.168.1.0 iburst local clock #可以让192.168.1网段下所有IP都可以同步 restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap #启动ntpd (仅在主节点) systemctl start ntpd #查看ntpd的状态 systemctl status ntpd #关闭从节点时间同步 systemctl stop ntpd systemctl disable ntpd #查询ntpdate which ntpdate #让所有从节点与主节点同步 \ 注:集群中会每几个小时同步一次,保证时间一致 /usr/sbin/ntpdate bigdata111 #列出所有的时区 timedatectl list-timezones第2章 环境要求