您好,欢迎访问三七文档
当前位置:首页 > 行业资料 > 其它行业文档 > centos7通过ambari布署hadoopHA集群
centos7通过ambari布署hadoopHA集群1.软硬件环境测试环境Virtualbox虚拟4台centos7主机:192.168.11.221centos7a.hdcentos7a#ambariserver192.168.11.222centos7b.hdcentos7b#namenodemaster192.168.11.223centos7c.hdcentos7c#namenodestandby,datanode192.168.11.224centos7d.hdcentos7d#datanode预备软件:CentOS-7-x86_64-Minimal-1503-01.isojdk-7u80-linux-x64.rpm#确认可以支持,jdk8是否支持未找到明确说明ambari-2.1.0repo源文件=2.1.0-1470[Updates-ambari-2.1.0]name=ambari-2.1.0-Updatesbaseurl==0gpgkey==1priority=12.建立virtualbox虚拟机建立centos7,虚拟机内存512,硬盘8G,有条件的提高配置。安装centos7mini版。关闭selinux修改/etc/selinuxSELINUX=disabled关闭centos7防火墙,centos7缺省使用firewalld不是iptables#systemctlstopfirewalld.service#systemctldisablefirewalld.service#firewall-cmd--state安装网络工具包#yuminstallnet-tools.x86_64配置网络,使主机可以直接访问网络#cd/etc/sysconfig/network-scripts/#viifcfg-enp0s3TYPE=EthernetBOOTPROTO=noneDEFROUTE=yesIPV4_FAILURE_FATAL=noIPV6INIT=yesIPV6_AUTOCONF=yesIPV6_DEFROUTE=yesIPV6_FAILURE_FATAL=noNAME=enp0s3DEVICE=enp0s3ONBOOT=yesIPADDR=192.168.11.221PREFIX=24GATEWAY=192.168.11.1DNS1=114.114.114.114修改/etc/hosts文件,添加所有主机解析192.168.11.221centos7a.hdcentos7a192.168.11.222centos7b.hdcentos7b192.168.11.223centos7c.hdcentos7c192.168.11.224centos7d.hdcentos7d修改/etc/hostname,添加本机名:centos7a.hd修改/etc/resolv.conf,添加dns:nameserver114.114.114.114重新启动虚拟机,确认所有修改生效----------------------------------------------------------------------------------------------------------------建立ssh免登录文件#ssh-keygen-tdsa-P''-f~/.ssh/id_dsa#cat~/.ssh/id_dsa.pub~/.ssh/authorized_keys在/etc/yum.repos.d/下建立ambari源文件ambari2.11.repo,内容:#VERSION_NUMBER=2.1.0-1470[Updates-ambari-2.1.0]name=ambari-2.1.0-Updatesbaseurl==0gpgkey==1priority=1使用sftp工具上传jdk-7u80-linux-x64.rpm到centos7a.hd,并安装配置java环境。#rpm–ivhjdk-7u80-linux-x64.rpm#vi.bashrc,添加内容exportJAVA_HOME=/usr/java/latestexportPATH=$PATH:$JAVA_HOME/bin#source.bashrc关闭虚拟机Virtualbox将centos7a.hd复制为三台新的虚拟机,对应centos7b.hd、centos7c.hd、centos7d.hd。注意生成新的mac地址。启动新的三台主机,修改/etc/hostname、/etc/sysconfig/network-scripts/ifcfg-enp0s3,为对应的主机名与IP地址,重启生效。由于测试中四台主机为虚拟机复制,ssh免密登录关系一直存在,在实际环境中要根据需求设置ambariserver、namenode的免密登录。(namenode免密登录ambari是否会自动设置未知)。-------------------------------------基础环境搭建完毕----------------------------------------------3.安装ambariserver登录centos7a.hd,安装ambariserver.#yuminstallambari-server==========================================================================================================================================PackageArchVersionRepositorySize==========================================================================================================================================Installing:ambari-serverx86_642.1.0-1470Updates-ambari-2.1.0326MInstallingfordependencies:postgresqlx86_649.2.13-1.el7_1updates3.0Mpostgresql-libsx86_649.2.13-1.el7_1updates230kpostgresql-serverx86_649.2.13-1.el7_1updates3.8MTransactionSummary==========================================================================================================================================Install1Package(+3Dependentpackages)Installing:postgresql-libs-9.2.13-1.el7_1.x86_64Installing:postgresql-9.2.13-1.el7_1.x86_64Installing:postgresql-server-9.2.13-1.el7_1.x86_64Installing:ambari-server-2.1.0-1470.x86_64Verifying:postgresql-9.2.13-1.el7_1.x86_64Verifying:ambari-server-2.1.0-1470.x86_64Verifying:postgresql-libs-9.2.13-1.el7_1.x86_64Verifying:postgresql-server-9.2.13-1.el7_1.x86_64Installed:ambari-server.x86_640:2.1.0-1470DependencyInstalled:postgresql.x86_640:9.2.13-1.el7_1postgresql-libs.x86_640:9.2.13-1.el7_1postgresql-server.x86_640:9.2.13-1.el7_1Complete!配置ambariserver#ambari-serversetupUsingpython/usr/bin/python2.7Setupambari-serverCheckingSELinux...SELinuxstatusis'disabled'Customizeuseraccountforambari-serverdaemon[y/n](n)?yCheckingJDK...[1]OracleJDK1.8+JavaCryptographyExtension(JCE)PolicyFiles8[2]OracleJDK1.7+JavaCryptographyExtension(JCE)PolicyFiles7[3]CustomJDK====================================================================Enterchoice(1):3WARNING:JDKmustbeinstalledonallhostsandJAVA_HOMEmustbevalidonallhosts.WARNING:JCEPolicyfilesarerequiredforconfiguringKerberossecurity.IfyouplantouseKerberos,pleasemakesureJCEUnlimitedStrengthJurisdictionPolicyFilesarevalidonallhosts.PathtoJAVA_HOME:/usr/java/latestValidatingJDKonAmbariServer...done.Completingsetup...Configuringdatabase...Enteradvanceddatabaseconfiguration[y/n](n)?yConfiguringdatabase...==============================================================================Chooseoneofthefollowingoptions:[1]-PostgreSQL(Embedded)[2]-Oracle[3]-MySQL[4]-PostgreSQL[5]-MicrosoftSQLServer(TechPreview)==========================================================
本文标题:centos7通过ambari布署hadoopHA集群
链接地址:https://www.777doc.com/doc-2904125 .html