久久精品人人爽,华人av在线,亚洲性视频网站,欧美专区一二三

ambari怎么增加ElasticSearch服務(wù)

共計(jì) 3132 個(gè)字符,預(yù)計(jì)需要花費(fèi) 8 分鐘才能閱讀完成。

這篇文章主要講解了“ambari 怎么增加 ElasticSearch 服務(wù)”,文中的講解內(nèi)容簡單清晰,易于學(xué)習(xí)與理解,下面請(qǐng)大家跟著丸趣 TV 小編的思路慢慢深入,一起來研究和學(xué)習(xí)“ambari 怎么增加 ElasticSearch 服務(wù)”吧!

 Ambari 是支持服務(wù)擴(kuò)展的,只需要,恩,整理,打包,扔我們的服務(wù)到它的資源目錄,重啟服務(wù)器就可以了。聽起來很簡單。它的服務(wù)組織結(jié)構(gòu)是分 Stack / Service /Component 3 層的  。所以我們從 Stack 開始。一個(gè)自定義 Stack 的目錄結(jié)構(gòu)如圖 (從 HDP 的復(fù)制過來)。

自定義 Stack

[root@master stacks]# pwd
/var/lib/ambari-server/resources/stacks
[root@master stacks]# tree NQ
└── 1.1
 ├── configuration
 │ └── cluster-env.xml
 ├── metainfo.xml
 ├── repos
 │ └── repoinfo.xml # 軟件倉庫的 URL
 └── services # 服務(wù)目錄
 └── ELASTICSEARCH
 ├── configuration
 │ └── elasticsearch-env.xml
 ├── metainfo.xml
 ├── metrics.json
 └── package
 ├── archive.zip
 ├── scripts
 │ └── master.py
 └── templates
9 directories, 8 files

有了 Stack 后(當(dāng)然,你直接扔到HDP的服務(wù)下面也可以),我們可以添加自己的服務(wù)了。可以看到服務(wù)是在 Stack 的 services 下的,每個(gè)目錄。

自定義 Service

目錄結(jié)構(gòu)

 |_ services
 |_  service_name 
 metainfo.xml # 服務(wù)配置文件
 metrics.json # 運(yùn)維指標(biāo)配置,映射 ganglia 和 ambari
 |_ configuration
 {configuration files} # 配置文件
 |_ package
 {files, scripts, templates} # 安裝腳本,模板和一些文件 

metainfo.xml     服務(wù)配置文件,我盡量寫全面一點(diǎn),為了解釋清楚各個(gè)配置項(xiàng)。

?xml version= 1.0 ? 
 metainfo 
  schemaVersion 2.0 /schemaVersion 
  services 
  service 
  name ELASTICSEARCH /name 
  displayName ElasticSearch /displayName 
  comment ElasticSearch service /comment 
  version 1.4.0 /version 
  components 
  component 
  name ELASTICSEARCH /name 
  displayName ElasticSearch /displayName 
  category MASTER /category 
  cardinality 1 /cardinality 
  commandScript 
  script scripts/master.py /script 
  scriptType PYTHON /scriptType 
  timeout 600 /timeout 
  /commandScript 
  /component 
  component 
  name ELASTICSEARCH_NODE /name 
  displayName ElasticSearchNode /displayName 
  category SLAVE /category 
  cardinality ALL /cardinality 
  auto-deploy   !-- 自動(dòng)部署,僅在 cardinality 滿足的情況下,界面上就不問,在這臺(tái)主機(jī),是否安裝這個(gè)組件了 -- 
  enabled false /enabled 
  /auto-deploy 
  commandScript 
  script scripts/slave.py /script 
  scriptType PYTHON /scriptType 
  timeout 600 /timeout 
  /commandScript 
  !-- configFiles 
  configFile 
  type env /type 
  fileName elasticsearch-env.xml /fileName 
  dictionaryName elasticsearch-env /dictionaryName 
  /configFile 
  /configFiles -- 
  /component 
  /components 
  osSpecifics 
  osSpecific 
  osFamily any /osFamily 
  packages 
  package 
  name elasticsearch /name 
  /package 
  /packages 
  /osSpecific 
  /osSpecifics 
  requiredServices 
  service GANGLIA /service   !-- 依賴服務(wù),安裝的時(shí)候限制,沒有不能繼續(xù)安裝 -- 
  /requiredServices 
  configuration-dependencies 
  config-type elasticsearch-env /config-type 
  /configuration-dependencies 
  monitoringService false /monitoringService   !-- 如果是監(jiān)控服務(wù)的話,每個(gè)組件重啟,他都要重啟 -- 
  /service 
  /services 
 /metainfo

服務(wù)和組件名字一定要大寫,不然后面你會(huì)全部重新來過的。不要問我為什么知道,我重試了 N 次。

package 節(jié)點(diǎn)的 name 很重要。yum install [name] 

category 節(jié)點(diǎn)組件類型可以有 MASTER,SLAVE,CLIENT 幾種,那 p2p 集群咋辦?

MASTER 不是必須得有,只有 SLAVE 也可以

cardinality 節(jié)點(diǎn)是安裝基數(shù)。1+ 最少一個(gè) ,  0-1 最多一個(gè) ,ALL 全部

master.py   一個(gè)最簡單的安裝腳本,好吧,實(shí)際上它什么也沒做

import sys
from resource_management import *
class Master(Script):
 def install(self, env):
 print  Install the ES Master 
 def stop(self, env):
 print  Stop the ES Master 
 def start(self, env):
 print  Start the ES Master 
 
 def status(self, env):
 print  Status of the ES Master 
 def configure(self, env):
 print  Configure the ES Master 
if __name__ ==  __main__ :
 Master().execute()

部署,重啟,安裝,然后就能看到我們的成果了,雖然看起來超級(jí)簡單,沒關(guān)系,下面我們會(huì)繼續(xù)完善功能,配置,監(jiān)控,告警管理。。。。

感謝各位的閱讀,以上就是“ambari 怎么增加 ElasticSearch 服務(wù)”的內(nèi)容了,經(jīng)過本文的學(xué)習(xí)后,相信大家對(duì) ambari 怎么增加 ElasticSearch 服務(wù)這一問題有了更深刻的體會(huì),具體使用情況還需要大家實(shí)踐驗(yàn)證。這里是丸趣 TV,丸趣 TV 小編將為大家推送更多相關(guān)知識(shí)點(diǎn)的文章,歡迎關(guān)注!

正文完
 
丸趣
版權(quán)聲明:本站原創(chuàng)文章,由 丸趣 2023-08-16發(fā)表,共計(jì)3132字。
轉(zhuǎn)載說明:除特殊說明外本站除技術(shù)相關(guān)以外文章皆由網(wǎng)絡(luò)搜集發(fā)布,轉(zhuǎn)載請(qǐng)注明出處。
評(píng)論(沒有評(píng)論)
主站蜘蛛池模板: 确山县| 铜山县| 云龙县| 板桥市| 弋阳县| 丰顺县| 新化县| 南涧| 额敏县| 都江堰市| 玉林市| 延津县| 女性| 灌阳县| 长春市| 思茅市| 盱眙县| 宁明县| 吴江市| 株洲县| 连山| 彭州市| 博野县| 东至县| 炎陵县| 宁都县| 连江县| 垣曲县| 乌海市| 安平县| 辛集市| 裕民县| 博乐市| 大理市| 仪征市| 青铜峡市| 贞丰县| 鲁山县| 慈溪市| 喜德县| 望奎县|