1.http://www.cnblogs.com/Springmoon-venn/p/8948143.html 配置详细很好
centos7 hadoop3
https://www.cnblogs.com/robert-blue/p/4133467.html
2.免密登录记得修改文件权限 否则会有权限错误:
3.centos6 7 命令区别:https://www.jianshu.com/p/18d7416385f7
1.=》
2.时间centos6 ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
centos7 # timedatectl set-timezone Asia/Shanghai
4.更改主机名:
之前也修改了 看不到效果需要重新登陆一下
https://blog.csdn.net/shuaigexiaobo/article/details/78190168
5.centOS6.9 防火墙的关闭以及开启
有的时候,我们需要对系统的防火墙进行操作,今天小编就给大家讲解一下如何开启以及关闭CentOS6.9系统下的防火墙。
输入:cat /etc/issue 查看版本
(一)通过service命令
service命令开启以及关闭防火墙为即时生效,下次重启机器的时候会自动复原。
查看防火墙状态:service iptables status ,记得在CentOS6.9中是输入iptables,网上有些教程使用service iptable status 命令并不可行。
关闭防火墙:service iptables stop
打开防火墙:service iptables start
总结:
打开防火墙:service iptables start
关闭防火墙:service iptables stop
查看防火墙状态:service iptables status
(二)通过:/etc/init.d/iptables 进行操作
查看防火墙状态:/etc/init.d/iptables/status
关闭防火墙:/etc/init.d/iptables stop(这是临时关闭,关闭的是当前运行的防火墙,重启之后防火墙又会启动,因为它是开机自启动的)
这是临时关闭,关闭的是当前运行的防火墙,重启之后防火墙又会启动,因为它是开机自启动的,它相当于/etc/init.d/iptables start
(三)需要改为开机不启动,使用chkconfig命令
永久开启防火墙: chkconfig iptables on
查看状态:chkconfig --list iptables
永久关闭防火墙:
chkconfig iptables off
https://blog.csdn.net/sgrrmswtvt/article/details/81915206=》
6.Centos设置静态IP,修改主机名,主机与主机名映射
1、IP地址配置,最简单的一种
在命令运行 setup,带提示,按照提示修改即可
1
2、手动配置网络和主机名
2.1、修改主机名
vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=主机名称
2.2、修改ip地址(根据自己的网卡的配置文件来 我的网卡是ens33)
vi /etc/sysconfig/network-scripts/ifcfg-ens33
TYPE=Ethernet
BOOTPROTO=static #原始值为dhcp
IPADDR=10.10.0.120 #随便搞一个
NETMASK=255.255.255.0 #子网掩码
GATEWAY=10.10.0.100 #网关
DNS1=10.10.0.100 #DNS服务器
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
NAME=ens33
DEVICE=ens33
ONBOOT=yes #原始值为no,改为yes,设置网卡开机启动
修改好了之后使用service network restart重启下
2.3、修改ip地址和主机名的映射关系
vi /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
10.10.0.120 hadoop-120
10.10.0.121 hadoop-121
然后重启就可以看见效果了
http://www.cnblogs.com/HondaHsu/p/5951687.html=》
7.在VMware的虚拟机中克隆CentOS,在重启网卡的时候报错:
解决办法:
首先,打开/etc/udev/rules.d/70-persistent-net.rules内容如下面例子所示
# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.
# PCI device 0x8086:0x100f (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:67:c5:e2", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
# PCI device 0x8086:0x100f (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:75:d1:d7", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
我们查看克隆源系统与克隆后中eth0的配置:
#cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
HWADDR=00:0C:29:67:C5:E2
TYPE=Ethernet
UUID=5cb1d564-a7e8-4b57-bdb4-7e76e92f460a
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=dhcp
可以看出,克隆的时候把网卡的MAC地址也克隆了,导致了有两个系统有相同的MAC地址。
方法一、DEVICE=eth0改成DEVICE=eth1,然后HWADDR改成00:0c:29:75:d1:d7,然后把 ifcfg-eth0改名为ifcfg-eth1
方法二、在70-persistent-net.rules文件中把eth0的地址改成00:0c:29:75:d1:d7,同时把eth1的配置注释掉,然后在ifcfg-eth0中修改HWADDR。
最后 service network restart即可。
hadoop启动后jps查不到namenode的解决办法: https://www.cnblogs.com/lishpei/p/6136043.html