赞
踩
安装时要放在英文路径的非根目录
网络驱动中第一个网卡为net模式(相当于路由器)网卡二一定要host-only, 不能改ip
创建、导出(ova)、导入(ova)、注册(vbox虚拟机路径)、复制
C:\Users\Administrator.VirtualBox
\HostInterfaceNetworking-VirtualBox Host-Only Ethernet Adapter-Dhcpd.config 修改vmbox配置文件
所有节点,net-tools、wget、epel-release
yum install wget 发送网络请求 下载包
yum install epel-release
yum install net-tools
yum install httpd
echo cdh2 > /etc/hostname 修改主机名
修改hosts映射(所有节点更改)
shell脚本批量打印
for i in {1..3};do echo -e 192.168.56.10$i\\tcdh$i; done
scp /root/new_ips.txt root@192.168.56.102:/root
scp 本地文件 远程用户:/目录
远程批量导入文本的文件
ssh root@cdh3 "cat new_ips.txt >> /etc/hosts"
主节点ssh通所有节点、所有节点都要进行ssh-keygen
[root@cdh1 ~]# ssh-keygen
[root@cdh1 ~]# ssh-copy-id cdh1
.ssh/id_rsa 私钥路径
.ssh/id_rsa.pub 公钥路径
#已知的主机公钥信息
[root@cdh1 ~]# cat .ssh/known_hosts
cdh2,192.168.56.102 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBGLnTWo8lyeLW4v+IseGTWYAEOzQf8eoa1ZwFC8j09ZdQBKCOfTM132hXgFemtE/Mg3DYXdTtm1BpZ8dX9FxmiE=
cdh1,192.168.56.101 ecdsa-sha2-nistp256
AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBGLnTWo8lyeLW4v+IseGTWYAEOzQf8eoa1ZwFC8j09ZdQBKCOfTM132hXgFemtE/Mg3DYXdTtm1BpZ8dX9FxmiE=
cdh3,192.168.56.103 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBGLnTWo8lyeLW4v+IseGTWYAEOzQf8eoa1ZwFC8j09ZdQBKCOfTM132hXgFemtE/Mg3DYXdTtm1BpZ8dX9FxmiE=
主节点做服务,子节点用主节点做服务器
https://chrony.tuxfamily.org/
sudo yum install chrony
/etc/chrony.conf
cdh1 1打开配置文件 vi /etc/chrony.conf 2注释 #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 3添加 server ntp.aliyun.com iburst 4运行所有 allow all cdh2,3 1打开配置文件 vi /etc/chrony.conf 2注释 #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 192.168.56.101 iburst #cdh1的ip 全部重启服务 systemctl restart chronyd 显示当前时间源的同步信息 chronyc sources
1过滤性防火墙2应用代理类型防火墙3复合型
启动: systemctl start firewalld.service 重启: systemctl restart firewalld.service 设置开机启动: systemctl enable firewalld.service 关闭开机启动: systemctl disable firewalld.service systemctl stop firewalld systemctl status firewalld systemctl disable firewalld firewall-cmd --panic-on# 拒绝所有包 firewall-cmd --panic-off#取消拒绝状态 firewall-cmd --query-panic #查看是否拒绝 firewall-cmd --reload #更新防火墙规则 fircwall-cmd --complete-rcload#重启服务 firewall-cmd --get-zone-of-interface=eth0#查看指定接口所属区域
yum install createrepo httpd -y
systemctl start httpd
systemctl enable httpd
cd /var/www/html/
mkdir cdh_local_repo
mkdir parcels
yum install createrepo
vi /etc/selinux/config
SELINUX=disabled
setenforce 0
getenforce
所有节点 defrag/enable false
透明巨页会导致异常节点重启和性能问题
cd /sys/kernel/mm/transparent_hugepage/
echo never > enabled
echo never > defrag
vi /etc/rc.d/rc.local
echo never > /sys/kernel/mm/transparent_hugepage/enabled
echo never > /sys/kernel/mm/transparent_hugepage/defrag
chmod +x /etc/rc.d/rc.local
结果 cat enabled [nerver]
所有节点 设置0
调优系统swappiness参数
设置vm.swappiness=0不会阻止VM交换。
vm.swappiness参数只是控制VM交换行为的积极性;它不会禁用VM的交换。
echo vm.swappiness=0 >> /etc/sysctl.conf
sysctl -p
mkdir cdh_local_repo(/var/www/html)
cd /etc/yum.repos.d/
cp CentOS-Base.repo CentOS-Local.repo
vi CentOS-Local.repo
[base]
name=CentOS-Local
baseurl=http://cdh1/cdh_local_repo
enabled=1
gpgcheck=0
复制到cdh2,3
cd /etc/yum.repos.d/
scp CentOS-Local.repo cdh2:/etc/yum.repos.d/CentOS-Local.repo
mv cm6.3.1 /var/www/html/cdh_local_repo
mv cdh6.3.2 /var/www/html/parcels
mv jdk-8u291-linux-x64.rpm /var/www/html/cdh_local_repo
先清除缓存 再创建
yum clean all
createrepo /var/www/html/cdh_local_repo/
yum repolist
主节点
wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
rpm -ivh mysql-community-release-el7-5.noarch.rpm
yum -y install mysql-server
systemctl start mysqld
systemctl enable mysqld
安装jdk(所有节点)
yum install jdk
安装jdbc(主节点)
mkdir -p /usr/share/java
wget https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.46.tar.gz
tar -xvf mysql-connector-java-5.1.46.tar.gz
cp mysql-connector-java-5.1.46/mysql-connector-java-5.1.46-bin.jar /usr/share/java/mysql-connector-java.jar
mysql -uroot -p
grant all privileges on *.* to root@'cdh1' identified by "cqie" with grant option;
flush privileges;
grant all privileges on *.* to root@'localhost' identified by "cqie" with grant option;
flush privileges;
grant all privileges on *.* to root@'%' identified by "cqie" with grant option;
flush privileges;
groupadd supergroup
usermod -a -G supergroup root
create database scm default character set utf8;
create database metastore default character set utf8;
create database hue default character set utf8;
flush privileges;
grant all privileges on . to root@‘cdh’ idfentified by “cqie”
flush privileges; //刷新MySQL的系统权限相关表
GRANT:赋权命令
ALL PRIVILEGES:当前用户的所有权限
ON:介词
*.*:当前用户对所有数据库和表的相应操作权限
TO:介词
'root'@'%':权限赋给root用户,所有ip都能连接
IDENTIFIED BY ‘123456':连接时输入密码,密码为cqie
WITH GRANT OPTION:允许级联赋权
主节点安装server ,所有节点安装agent
安装cloudera
cdh1安装
yum install cloudera-manager-server -y
yum install cloudera-manager-agent -y
yum install cloudera-manager-daemons -y
所有节点安装
yum install cloudera-manager-agent -y
yum install cloudera-manager-daemons -y
配置cloudera 在全部节点修改agent配置文件
vi /etc/cloudera-scm-agent/config.ini
server_host=cdh1
cloudera连接mysql
/opt/cloudera/cm/schema/scm_prepare_database.sh mysql scm root cqie
启动cloudera服务
systemctl start cloudera-scm-server
systemctl start cloudera-scm-agent
版本选择Select Edition/cloudera express
Specify Hosts/当前管理的主机
选择存储库/使用parcel更多选项/远程 Parcel 存储库 URL/填写本地Parcel服务路径
http://cdh1/parcels/
Inspect Cluster/直接选择I understand the risks, let me continue with cluster setup.
DataNode,zookeeper所有主机
审核更改/HDFS 块大小:64/除hive以外的所有路径前加/opt
遇到的问题很多,都在老师和网上查询逐一解决了。
首先在vmbox安装的时候因为自己提前安装了节点,导致配置节点ip不是从101开始
解决办法:通过修改vmbox配置文件 重置vmbox
修改主机名和hosts映射 之前一直用系统命令修改主机名学会了用echo 和 shell脚本快速批量写入
hostnamectl set-hostname 主机名
echo cdh2 > /etc/hostname 修改主机名
for i in {1..3};do echo -e 192.168.56.10$i\\tcdh$i; done
更加熟练Linux命令,增加权限,修改配置文件等 。
在配置本地yum源文件的时候一直不生效 写了name=CentOS-Local 源里面还是没有。
解决办法:因为前面的[base]名字冲突导致的 把base改为base_local
最后CDH上HDFS没有跑起来,提示说java啥的
解决办法:是因为只在主节点安装了jdk,需要所有节点安装
clouderamanager界面没有显示三台主机
解决办法:systemctl start cloudera-scm-agent其他几个节点要全部启动
和hosts映射 之前一直用系统命令修改主机名学会了用echo 和 shell脚本快速批量写入
hostnamectl set-hostname 主机名
echo cdh2 > /etc/hostname 修改主机名
for i in {1..3};do echo -e 192.168.56.10$i\\tcdh$i; done
更加熟练Linux命令,增加权限,修改配置文件等 。
在配置本地yum源文件的时候一直不生效 写了name=CentOS-Local 源里面还是没有。
解决办法:因为前面的[base]名字冲突导致的 把base改为base_local
最后CDH上HDFS没有跑起来,提示说java啥的
解决办法:是因为只在主节点安装了jdk,需要所有节点安装
clouderamanager界面没有显示三台主机
解决办法:systemctl start cloudera-scm-agent其他几个节点要全部启动
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。