1. 程式人生 > >Centos7.5下HDP叢集搭建(一)

Centos7.5下HDP叢集搭建(一)

硬體環境:6臺伺服器,IP為172.16.172.17/18/19/20/21/22

軟體環境:作業系統為Centos7.5

                 Ambari版本為2.5.0.3

                 HDP版本為2.6.0.3

一、安裝前準備工作:

1.安裝以下軟體:

            yum,rpm,scp,curl,unzip,tar,wget,OpenSSL(v1.01,build 16以上版本),Python(2.7.x以上版本);

            JDK版本1.8以上;

2.資料庫:可自行安裝資料庫,也可使用Ambari安裝的PostgreSQL資料庫。

                本叢集搭建,使用HDP-Utils下的mysql資料庫,不單獨安裝資料庫。

3.配置叢集FQDN:

                (1). 修改各個伺服器的hostname,172.16.172.17-22分別修改/etc/hostname為dsj1.zkhy.com-dsj6.zkhy.com。

                     以172.16.172.17為例,hostname修改為:dsj1.zkhy.com。

                (2).修改各個伺服器的/etc/hosts。

                     新增如下內容,原來hosts檔案已有的內容繼續保留:

                                       172.16.172.17 dsj1.zkhy.com

                                       172.16.172.18 dsj2.zkhy.com

                                       172.16.172.19 dsj3.zkhy.com

                                       172.16.172.20 dsj4.zkhy.com

                                       172.16.172.21 dsj5.zkhy.com

                                       172.16.172.22 dsj6.zkhy.com

                      可在編輯完172.16.172.17的hosts檔案後,使用命令xsync hosts傳送給其他叢集中的伺服器。

4.配置ssh信任:

          (1).安裝:

               yum install openssh-server -y

           (2).配置:

                 使用SSH的重要前提是虛擬機器上都是同一使用者

          ssh–keygen –t rsa –P ‘’ –f ~/.ssh/id_rsa //生成金鑰對

          cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys    //將公鑰匯入金鑰庫(授權KEY集)

            (3).舉例:

比如把dsj1的公鑰傳給dsj2(用NC)

     a.nc -l 8888 >id_rsa.pub.dsj1 //dsj2準備接收公鑰,並重命名為dsj1的公鑰id_rsa.pub.dsj1。

     b.nc dsj2.zkhy.com 8888 < id_rsa.pub   //dsj1端,傳送公鑰給dsj2。

     c.cat ~/.ssh/id_rsa.pub.dsj1 >> ~/.ssh/authorized_keys      //在dsj2上新增dsj1的公鑰檔案。

(4).使用:

登陸到dsj2(已傳入dsj1公鑰)

          ssh dsj2.zkhy.com

          ....yes

          exit

          ssh dsj2.zkhy.com //再次登陸就不需要yes了

(5)注意:

      Centos7版本除了做以上四步外,還需要

a.關閉SElinux才能實現免密登入。

                  vi /etc/selinux/config

                        修改內容如下:

                     把SELINUX=enforcing修改為SELINUX=disabled

b.修改資料夾許可權

chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys 

c.修改sshd_config和ssh_config檔案:vi /etc/ssh/sshd_config

將下面的內容放開,也就是去掉註釋。

RSAAuthentication yes

PubkeyAuthentication yes

AuthorizedKeysFile      .ssh/authorized_keys

若仍然無法ssh免密登入,則用root使用者登陸檢視系統的日誌檔案:$tail /var/log/secure -n 20,再進一步定位。

5.更改系統環境配置:

      echo umask 0022 >> /etc/profile

6.ntp時鐘同步配置:

6臺裝置:

IP

用途

172.16.172.17

ntpd伺服器,用於與外部公共ntpd同步標準時間

172.16.172.18

ntpd客戶端,用於與ntpd同步時間

172.16.172.19

ntpd客戶端,用於與ntpd同步時間

172.16.172.20

ntpd客戶端,用於與ntpd同步時間

172.16.172.21

ntpd客戶端,用於與ntpd同步時間

172.16.172.22

ntpd客戶端,用於與ntpd同步時間

  • 使用rpm檢查ntp包是否安裝

[[email protected] kevin]# rpm -q ntp

  • 如果已經安裝則略過此步,否則使用yum進行安裝,並設定系統開機自動啟動並啟動服務

[[email protected] kevin]# yum -y install ntp

[[email protected] kevin]# systemctl enable ntpd

[[email protected] kevin]# systemctl start ntpd

 設定ntp伺服器: 172.16.172.17

  • 修改/etc/ntp.conf檔案,加粗字型是修改的內容

# For more information about this file, see the man pages

# ntp.conf(5), ntp_acc(5), ntp_auth(5), ntp_clock(5), ntp_misc(5), ntp_mon(5).

driftfile /var/lib/ntp/drift

# Permit time synchronization with our time source, but do not

# permit the source to query or modify the service on this system.

restrict default nomodify notrap nopeer noquery

# Permit all access over the loopback interface.  This could

# be tightened as well, but to do so would effect some of

# the administrative functions.

restrict 127.0.0.1

restrict ::1

# Hosts on local network are less restricted.

#restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap

restrict 172.16.248.0 mask 255.255.255.0 nomodify notrap

# Use public servers from the pool.ntp.org project.

# Please consider joining the pool (http://www.pool.ntp.org/join.html).

#server 0.centos.pool.ntp.org iburst

server 2.cn.pool.ntp.org

server 1.asia.pool.ntp.org

server 2.asia.pool.ntp.org

#broadcast 192.168.1.255 autokey        # broadcast server

#broadcastclient                        # broadcast client

#broadcast 224.0.1.1 autokey            # multicast server

#multicastclient 224.0.1.1              # multicast client

#manycastserver 239.255.254.254         # manycast server

#manycastclient 239.255.254.254 autokey # manycast client

# 允許上層時間伺服器主動修改本機時間

restrict 2.cn.pool.ntp.org nomodify notrap noquery

restrict 1.asia.pool.ntp.org nomodify notrap noquery

restrict 2.asia.pool.ntp.org nomodify notrap noquery

server 127.127.1.0 # local clock

fudge 127.127.1.0 stratum 10

# Enable public key cryptography.

#crypto

includefile /etc/ntp/crypto/pw

# Key file containing the keys and key identifiers used when operating

# with symmetric key cryptography.

keys /etc/ntp/keys

# Specify the key identifiers which are trusted.

#trustedkey 4 8 42

# Specify the key identifier to use with the ntpdc utility.

#requestkey 8

# Specify the key identifier to use with the ntpq utility.

#controlkey 8

# Enable writing of statistics records.

#statistics clockstats cryptostats loopstats peerstats

# Disable the monitoring facility to prevent amplification attacks using ntpdc

# monlist command when default restrict does not include the noquery flag. See

# CVE-2013-5211 for more details.

# Note: Monitoring will not be disabled with the limited restriction flag.

disable monitor

配置檔案修改完成,儲存退出,啟動服務。

# service ntpd start

等待5-10分鐘,通過命令查詢NTPD服務情況。

檢視服務連線和監聽

# netstat -tlunp | grep ntp      

ntpq -p 檢視網路中的NTP伺服器,同時顯示客戶端和每個伺服器的關係

# ntpq -p

#ntpstat 命令檢視時間同步狀態

設定ntp客戶端: 172.16.248.129|130|131

編輯/etc/ntp.conf檔案,加粗字型為變化的內容。

# For more information about this file, see the man pages

# ntp.conf(5), ntp_acc(5), ntp_auth(5), ntp_clock(5), ntp_misc(5), ntp_mon(5).

driftfile /var/lib/ntp/drift

# Permit time synchronization with our time source, but do not

# permit the source to query or modify the service on this system.

restrict default nomodify notrap nopeer noquery

# Permit all access over the loopback interface.  This could

# be tightened as well, but to do so would effect some of

# the administrative functions.

restrict 127.0.0.1

restrict ::1

# Hosts on local network are less restricted.

#restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap

# Use public servers from the pool.ntp.org project.

# Please consider joining the pool (http://www.pool.ntp.org/join.html).

#server 0.centos.pool.ntp.org iburst

server 172.16.172.17

restrict 172.16.172.17 nomodify notrap noquery

server 127.127.1.0

fudge 127.127.1.0  stratum 10

#broadcast 192.168.1.255 autokey        # broadcast server

#broadcastclient                        # broadcast client

#broadcast 224.0.1.1 autokey            # multicast server

#multicastclient 224.0.1.1              # multicast client

#manycastserver 239.255.254.254         # manycast server

#manycastclient 239.255.254.254 autokey # manycast client

# Enable public key cryptography.

#crypto

includefile /etc/ntp/crypto/pw

# Key file containing the keys and key identifiers used when operating

# with symmetric key cryptography.

keys /etc/ntp/keys

# Specify the key identifiers which are trusted.

#trustedkey 4 8 42

# Specify the key identifier to use with the ntpdc utility.

#requestkey 8

# Specify the key identifier to use with the ntpq utility.

#controlkey 8

# Enable writing of statistics records.

#statistics clockstats cryptostats loopstats peerstats

# Disable the monitoring facility to prevent amplification attacks using ntpdc

# monlist command when default restrict does not include the noquery flag. See

# CVE-2013-5211 for more details.

# Note: Monitoring will not be disabled with the limited restriction flag.

disable monitor

重啟ntpd服務

#systemctl restart ntpd

啟動後,檢視同步情況

# ntpq -p

# ntpstat

7.安裝jdk

在叢集中的所有伺服器上都安裝jdk,版本最好在1.8以上,叢集內伺服器版本保持一致。

相關推薦

Centos7.5HDP叢集搭建

硬體環境:6臺伺服器,IP為172.16.172.17/18/19/20/21/22 軟體環境:作業系統為Centos7.5                  Ambari版本為2.5.0.3                  HDP版本為2.6.0.3 一、安裝前準

centos7Hadoop2.8.4全分佈搭建之HDFS叢集搭建

1)搭建前的準備 注意:(以下操作可以先配置一臺,然後通過scp命令傳送到其他兩臺虛擬機器上 傳送到其他機器 scp -r 主機名: 注意:載入環境變數 source /etc/profile

Centos7.5配置主DNS伺服器

本篇文章我們介紹下Centos7.5系統上配置DNS伺服器,實驗拓撲如下: 首先我們需要準備2臺Centos系統並配置好YUM倉庫,設定好主機名、網路,關閉防火牆、Selinux等。 兩臺電腦網路配置如下:伺服器關閉防火牆、Selinux配置PC機配置 第二步,我們在伺服器上安裝DNS

React Native在window的環境搭建

React Native官方開發文件   以下是本人抄錄的: 初次接觸React Native感覺和React很像,卻是有點類似,但不完全是,React Native有自己的元件物件,不過它也自定義的元件也是使用ES6中的語法定義。 首先是安裝的依賴,必須安裝:Node、React Nati

kubernetes學習:2.kubernetes叢集搭建架構介紹

kubernetes叢集搭建:架構介紹 作為一個容器的編排管理工具,k8s的效能出眾而且社群力量強大,連docker官方也已經預設k8s為容器編排的首選工具。所以我們更有必要去學習和了解它。 k8s的整體架構主要分為兩個部分: master(控制節點)和

ZooKeeper叢集搭建:準備工作以及搭建叢集的具體操作

為什麼要做ZooKeeper叢集? ZooKeeper在Dubbo框架中起著發現服務,服務登出/註冊(動態伸縮)的功能,假如僅有的一臺Zookeeper宕機了,將會造成整個應用的服務呼叫失敗,服務停擺期間所造成的損失不可想象 同時Zookeeper也是很

centosDocker環境搭建

Docker是一個能夠把開發的應用程式自動部署到容器的開源引擎,基於客戶端-伺服器架構c/s,讓開發者可以打包他們的應用以及依賴包到一個可移植的容器中,然後釋出到任何流行的Linux 機器上,也可以實現虛擬化。容器是完全使用沙箱機制,相互之間不會有任何介面。 Docker

Ubuntu14.04 CEPH 叢集搭建

(備註:此一共用到4臺機器。分別命名為ceph-admin ,ceph0,ceph1,ceph2.其中ceph-admin作為deploy 機器用於部署,ceph-admin,ceph0作為mon,ceph1,作為OSD,ceph2作為元資料伺服器) 0.配置IP/主機名

CentOStorque叢集配置-torque安裝與配置

一、Centos7系統的安裝及設定 1、給兩臺電腦安裝CentOS7.0,光碟啟動路徑修改為:/dev/cdrom 修改主機名稱 # hostnamectl set-hostname <host-name> 2、設定ip地址 # vi /etc/sysco

SpringCloud運行環境搭建Centos7.0jdk的安裝

mage ech 目錄 img 生效 deploy 服務 web tro 一、運行環境 1、jdk下載安裝 1.1、下載 地址:http://www.oracle.com/technetwork/java/javase/downloads/index.html 1.2、安

ubuntu 18.04greenplum安裝筆記Linux基礎環境的搭建

背景 需要構建一個用於資料倉庫的分散式資料庫叢集。 每一個節點暫時不需要進行備份,同時也不考慮壞掉的情況。 每一個數據節點最好都不用進行過多的配置,安裝起來方便。 Greenplum的Shared-Nothing的設計思路很適合我目前的業務場景。 物理環境 4檯安裝了Linux的主機,安裝的作業系統的版本均為

centos7.5coredns+etcd搭建DNS伺服器

  coredns簡介 安裝etcd 安裝coredns 設定域名解析 A記錄 AAAA記錄 CNAME記錄 SRV記錄 TXT記錄   coredns簡介 CoreDNS是一個DNS伺服器,和Cadd

centos7.5coredns+etcd搭建DNS服務器

space 實現 輪詢 才會 項目 主機 地址 inux 解決 coredns簡介 安裝etcd 安裝coredns 設置域名解析 A記錄 AAAA記錄 CNAME記錄 SRV記錄 TXT記錄 coredns簡介 CoreDNS是一個DNS服務器,和Cad

Hadoop叢集搭建網路配置

軟體環境 作業系統 CentOS 6.4 64bit (Basic Server + 桌面環境) 虛擬機器 VMware Workstation 12.0

【Docker】基於例項專案的叢集部署安裝環境搭建

叢集 叢集具有三高特點: 高效能 高負載 高可用 現在的環境中,經常會用到叢集,如資料庫叢集。如,我們在主機上部署資料庫節點,形成叢集。 安裝環境與配置 在Docker中部署叢集,首先要安裝Linux環境,這裡我們使用VMware虛擬機

大資料Hadoop叢集環境搭建

前言 Hadoop在大資料技術體系中的地位至關重要,Hadoop是大資料技術的基礎,對Hadoop基礎知識的掌握的紮實程度,會決定在大資料技術道路上走多遠。 這是一篇入門文章,Hadoop的學習方法很多,網上也有很多學習路線圖。本文的思路是:以安裝部署Apache Hadoop2.x

windows ActiveMQ叢集搭建ActiveMq+zookeeper+levelDB

已成功配置偽叢集,高可用 啟動zookeeper,啟動報錯正常,等3個服務都啟動了,即完全啟動了 啟動3個activemq服務 如上截圖,埠8161服務自動分配為master;另外2個服務為slave;3個服務的話允許一個服務結束通話,具體參考說明請

hadoop spark 大資料叢集環境搭建

大資料雲端計算現在比較熱門,未來的一個發展方向,在此分享下技術,有不對的地方歡迎指出 1、軟體環境(會分享到網盤) centos6.5 jdk1.7 hadoop2.4.1(這裡只用到hdfs,namenode不走ha) zookeeper3.4.5 spark1.3.0

Hadoop+Flume+Kafka+Zookeeper叢集環境搭建

Hadoop+Flume+Kafka+Zookeeper叢集環境搭建 1.部署基礎條件 1.1 硬體條件 IP hostname 192.168.100.103 mater 192.168.100.104 flumekafka1 192.168.1

python建立elasticsearch索引實現大資料搜尋——之環境搭建

目錄 1.需求闡述 1)資料儲存在阿里雲內網的Mysql伺服器上,需要通過一臺伺服器SSH隧道穿透取得資料。 2)首先明確,一張設計圖需要多種素材來構成。資料量很大,需要操作的有兩個表,稱為stylepatternshow表,目前資料3w行(