首先说一下,这里是虚拟机环境.

1.用vbox安装centos6.8-mini

注意不要使用复制的方式安装,复制的虚拟机网络不通

安装如下:

主机 ip 角色 内存
hadoop1 192.168.0.10 namenode,HMASTER 2G
hadoop2 192.168.0.11 namenode,HiverServer2,HiveMetaStore 1G
hadoop3 192.168.0.12 ZooKeeper,DateNode,HRegionServer,JournalNode 2G
hadoop4 192.168.0.13 ZooKeeper,DateNode,HRegionServer,JournalNode 2G
hadoop5 192.168.0.14 ZooKeeper,DateNode,HRegionServer,JournalNode 2G

2.修改/etc/hosts

所有机器上执行

echo "127.0.0.1     localhost localhost">/etc/hosts
echo "192.168.0.10 hadoop1">>/etc/hosts
echo "192.168.0.11 hadoop2">>/etc/hosts
echo "192.168.0.12 hadoop3">>/etc/hosts
echo "192.168.0.13 hadoop4">>/etc/hosts
echo "192.168.0.14 hadoop5">>/etc/hosts

3.配置SSH互信

最好把root hdfs yarn都配上ssh互信

1.生成公钥

所有节点执行

ssh-keygen -t rsa -P ''

2.所有节点执行

ssh-copy-id -i ~/.ssh/id_rsa.pub 192.168.0.10
ssh-copy-id -i ~/.ssh/id_rsa.pub 192.168.0.11
ssh-copy-id -i ~/.ssh/id_rsa.pub 192.168.0.12
ssh-copy-id -i ~/.ssh/id_rsa.pub 192.168.0.13
ssh-copy-id -i ~/.ssh/id_rsa.pub 192.168.0.14

这样所有节点之间都有了互信

3.创建用户和组

在所有节点创建hdfs yarn hive zookeeper hbase用户,后续添加其它用户

groupadd hadoop
useradd -g hadoop hdfs
passwd hdfs <<EOF
hdfs
hdfs
EOF
useradd -g hadoop yarn
passwd yarn <<EOF
yarn
yarn
EOF
groupadd zookeeper
useradd -g zookeeper zookeeper
passwd zookeeper <<EOF
zookeeper
zookeeper
EOF
groupadd hive8
useradd -g hive hive
passwd hive <<EOF
hive
hive
EOF
groupadd hbase
useradd -g hbase hbase
passwd hbase <<EOF
hbase
hbase
EOF

4.修改系统参数

echo "session          required       /lib64/security/pam_limits.so ">> /etc/pam.d/login
echo "@hdfs - nofile 4096 ">>/etc/security/limits.conf
echo "@hive - nofile 4096 ">>/etc/security/limits.conf
echo "@yarn - nofile 4096 ">>/etc/security/limits.conf
echo "@zookeeper - nofile 4096 ">>/etc/security/limits.conf
echo "@hbase - nofile 4096 ">>/etc/security/limits.conf
echo "@hdfs - nproc 1024 ">>/etc/security/limits.conf
echo "@hive - nproc 1024 ">>/etc/security/limits.conf
echo "@yarn - nproc 1024 ">>/etc/security/limits.conf
echo "@zookeeper - nproc 1024 ">>/etc/security/limits.conf
echo "@hbase - nproc 1024 ">>/etc/security/limits.conf
echo "@hdfs - memlock 32768" >>/etc/security/limits.conf

设置完后,应用程序需要重启生效.

5.关闭防火墙及SELINUX

#关闭防火墙
service iptables stop
chkconfig iptables off
setenforce 0 #关闭selinux

永久关闭SELINUX:

vi /etc/selinux/config
SELINUX=disabled

6.安装ntp

yum -y install ntp

在ntp服务器节点:

vi /etc/ntp.conf
#本子网内主机都可以同步
restrict 192.168.0.0 mask 255.255.0.0 nomodify
#优先时间服务器
server 192.168.0.10 prefer
#当ntp server不可用,把本地时间做为ntp时间给端用
fudge 127.127.1.0 stratum 8
#日志文件位置
logfile /var/log/ntp.log

启动ntpd服务

service ntpd start

这里将使用192.168.0.10作为时间服务器,建议使用网上的时间服务器比较准确.

客户端节点:

vi /etc/ntp.conf
#优先时间服务器
server 192.168.0.10 prefer
#日志文件位置
logfile /var/log/ntp.log

客户端先手动同步一次时间:

nptdate hadoop1

然后启动nptd服务:

service ntpd start

查看npt状态:

watch ntpq -p

7.禁用IPV6

IPV6会引起某些问题,有些程序默认搜索IPV6.

参考:https://linux.cn/article-5417-1.html

vi /etc/sysctl.conf
# 禁用整个系统所有接口的IPv6
net.ipv6.conf.all.disable_ipv6 = 1
# 禁用某一个指定接口的IPv6(例如:eth0, lo)
net.ipv6.conf.lo.disable_ipv6 = 1
net.ipv6.conf.eth0.disable_ipv6 = 1 #使用修改生效:
$ sudo sysctl -p /etc/sysctl.conf

8.配置环境变量

下载java1.8,解压到/opt/下. vi /etc/profile

export JAVA_HOME=/opt/jdk1.8.0_131
PATH=$JAVA_HOME/bin:$PATH
export JAVA_HOME
export PATH

测试java:

java -version

1.linux环境配置的更多相关文章

  1. rancher说明为什么需要按照指定版本安装以及rancher和节点linux环境配置-docker指定版本安装

    rancher说明为什么需要按照指定版本安装以及rancher和节点linux环境配置-docker指定版本安装 待办 https://blog.csdn.net/CSDN_duomaomao/art ...

  2. JMeter学习-038-JMeter Linux 环境配置

    1.1.下载 Download URL:http://mirrors.tuna.tsinghua.edu.cn/apache//jmeter/binaries/apache-jmeter-3.0.tg ...

  3. linux环境配置nginx导致页面不刷新

    在linux环境下,配置了nginx负载均衡,由于可能在虚拟主机的配置文件nginx.conf中,对缓存机制未配置成功,导致页面不刷新,仍然显示缓存中的内容. 最后通过注释nginx.conf文件中的 ...

  4. [Linux]环境配置之jdk的安装 标签: jdk服务器linux 2016-08-07 22:18 502人阅读 评论(21)

    这两天服务器崩了,所以需要重新配置环境,然后从头到尾配置了一遍,现在记录总结一下自己这两天的工作,首先是jdk的配置! 很多软件,需要jdk为基础,所以第一个装的就是jdk. 第一步,拷贝文件 首先将 ...

  5. linux环境配置

    一.JDK安装 1.通过xftp工具把jdk-8u60-linux-x64.gz上传到linux 2.解压JDK命令tar -xzf jdk-8u60-linux-x64.gz 3.linux配置环境 ...

  6. 使用jEnv在Mac/Linux环境配置多版本Java

    jEnv 是什么? 先来看一下官方介绍 jEnv is a command line tool to help you forget how to set the JAVA_HOME environm ...

  7. Linux 环境配置 网络端口进程命令

    网络通信命令ping 命令路径:/bin/ping 执行权限:所有用户作用:测试网络的连通性语法:ping 选项 IP地址  -c 指定发送次数    ping 命令使用的是icmp协议,不占用端口e ...

  8. linux环境配置与使用合集

    配置linux和samba共享 1. 安装linux操作系统 2. 通过windows操作系统ping linux看看是否可以ping通 3. 相关软件安装 a. 安装samba sudo apt-g ...

  9. Linux环境配置与项目部署

    简介: Linux是一类Unix计算机操作系统的统称.Linux操作系统的内核的名字也是“Linux”.Linux操作系统也是自由软件和开放源代码发展中最著名的例子.严格来讲,Linux这个词本身只表 ...

随机推荐

  1. CF1066A Vova and Train(模拟)

    大水题... 题目要求你求能看到的灯笼数,我们可以分为3部分 总共的灯笼数——————1 在 l 左面的灯笼数(不包括lll)——————2 在 r 左面的灯笼数(包括rrr)——————3 我们知道 ...

  2. layui 图片与表单一起提交 + layer.photos图片层预览

    HTML基本结构: <form class="layui-form" action="" id="feedBackForm"> ...

  3. Hive(3)-meta store和hdfs详解,以及JDBC连接Hive

    一. Meta Store 使用mysql客户端登录hadoop100的mysql,可以看到库中多了一个metastore 现在尤其要关注这三个表 DBS表,存储的是Hive的数据库 TBLS表,存储 ...

  4. Makefile中的$(MAKE)

    今天看uboot2018顶层的Makefile中发现文件中export一个MAKE变量,export是为了向底层的Makefile传递这些变量参数,但是找了半天没有找到这个MAKE变量在哪定义的. 决 ...

  5. windows下安装mongodb的崩溃史

    一.下载 官方网站的下载页面打不开https://www.mongodb.com/download-center?jmp=nav 问朋友要了一份,是3.6的,下载安装会卡死.弄了一个小时也半点反应没有 ...

  6. Address already in use: JVM_Bind,tomcat启动异常

    严重: StandardServer.await: create[8050]: java.net.BindException: Address already in use: JVM_Bind tom ...

  7. 北京Uber优步司机奖励政策(1月22日

    滴快车单单2.5倍,注册地址:http://www.udache.com/ 如何注册Uber司机(全国版最新最详细注册流程)/月入2万/不用抢单:http://www.cnblogs.com/mfry ...

  8. 苏州Uber优步司机奖励政策(12月14日到12月20日)

    滴快车单单2.5倍,注册地址:http://www.udache.com/ 如何注册Uber司机(全国版最新最详细注册流程)/月入2万/不用抢单:http://www.cnblogs.com/mfry ...

  9. hive和关系型数据库

    1)hive和关系型数据库存储文件的系统不同.  hive使用hdfs(hadoop的分布式文件系统),关系型数据库则是服务器本地的文件系统: 2)hive使用的计算模型是mapreduce,而关系型 ...

  10. VueJs 学习笔记

    VueJs学习笔记 参考资料:https://cn.vuejs.org/ 特效库:TweenJS(补间动画库)  VelocityJS(轻量级JS动画库) Animate.css(CSS预设动画库) ...