vim /etc/sudoers 添加sudo权限
adduser 添加用户
passwd 修改密码
sudo vim /etc/sysconfig/network 修改名称
sudo vim /etc/sysconfig/network-scripts/ifcfg-eth0 网卡配置
#DEVICE=eth0
#HWADDR=00:0C:29:30:AA:7B
#TYPE=Ethernet
#UUID=58ef90fb-7b23-475d-92cc-beee8dfe4592
#ONBOOT=no
#NM_CONTROLLED=yes
#BOOTPROTO=dhcp
DEVICE=eth0
TYPE=Ethernet
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.152.100
PREFIX=24
GATEWAY=192.168.152.2 VMnet8
DNS1=192.168.152.2 VMnet8
NAME=eth0
sudo vim /etc/hosts 配置host
192.168.152.102 hadoop102
192.168.152.103 hadoop103
192.168.152.104 hadoop104
service network restart 重启网卡
module
software
安装jdk
#JAVA_HOME
export JAVA_HOME=/opt/module/jdk1.8.0_144
export PATH=$PATH:$JAVA_HOME/bin
source /etc/profile 刷新
cat /etc/profile >> ~/.bashrc 追加到
sudo vim /etc/udev/rules.d/70-persistent-net.rules 删除一块网卡
ssh-keygen -t rsa 生成密钥
ssh-copy-id 192.168.56.10? 密钥分发
关闭防火墙
service iptables stop
永久禁用防火墙
chkconfig iptables off
分发脚本
#!/bin/bash
#1 获取输入参数个数,如果没有参数,直接退出
pcount=$#
if((pcount==0)); then
echo no args;
exit;
fi
#2 获取文件名称
p1=$1
fname=`basename $p1`
echo fname=$fname
#3 获取上级目录到绝对路径
pdir=`cd -P $(dirname $p1); pwd`
echo pdir=$pdir
#4 获取当前用户名称
user=`whoami`
#5 循环
for((host=103; host<105; host++)); do
echo ------------------- hadoop$host --------------
rsync -rvl $pdir/$fname $user@hadoop$host:$pdir
done
查看进程
#! /bin/bash
for i in hadoop102 hadoop103 hadoop104
do
echo --------- $i ----------
ssh $i "$*"
done
ps -ef | grep kafka-flume-hdfs | grep -v grep |awk '{print \$2}' | xargs kill
网友评论