#!/bin/sh
#将现有机器上的一些配置传送到新的机器上

#CDH
#mkdir -p /opt/cloudera/

host=bdcv191
oldhostname=`hostname`
sed -i 's/$oldhostname/$host/g' /etc/sysconfig/network

 

#ssh bdc245 scp -r /opt/cloudera/parcels/ root@$host:/opt/cloudera/
ssh -t -p 22 $host "
mkdir -p /usr/java/
mkdir -p /etc/hadoop/
mkdir -p /etc/hbase/
mkdir -p /etc/hive/


"
scp -r /usr/java/ root@$host:/usr/
scp -r /etc/hadoop/conf root@$host:/etc/hadoop/
scp -r /etc/hbase/conf root@$host:/etc/hbase/
scp -r /etc/hive/conf root@$host:/etc/hive/
#scp /opt/cloudera/parcels/CDH/lib/hive/lib/HiveAuthHook.jar root@bdc159:/opt/parcels/CDH/lib/hive/lib
scp /etc/profile root@$host:/etc/profile

ssh -t -p 22 $host"
source /etc/profile

service iptables stop
chkconfig iptables off

sed -i '7d' /etc/sysconfig/selinux
sed -i '6a SELINUX=disabled' /etc/sysconfig/selinux

yum groupinstall -y "Desktop"
yum groupinstall -y "X Window System"

sed -i '26d' /etc/inittab
sed -i '25a id:5:initdefault:' /etc/inittab
"

yum install ntp


sed -i '2d' /etc/sysconfig/network
echo 'HOSTNAME=$host' >> /etc/sysconfig/network

echo '10.130.2.190 bdcv190 '

#sed -i '2d' /etc/sysconfig/network
#sed -i '1a HOSTNAME=bdcvm101.hexun.com' /etc/sysconfig/network


/etc/yum/
/etc/yum.conf
/etc/yum.repos.d

echo "\# Generated by NetworkManager " >>/etc/resolv.conf
echo "search hexun.com " >>/etc/resolv.conf
echo "nameserver 8.8.8.8 " >>/etc/resolv.conf
echo "options single-request-reopen " >>/etc/resolv.conf

yum install openssh-clients -y

yum -y install lrzsz
yum -y install java-1.7.0-openjdk*
yum -y install oracle-j2sdk1.7.x86_64

posted on 2017-04-10 19:31  流浪在伯纳乌  阅读(229)  评论(0编辑  收藏  举报