您好,登錄后才能下訂單哦!
定制化大數據平臺一鍵安裝OS
大數據平臺一鍵安裝OS系列
大數據平臺一鍵安裝OS【定制化OS鏡像制作】
搭建腳本篇
腳本命名隨便,只要能看懂就行
鏡像包說明
os1.1.iso 用于安裝服務端和客戶端操作系統
hdp.iso 用于安裝hdp服務
1.架構圖:
服務端
客戶端
2.原理分析
安裝系統-安裝本地yum源-安裝http源-安裝并配置ntp服務-配置秘鑰-安裝jdk-安裝mysql-編譯安裝ambari平臺
3.服務端腳本分析
(1)create_local_yum.sh #安裝本地yum 源
#!/bin/bash iso_path=/dev/sr0 echo "Iso file path is :" /dev/sr0 yum_path=/mnt/vrv/ echo 'Creating mount directory :' /mnt/vrv/ mkdir -p /mnt/vrv/ mount /dev/sr0 /mnt/vrv echo 'Updating /etc/yum.repos.d/ files...' rm -rf /etc/yum.repos.d/* touch /etc/yum.repos.d/vrv.repo echo " [vrv-local] name=vrv-local baseurl=file:///mnt/vrv/ gpgcheck=0 enabled=1 " >> /etc/yum.repos.d/vrv.repo yum clean all && echo 'yum repository has been updated!' host_ip=`/sbin/ifconfig -a|grep inet|grep -v 127.0.0.1|grep -v inet6|awk '{print $2}'|tr -d "addr:"` echo "$host_ip os-manager" >>/usr/bin/os/hosts #echo "$host_ip os-manager" >>/etc/hosts
(2)update_master.sh #安裝http源,配置主節點,配置ntp
#!/bin/bash #往本機/etc/hosts添加hosts文件內容############# #cat hosts >> /etc/hosts; #echo "添加hosts到/etc/hosts文件完成"; host_ip=`/sbin/ifconfig -a|grep inet|grep -v 127.0.0.1|grep -v inet6|awk '{print $2}'|tr -d "addr:"` suffix_ip=${host_ip%.*} suffix_ip=${suffix_ip%.*} cd /mnt/vrv/Packages/ #rpm -ivh python-deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm yum -y install mkisofs vim httpd createrepo perl python bind-utils openssh-clients ntp vim wget unzip bind && chkconfig httpd on && mkdir -p /var/www/html/centos && mkdir -p /var/www/html/centos/Packages/Packages && mkdir -p /var/www/html/ambari/ && mkdir -p /var/www/html/vmp-extend/ && echo "拷貝文件中..." && cp -rf /mnt/vrv/Packages/* /var/www/html/centos/Packages/Packages/ && echo "拷貝文件完成,生成源中..." && createrepo /var/www/html/centos/Packages/Packages/ && rm -rf /etc/yum.repos.d/* && echo "http源拷貝完成,更新yum..." cp -rf /mnt/vrv/system/* /var/www/html/ touch /etc/yum.repos.d/vrv-http.repo echo " [vrv-http] name=vrv-http baseurl=http://$host_ip/centos/Packages/Packages gpgcheck=0 enabled=1 " >> /etc/yum.repos.d/vrv-http.repo service httpd restart && chkconfig httpd on && yum clean all echo "http 源已經配置完成" echo "開始配置dns..." echo "開始配置ntp..." chkconfig ntpd on #cp ntp.conf /etc/ntp.conf # 寫入ntp.conf文件 echo " driftfile /var/lib/ntp/drift restrict default kod nomodify notrap nopeer noquery restrict -6 default kod nomodify notrap nopeer noquery restrict 127.0.0.1 restrict -6 ::1 restrict $suffix_ip.0.0 mask 255.255.0.0 nomodify notrap restrict 0.vrv.pool.ntp.org mask 255.255.255.255 nomodify notrap noquery restrict 1.vrv.pool.ntp.org mask 255.255.255.255 nomodify notrap noquery restrict 2.vrv.pool.ntp.org mask 255.255.255.255 nomodify notrap noquery #server 210.72.145.44 server 127.127.1.0 # local clock fudge 127.127.1.0 stratum 10 includefile /etc/ntp/crypto/pw keys /etc/ntp/keys " > /etc/ntp.conf service ntpd restart && echo "ntp 配置完成!" ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime hwclock --systohc --localtime ## 配置 hdp yum#################### echo "開始配置ambari..." mkdir -p /var/www/html/ambari/ mkdir -p /var/www/html/vmp-extend/ cp -rf /mnt/vrv/vrv/AMBARI-2.2.1.0/centos6/2.2.1.0-161/* /var/www/html/ambari/ cp -rf /mnt/vrv/vrv/vmp-extend-1.0/* /var/www/html/vmp-extend/ createrepo /var/www/html/vmp-extend/ createrepo /var/www/html/ambari/ # 寫入文件 touch /etc/yum.repos.d/ambari.repo touch /etc/yum.repos.d/vmp-extend.repo echo " [ambari-2.x] name=Ambari 2.x baseurl=http://$host_ip/ambari/ gpgcheck=0 enabled=1 priority=1 " >> /etc/yum.repos.d/ambari.repo echo " #cd /mnt/vrv/vrv/vmp-extend-1.0 #chmod 777 vmp-extend-1.0.sh #sh vmp-extend-1.0.sh [vmp-extend-1.0] name=vmp-extend-1.0 baseurl=http://$host_ip/vmp-extend/ gpgcheck=0 enabled=1 priority=1 " >> /etc/yum.repos.d/vmp-extend.repo yum clean all && echo "ambari 配置完成" # 配置selinux############# echo "開始配置selinux..." sed -i 's/enforcing/disabled/' /etc/selinux/config && echo "selinux 配置完成" # 配置 iptalbes########### echo "開始配置iptables..." service iptables stop && chkconfig iptables off && service ip6tables stop && chkconfig ip6tables off && echo "iptables配置完成" # 關閉 THP################ echo "關閉THP..." echo "if test -f /sys/kernel/mm/redhat_transparent_hugepage/defrag;then echo never > /sys/kernel/mm/redhat_transparent_hugepage/defrag fi" >> /etc/rc.local && echo "閉THP完成" echo "更新主節點完成"
(3)generate_ssh.sh #配置ssh秘鑰,安裝jdk和mysql
#!/bin/bash if [ $# -lt 2 ]; then echo " HELP generate_ssh.sh --generate ssh key for login without typing password; this script should run on the namenode machine and user should edit the ip-list file USAGE: ./generate_ssh.sh user pasaword EXAMPLE: ./generate_ssh root admin HELP " exit 0 fi yum -y install expect && echo "expect 安裝完成" user=$1 ip=$HOSTNAME pass=$2 rm -rf /root/.ssh/* echo "##################################" echo " generate the rsa public key on $HOSTNAME ..." echo "##################################" expect -c " set timeout -1 spawn ssh-keygen -t rsa expect \"*id_rsa*\" send \"\r\" expect \"*passphrase*\" send \"\r\" expect \"*again*\" send \"\r\" expect eof " cat /usr/bin/os/hosts | while read line do #提取ip ip_i=${line% *} full_hostname_i=${ip_i##* } ip_i=${ip_i% *} hostname_i=${line##* } expect -c " set timeout -1 spawn ssh-copy-id -i /root/.ssh/id_rsa.pub $hostname_i expect \"yes/no\" send \"yes\r\" expect \"password:\" send \"$pass\r\" expect \"#\" expect eof " done echo "ssh配置完成" #安裝jdk echo " jdk 安裝中" rpm -e java-1.6.0-openjdk-1.6.0.38-1.13.10.4.el6.x86_64 rpm -e jdk-1.7.0_80-fcs.x86_64 rpm -e java-1.7.0-openjdk-1.7.0.99-2.6.5.1.el6.x86_64 cd /mnt/vrv/Packages/ rpm -ivh jdk-7u80-linux-x64.rpm echo " jdk 安裝完成" #安裝mysql echo "安裝mysql中" cd /mnt/vrv/Packages/ rpm -e mysql-5.1.73-7.el6.x86_64.rpm --nodeps rpm -e --nodeps mysql-libs-5.1.73-7.el6.x86_64.rpm yum remove -y mysql-libs rm -fr /usr/lib/mysql rm -fr /usr/include/mysql rm -f /etc/my.cnf rm -fr /var/lib/mysql rpm -ivh MySQL-server-5.5.50-1.linux2.6.x86_64.rpm rpm -ivh MySQL-client-5.5.50-1.linux2.6.x86_64.rpm echo never > /sys/kernel/mm/redhat_transparent_hugepage/enabled service mysql restart service httpd restart echo "安裝mysql完成" echo "初始化mysql" mysqladmin -uroot password 123456. echo "初始化mysql完成" touch /etc/my.cnf echo " [client] default-character-set=utf8 [mysqld] character_set_server=utf8 lower_case_table_names=1 " >> /etc/my.cnf service mysql restart
(4)mysql_start.sh #主要用來配置mysql配置
echo "安裝ambari中" rpm -e vmp-i18n-2.1.1.0 yum -y install ambari-server echo "安裝ambari完成" mysql -uroot -pvrv123456. -e " grant all on *.* to root@'%' identified by 'vrv123456.'; flush privileges; CREATE USER 'ambari'@'%' IDENTIFIED BY 'ambari'; grant all privileges on *.* to 'ambari'@'%' identified by 'ambari' with grant option; CREATE USER 'ambari'@'localhost' IDENTIFIED BY 'ambari'; grant all privileges on *.* to 'ambari'@'localhost' identified by 'ambari' with grant option; CREATE USER 'ambari'@'os-manager' IDENTIFIED BY 'ambari'; grant all privileges on *.* to 'ambari'@'os-manager' identified by 'ambari' with grant option; flush privileges; CREATE USER 'hive'@'%' IDENTIFIED BY 'hive'; grant all privileges on *.* to 'hive'@'%' identified by 'hive' with grant option; CREATE USER 'hive'@'localhost' IDENTIFIED BY 'hive'; grant all privileges on *.* to 'hive'@'localhost' identified by 'hive' with grant option; CREATE USER 'hive'@'os-manager' IDENTIFIED BY 'hive'; grant all privileges on *.* to 'hive'@'os-manager' identified by 'hive' with grant option; flush privileges; CREATE USER 'oozie'@'%' IDENTIFIED BY 'oozie'; GRANT ALL PRIVILEGES ON *.* TO 'oozie'@'%'; FLUSH PRIVILEGES; create database ambari default charset='UTF8'; create database hive default charset='UTF8'; create database oozie default charset='UTF8'; quit" mysql -uroot -p123456. -e " use ambari; SOURCE /var/lib/ambari-server/resources/Ambari-DDL-MySQL-CREATE.sql; quit"
(5)jiaohu.sh #自動配置ambari(需要提前設置好)
#!/bin/bash #修改參數 echo never > /sys/kernel/mm/redhat_transparent_hugepage/enabled sysctl vm.swappiness=10 #安裝mysql驅動 echo "安裝mysql驅動中" #yum install mysql-connector-java -y mkdir -p /usr/share/java/ cp -rf /mnt/vrv/vrv/vmp-extend-1.0/misc/mysql-connector-java-5.1.36.jar /usr/share/java/ mv /usr/share/java/mysql-connector-java-5.1.36.jar /usr/share/java/mysql-connector-java.jar #cp -rf /mnt/vrv/vmp-extend-1.0/misc/mysql-connector-java-5.1.36.jar /usr/share/java/ cp -rf /usr/share/java/mysql-connector-java.jar /usr/lib/ambari-server/ echo "安裝mysql驅動完成" ambari-server setup --jdbc-db=mysql --jdbc-driver=/usr/share/java/mysql-connector-java.jar expect -c " spawn ambari-server setup expect \"*continue*\" send \"y\r\" expect \"*Customize*\" send \"y\r\" expect \"*Enter*\" send \"root\r\" expect \"*JDK*\" send \"y\r\" expect \"*choice*\" send \"3\r\" expect \"*JAVA*\" send \"\/usr\/java\/default\r\" expect \"*configuration*\" send \"y\r\" expect \"*choice*\" send \"3\r\" expect \"*Hostname*\" send \"os-manager\r\" expect \"*Port*\" send \"3306\r\" expect \"*Database*\" send \"ambari\r\" expect \"*Username*\" send \"ambari\r\" expect \"*Database*\" send \"ambari\r\" expect \"*Re-enter*\" send \"ambari\r\" expect \"*properties*\" send \"y\r\" expect eof " cd /mnt/vrv/vrv/vmp-extend-1.0/ sh vmp-extend-1.0.sh echo "api.csrfPrevention.enabled=false" >>/etc/ambari-server/conf/ambari.properties ambari-server start yum install dos2* -y dos2unix /usr/bin/os/*.sh echo "安裝server端完成"
到這一步服務端已經安裝完成。
4.客戶端腳本分析
(1)create_local_yum.sh #安裝本地yum 源
#!/bin/bash iso_path=/dev/sr0 echo "Iso file path is :" /dev/sr0 yum_path=/mnt/vrv/ echo 'Creating mount directory :' /mnt/vrv/ mkdir -p /mnt/vrv/ mount /dev/sr0 /mnt/vrv echo 'Updating /etc/yum.repos.d/ files...' rm -rf /etc/yum.repos.d/* touch /etc/yum.repos.d/vrv.repo echo " [vrv-local] name=vrv-local baseurl=file:///mnt/vrv/ gpgcheck=0 enabled=1 " >> /etc/yum.repos.d/vrv.repo yum clean all && echo 'yum repository has been updated!' host_ip=`/sbin/ifconfig -a|grep inet|grep -v 127.0.0.1|grep -v inet6|awk '{print $2}'|tr -d "addr:"` echo "$host_ip os-manager" >>/usr/bin/os/hosts #echo "$host_ip os-manager" >>/etc/hosts
(2)ntp.sh #安裝ntp服務,選擇安裝mysql
#!/bin/bash #往本機/etc/hosts添加hosts文件內容############# echo "添加hosts到/etc/hosts文件完成"; host_ip=`/sbin/ifconfig -a|grep inet|grep -v 127.0.0.1|grep -v inet6|awk '{print $2}'|tr -d "addr:"` suffix_ip=${host_ip%.*} suffix_ip=${suffix_ip%.*} yum -y install mkisofs vim httpd python createrepo perl bind-utils openssh-clients ntp vim wget unzip bind yum clean all echo "開始配置ntp..." chkconfig ntpd on echo " driftfile /var/lib/ntp/drift restrict default kod nomodify notrap nopeer noquery restrict -6 default kod nomodify notrap nopeer noquery restrict 127.0.0.1 restrict -6 ::1 restrict $suffix_ip.0.0 mask 255.255.0.0 nomodify notrap restrict 0.vrv.pool.ntp.org mask 255.255.255.255 nomodify notrap noquery restrict 1.vrv.pool.ntp.org mask 255.255.255.255 nomodify notrap noquery restrict 2.vrv.pool.ntp.org mask 255.255.255.255 nomodify notrap noquery #server 210.72.145.44 #server 192.168.2.11 # local clock fudge 127.127.1.0 stratum 10 includefile /etc/ntp/crypto/pw keys /etc/ntp/keys " > /etc/ntp.conf service ntpd restart && echo "ntp 配置完成!" ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime hwclock --systohc --localtime # 配置selinux############# echo "開始配置selinux..." sed -i 's/enforcing/disabled/' /etc/selinux/config && echo "selinux 配置完成" # 配置 iptalbes########### echo "開始配置iptables..." service iptables stop && chkconfig iptables off && service ip6tables stop && chkconfig ip6tables off && echo "iptables配置完成" # 關閉 THP################ echo "關閉THP..." echo "if test -f /sys/kernel/mm/redhat_transparent_hugepage/defrag;then echo never > /sys/kernel/mm/redhat_transparent_hugepage/defrag fi" >> /etc/rc.local && echo "閉THP完成" echo "更新節點完成" #安裝jdk echo " jdk 安裝中" rpm -e java-1.6.0-openjdk-1.6.0.38-1.13.10.4.el6.x86_64 rpm -e jdk-1.7.0_80-fcs.x86_64 rpm -e java-1.7.0-openjdk-1.7.0.99-2.6.5.1.el6.x86_64 cd /mnt/vrv/Packages/ rpm -ivh jdk-7u80-linux-x64.rpm echo " jdk 安裝完成" read -p "install mysql,Please insert y or n ": name if [ $name = "n" ] then echo "不需要安裝mysql" elif [ $name = "y" ] then #安裝mysql echo "安裝mysql中" cd /mnt/vrv/Packages/ rpm -e mysql-5.1.73-7.el6.x86_64.rpm --nodeps rpm -e --nodeps mysql-libs-5.1.73-7.el6.x86_64.rpm yum remove -y mysql-libs rm -fr /usr/lib/mysql rm -fr /usr/include/mysql rm -f /etc/my.cnf rm -fr /var/lib/mysql rpm -ivh MySQL-server-5.5.50-1.linux2.6.x86_64.rpm rpm -ivh MySQL-client-5.5.50-1.linux2.6.x86_64.rpm echo never > /sys/kernel/mm/redhat_transparent_hugepage/enabled service mysql start echo "安裝mysql完成" echo "初始化mysql" mysqladmin -uroot password vrv123456. echo "初始化mysql完成" echo "增加客戶端完成" touch /etc/my.cnf echo " [client] default-character-set=utf8 [mysqld] character_set_server=utf8 lower_case_table_names=1 " >> /etc/my.cnf service mysql restart fi
5.一鍵命令腳本分析:
#!/bin/sh echo "os 1.1 install script" echo "1.安裝os server 2.加固系統 3.修改主機ip地址 4.修改主機名 5.修改網絡 6.修改ambari主機地址 7.修改root密碼 8.重啟網絡服務 9.退出" echo "++++++++自動修改ip和主機名等相關信息+++++++++" echo "ETHCONF=/etc/sysconfig/network-scripts/ifcfg-eth0" echo "HOSTS=/etc/hosts" echo "NETWORK=/etc/sysconfig/network" echo "DIR=/data/backup/`date +%Y%m%d`" echo "NETMASK=255.255.255.0" echo "安裝好mysql默認密碼為vrv123456." echo "+++++++++-------------------------+++++++++++" #Define Path 定義變量,可以根據實際情況修改 ETHCONF=/etc/sysconfig/network-scripts/ifcfg-eth0 HOSTS=/etc/hosts NETWORK=/etc/sysconfig/network DIR=/data/backup/`date +%Y%m%d` NETMASK=255.255.255.0 echo "================================================" echo #定義change_ip函數 function Change_ip () { #判斷備份目錄是否存在,中括號前后都有空格,!嘆號在shell表示相反的意思# if [ ! -d $DIR ];then mkdir -p $DIR fi echo "Now Change ip address ,Doing Backup Interface eth0" cp $ETHCONF $DIR grep "dhcp" $ETHCONF #如下0用來判斷上一次操作的狀態,為0,表示上一次操作狀態正確或者成功# if [ $? -eq 0 ];then #read -p 交互輸入變量IPADDR,注冒號后有空格,sed -i 修改配置文件# read -p "Please insert ip Address:" IPADDR read -p "Please insert gatway Address:" gateway sed -i 's/dhcp/static/g' $ETHCONF #awk -F. 意思是以.號為分隔域,打印前三列# echo -e "IPADDR=$IPADDR\nNETMASK=$NETMASK\nGATEWAY=`echo $gateway|awk -F. '{print $1"."$2"."$3"."$4}'`" >>$ETHCONF echo "This IP address Change success !" else echo -n "This $ETHCONF is static exist ,please ensure Change Yes or NO": read i fi if [ "$i" == "y" -o "$i" == "yes" ];then read -p "Please insert ip Address:" IPADDR read -p "Please insert gateway Address:" gateway count=(`echo |awk -F. '{print $1,$2,$3,$4}'`) #定義數組, 0代表獲取變量值總個數# A=${#count[@]} #while條件語句判斷,個數是否正確,不正確循環提示輸入,也可以用[0-9]來判斷ip# while [ "$A" -ne "4" ] do read -p "Please re Inster ip Address,example 192.168.0.11 ip": IPADDR count=(`echo $IPADDR|awk -F. '{print $1,$2,$3,$4}'`) A=${#count[@]} done #sed -e 可以連續修改多個參數# sed -i -e 's/^IPADDR/#IPADDR/g' -e 's/^NETMASK/#NETMASK/g' -e 's/^GATEWAY/#GATEWAY/g' $ETHCONF #echo -e \n為連續追加內容,并自動換行# echo -e "IPADDR=$IPADDR\nNETMASK=$NETMASK\nGATEWAY=`echo $gateway|awk -F. '{print $1"."$2"."$3"."$4}'`" >>$ETHCONF echo "This IP address Change success !" else echo "This $ETHCONF static exist,please exit" exit $? fi } #定義hosts函數 ############function hosts############## function Change_hosts () { if [ ! -d $DIR ];then mkdir -p $DIR fi cp $HOSTS $DIR read -p "Please insert ip address": IPADDR read -p "Please insert ip hostname": hostname host=`echo $IPADDR|sed 's/\././g'` cat $HOSTS |grep 127.0.0.1 |grep "$host" if [ $? -ne 0 ];then # sed -i "s/127.0.0.1/127.0.0.1 $host/g" $HOSTS echo "$host $hostname" >> /etc/hosts echo "This hosts change success " else echo "This $host IS Exist .........." fi } ###########fuction network############### #定義network函數 function Change_network () { if [ ! -d $DIR ];then mkdir -p $DIR fi cp $NETWORK $DIR read -p "Please insert host name": IPADDR host=`echo $IPADDR|sed 's/\././g'` grep "$host" $NETWORK if [ $? -ne 0 ];then sed -i "s/^HOSTNAME/#HOSTNAME/g" $NETWORK echo "HOSTNAME=$IPADDR" >>$NETWORK else echo "This $host IS Exist .........." fi } function Change_rootpassword () { read -p "Please insert you root password": password echo $password | passwd --stdin root } function restart_server () { echo "restart network server ...." service network restart ifup eth0 } function exit_quit () { echo "quit......" break } function install_os_server () { cd /usr/bin/os/ sh create_local_yum.sh && sh update_master.sh && ./generate_ssh.sh root root && sh mysql_start.sh && sh jiaohu.sh >> /usr/bin/os/install.os_server.log } function jiagu () { cd /usr/bin/os/ sh jiagu.sh >>/usr/bin/os/install.jiagu.log } function Change_ambari_host () { echo "正在備份ambari.properties" cp -rf /etc/ambari-server/conf/ambari.properties /etc/ambari-server/conf/ambari.properties.bak read -p "Please insert ip oldhostname(默認為os-manager)": oldhostname read -p "Please insert ip newhostname": newhostname sed -i 's/'$oldhostname'/'$newhostname'/' /etc/ambari-server/conf/ambari.properties echo "已修改主機名,正在重啟服務" service ambari-server restart echo "重啟ambari完成,訪問:http://$newhostname:8080" } function add_key () { cd /usr/bin/os/ sh miyao.sh } #PS3一般為菜單提示信息# PS3="Please Select Menu": #select為菜單選擇命令,格式為select $var in ..command.. do .... done select i in "install_os_server" "jiagu" "Change_ip" "Change_hosts" "Change_network" "Change_ambari_host" "Change_rootpassword" "restart_server" "add_key" "exit_quit" do #case 方式,一般用于多種條件下的判斷 case $i in install_os_server ) install_os_server ;; jiagu ) jiagu ;; Change_ip ) Change_ip ;; Change_hosts ) Change_hosts ;; Change_network ) Change_network ;; Change_ambari_host ) Change_ambari_host ;; Change_rootpassword ) Change_rootpassword ;; restart_server ) restart_server ;; add_key ) add_key ;; exit_quit ) exit_quit ;; *) echo echo "Please Insert $0: install_os_server(1)|jiagu(2)|Change_ip(3)|Change_hosts(4)|Change_network(5)|Change_ambari_host(6)|Change_rootpassword(7)|restart_network_server(8)|add_key(9)|quit(10)|" echo "溫馨提示:請按8重啟網絡服務" break ;; esac done
6.安裝操作系統:
首先在服務器啟動時,按DEL進入boot選項選光驅啟動。
掛載鏡像os1.1.iso開始進行安裝
選擇menu vasp server install new system,進行服務端安裝。
7.操作系統硬盤選擇
選擇一塊硬盤進行系統安裝
安裝完成
默認用戶:root 密碼:root
8.服務端設置
進入/usr/bin/os/目錄
cd /usr/bin/os/
腳本說明:
1.create_local_yum.sh #作用用來更新本地yum源裝一些系統工具
2.update_master.sh #更新ambari要用的yum源并且安裝http服務和主服務節點
3.generate_ssh.sh #個性化安裝ssh服務 示例:./generate_ssh.sh root root 第一個root是賬號,第二個root是密碼。
4.mysql_start.sh #mysql服務安裝和非交互式安裝數據庫,用戶名和密碼
默認密碼為123456.
5.jiaohu.sh #運行此腳本可以實現非交互式安裝ambari
6.change.sh #運行此腳本出9個選項可以一鍵安裝ambari服務端和客戶端手動設定ip地址,主機名和root密碼,修改ambari主機名。
7.yum-hdp.sh #運行此腳本執行hdp源操作。
8.jiagu.sh #運行此腳本進行安全加固。
9.miyao.sh #添加服務端公鑰到客戶
執行sh change.sh
進入菜單選項
8.1 修改ip地址
運行change.sh 執行3進行ip地址修改
(需要重啟網卡服務)
輸入yes,然后輸入ip地址和網關地址,最后再確認一遍ip地址。
運行8重啟服務
8.2 安裝vasp server
運行change.sh 執行1進行server安裝
安裝完成如圖:
8.3 修改hosts
運行change.sh 執行4進行hosts修改
8.4 修改hostnames
運行change.sh 執行5進行hostname修改
(需要重啟服務器)
#reboot
8.5 修改ambari hostname
運行change.sh 執行6進行ambari hostname修改
首先要輸入默認的vasp-manager然后再輸入hostname
(需要跟hostname名字一致)
8.6 修改root密碼
運行change.sh 執行7進行root密碼修改
8.7 服務端更新時間
9.配置平臺yum源
掛載hdp.iso
cd /usr/bin/vasp/
執行sh yum-hdp.sh
# sh yum-hdp.sh
Please insert source path:/dev/sr0
Please insert target path:/mnt
輸入源路徑,目標路徑
輸入本機ip地址:192.168.2.11
自動執行#yum clean all && yum list
訪問http:192.168.2.11/centos 獲取centos的yum源地址
訪問http:192.168.2.11/ambari 獲取ambari的yum源地址
訪問http:192.168.2.11/HDP 獲取HDP的yum源地址
訪問http:192.168.2.11/HDP-UTILS 獲取HDP-UTILS的yum源地址
訪問http:192.168.2.11/vmp-extend 獲取vmp-extend的yum源地址
10.vmp管理平臺
在網頁輸入:http://192.168.2.11:8080/
//mysql初始庫密碼 用戶:root 密碼:123456.
//vmp管理平臺密碼 用戶:admin 密碼:admin
后續更新。。。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。