前言
安裝部署分為以下五個大步驟
1.資源準(zhǔn)備
2.操作系統(tǒng)配置
3.數(shù)據(jù)庫配置
4.ambari配置
5.bigtop組件安裝
必要說明
all?表示全部主機(jī)都要執(zhí)行
server表示ambari-server安裝的主機(jī)執(zhí)行
${key}表示需要根據(jù)實(shí)際情況修改的變量,例如${server.ip}應(yīng)替換成server所在主機(jī)的ip,所有變量均會標(biāo)紅
資源準(zhǔn)備
需要準(zhǔn)備3臺centos7虛擬機(jī),建議規(guī)格4C*16G*60G;ambari2.8.0、ambari-metrics3.0.0、bigtop3.2.0三類組件
方式一:
按上篇文章的方式自己編譯組件
方式二:
echo "編-譯-好-的-包-放-在-群-文-件-里-了"
echo "歡-迎-加-Q-Q-群-進(jìn)-行-交-流"
echo "7-2-2-0-1-4-9-1-2"
操作系統(tǒng)配置
基礎(chǔ)配置
檢查操作系統(tǒng)版本一致性(all)
cat /etc/redhat-release
設(shè)置操作系統(tǒng)默認(rèn)語言(all)
localectl set-locale LANG=en_US.UTF-8
要求:en_US.UTF-8
設(shè)置操作系統(tǒng)時區(qū)(all)
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
要求CST +0800
設(shè)置機(jī)器名(all)
echo "${hostname}" > /etc/hostname
設(shè)置域名解析(all)
echo "${ip1} ${hostname1}" >> /etc/hosts
echo "${ip2} ${hostname2}" >> /etc/hosts
echo "${ip3} ${hostname3}" >> /etc/hosts
注意:要將集群每臺機(jī)器的ip hostname都添加到hosts中
設(shè)置網(wǎng)絡(luò)(all)
echo "NETWORKING=yes" > /etc/sysconfig/network
關(guān)閉防火墻(all)
#停止防火墻
systemctl stop firewalld
#關(guān)閉防火墻
systemctl disable firewalld
關(guān)閉selinux(all)
setenforce 0
echo "SELINUX=disabled" > /etc/selinux/config
echo "SELINUXTYPE=targeted" >> /etc/selinux/config
配置limits參數(shù)(all)
echo "* ?hard ? nproc ? 65535" > /etc/security/limits.conf
echo "* ?soft ? nproc ? 65535" >> /etc/security/limits.conf
echo "* ?hard ? nofile ?65535" >> /etc/security/limits.conf
echo "* ?soft ? nofile ?65535" >> /etc/security/limits.conf
禁用交換分區(qū)(all)
sysctl vm.swappiness=0
echo "vm.swappiness=0" >> /etc/sysctl.conf
設(shè)置umask(all)
echo umask 0022 >> /etc/profile
source /etc/profile
磁盤掛載(all)
#1.用lsblk命令查看磁盤掛載情況(以sdb為例)
#2.創(chuàng)建掛載的文件夾(有多少塊待掛載的磁盤就在/下建多少個data{i}文件夾,i從1開始)
mkdir ${/data1}
#3.修改磁盤分區(qū)模式
parted -s ${/dev/sdb} mklabel gpt ?
#4.分區(qū)
parted -s ${/dev/sdb} mkpart primary 0% 100%?
#5.格式化
mkfs.ext4 ${/dev/sdb1}?
#6.掛載
mount ${/dev/sdb1} ${/data1}?
#7.開機(jī)自動掛載
echo '${/dev/sdb1} ${/data1} ext4 defaults 0 0' >> /etc/fstab?
重啟(all)
?`reboot`命令重啟以確?;A(chǔ)配置生效
免密(server)
生成密鑰
ssh-keygen -f ~/.ssh/id_rsa -t rsa -N ''
發(fā)送公鑰到全部機(jī)器 包括自己
ssh-copy-id -i ~/.ssh/id_rsa.pub root@${hostname1}
ssh-copy-id -i ~/.ssh/id_rsa.pub root@${hostname2}
ssh-copy-id -i ~/.ssh/id_rsa.pub root@${hostname3}
基礎(chǔ)軟件安裝(all)
yum -y groupinstall "Infrastructure Server" --setopt=group_package_types=mandatory,default,optional
yum -y groupinstall "Development Tools" --setopt=group_package_types=mandatory,default,optional
配置ntp服務(wù)
服務(wù)端(server)
echo "server 127.0.0.1" >> /etc/ntp.conf
echo "fudge 127.0.0.1 stratum 10" >> /etc/ntp.conf
systemctl restart ntpd.service
客戶端(all)
echo "server ${server.ip}" >> /etc/ntp.conf
systemctl restart ntpd.service
systemctl enable ntpd
關(guān)閉chrony自啟動,否則ntp服務(wù)不會自啟動
systemctl disable chronyd
安裝離線鏡像源(server)
上傳軟件
將bigdatarepo上傳到~目錄
復(fù)制軟件
cp -r ~/bigdatarepo /var/www/html/
啟動httpd服務(wù)
#啟動
systemctl?start ?httpd
#開機(jī)自啟
systemctl ?status httpd.service
配置離線鏡像源(all)
創(chuàng)建配置文件
cat > /etc/yum.repos.d/ambari.repo <<EOF
[ambari]
name=ambari
baseurl=http://${server.ip}/bigdatarepo
failovermethod=priority
enabled=1
gpgcheck=0EOF
生效
yum clean all
yum makecache
數(shù)據(jù)庫設(shè)置(server)
#安裝
yum –y install mariadb-server mysql-connector-java
#啟動
systemctl start mariadb
#開機(jī)自啟
systemctl enable mariadb
#設(shè)置密碼
mysql -uroot ?-e "set password = password('abcd1234');flush privileges;"
#刪除空賬戶
mysql -uroot -pabcd1234 -e "use mysql;delete from user where User='';flush privileges;"
ambari配置(server)
創(chuàng)建數(shù)據(jù)庫
#創(chuàng)建數(shù)據(jù)庫
mysql -uroot ?-pabcd1234 -e "create database ambari;create database hive;"
#創(chuàng)建用戶并授權(quán)
mysql -uroot ?-pabcd1234 -e "use ambari; create user 'ambari'@'%' identified by 'ambari123' ;GRANT ALL PRIVILEGES on *.* To 'ambari'@'%' IDENTIFIED BY 'ambari123'; FLUSH PRIVILEGES;"
mysql -uroot ?-pabcd1234 -e "use hive; create user 'hive'@'%' identified by 'ambari123' ;GRANT ALL PRIVILEGES on *.* To 'hive'@'%' IDENTIFIED BY 'ambari123'; FLUSH PRIVILEGES;"
安裝啟動ambari(server)
安裝
yum –y install ambari-server
設(shè)置
ambari-server setup
?
初始化ambari-server數(shù)據(jù)
mysql -uroot ?-pabcd1234 -e "use ambari;source /var/lib/ambari-server/resources/Ambari-DDL-MySQL-CREATE.sql;show tables;"
啟動ambari-server
ambari-server start文章來源:http://www.zghlxwxcb.cn/news/detail-465316.html
至此,ambari已經(jīng)安裝完成
下一篇介紹bigtop大數(shù)據(jù)組件安裝文章來源地址http://www.zghlxwxcb.cn/news/detail-465316.html
到了這里,關(guān)于Ambari+Bigtop大數(shù)據(jù)平臺安裝部署指南(Centos7)一的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!