Tag Archives: Firewall

Centos7 view and close firewall

CentOS 7.0 defaults to firewall as a firewall

view firewall status

firewall-cmd --state

Stop is firewall

systemctl stop firewalld.service

firewall is prohibited to turn on

systemctl disable firewalld.service 

turn off from CentOS 6 and CentOS 7 firewall

close selinux
into /etc/selinux/config file

vi /etc/selinux/config

the SELINUX = instead of enforcing the SELINUX = disabled

confers the non-secret login command

ssh-keygen -t rsa 
ssh-copy-id root@master

scp -P 22 /Users/che/Downloads/jdk-8u161-linux-x64.rpm [email protected]:/software/

 安装: yum install -y jdk-8u161-linux-x64.rpm
 设置环境变量
 cd /usr/java/

 /usr/java/jdk1.8.0_161

 vi /etc/profile

 export JAVA_HOME=/usr/java/jdk1.8.0_161
 export PATH=$JAVA_HOME/bin:$PATH

install hadoop
download installation package
hadoop-26.5.tar.gz

cd /usr/
mv /software/hadoop-2.6.5.tar.gz  ./
解压
tar -xzvf ./hadoop-2.6.5.tar.gz

创建目录
   namenode目录:/data/hadoop/namenode
   data目录:    /data/hadoop/data
   tmp目录:     /data/hadoop/tmp
   mkdir -p /data/hadoop/namenode

配制
   core-site.xml
   hdfs-site.xml
   mapred-site.xml.template   mapred-site.xml
   cp mapred-site.xml.template   mapred-site.xml
   yarn-site.xml 

   slaves   (slave1,slave2)
   masters  (master)

   hadoop-env.sh
   export JAVA_HOME=/usr/java/jdk1.8.0_161

   将master的配制copy到slave1、slave2
   scp -r ./* root@slave1:/software/hadoop-2.6.5/etc/hadoop/

 格式化
   cd hadoop-2.6.5/bin
   ./hdfs namenode -format

 启动
   cd ../sbin/

   ./start-dfs.sh

   ssh-copy-id root@master 

   jps(检查一下)

   ./start-yarn.sh

   cd ../bin

   hadoop fs -ls /
   hadoop fs -mkdir /user

   /software/hadoop-2.6.5/bin

   vi/etc/profile

   export HADOOP_HOME=/software/hadoop-2.6.5
   export PATH=$JAVA_HOME/bin:$HADOOP_HOME/bin:$PATH

   source /etc/profile

   hadoop fs -put /software/hadoop-2.6.5.tar.gz /user

   测试2:
   cd share/hadoop/mapreduce
   hadoop jar ./hadoop-mapreduce-examples-2.6.5.jar pi 5 10

   192.168.1.100:50070
   192.168.1.100:8088

   修改ssh端口
   vim /etc/ssh/sshd_config  

set NTP time synchronization service
, install NTP
yum install -y NTP
2, set NTP service startup
chkconfig NTPD on
service NPTD start