SimpleDao
ambari安装
2019-05-06, 访问数: 1091

添加yum源

  1. wget -nv http://public-repo-1.hortonworks.com/ambari/centos6/2.x/updates/2.2.2.0/ambari.repo -O /etc/yum.repos.d/ambari.repo

安装

  1. yum repolist
  2. yum install ambari-server

配置

  1. ambari-server setup

启动

  1. ambari-server start

手动安装agent

  1. yum install ambari-agent

如果网络太慢,则可以配置本地的自定义源,这样就不用去远程下载

[Updates-ambari-2.2.2.0]
name=ambari-2.2.2.0 - Updates
baseurl=http:///AMBARI-2.2.2.0/centos6/2.2.2.0-460
gpgcheck=1
gpgkey=http:///AMBARI-2.2.2.0/centos6/2.2.2.0-460/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1

  1. * 4)手动安装agent时需要改agent的配置
  2. ~~~ bash
  3. vi /etc/ambari-agent/conf/ambari-agent.ini
  4. [server]
  5. hostname=<your.ambari.server.hostname>
  6. url_port=8440
  7. secured_url_port=8441

清除metrics的数据

  1. 先停止metrics server服务和ambari-server
  2. 找到metrics配置中的以下两项,然后删除对应文件夹
  3. 删除hbase.rootdir:/data11/data11/var/lib/ambari-metrics-collector/hbase
  4. 删除hbase.tmp.dir:/data10/var/lib/ambari-metrics-collector/hbase-tmp
  5. 启动服务

删除服务

  1. curl -u admin:admin -H "X-Requested-By: ambari" -X DELETE http://localhost:8080/api/v1/clusters/test/services/SAMPLE

api

  1. # 添加机器
  2. curl --user admin:admin -i -X POST -H "X-Requested-By: ambari" http://127.0.0.1:8080/api/v1/clusters/ODF/hosts/am123
  3. # 添加服务
  4. curl --user admin:admin -i -X POST -H "X-Requested-By: ambari" http://127.0.0.1:8080/api/v1/clusters/ODF/hosts/am123/host_components/METRICS_MONITOR
  5. # 安装组件
  6. curl --user admin:admin -i -X PUT -d '{"HostRoles": {"state": "INSTALLED"}}' -H "X-Requested-By: ambari" http://127.0.0.1:8080/api/v1/clusters/ODF/hosts/am123/host_components/METRICS_MONITOR
  7. # 启动组件
  8. curl --user admin:admin -i -X PUT -d '{"HostRoles": {"state": "STARTED"}}' -H "X-Requested-By: ambari" http://127.0.0.1:8080/api/v1/clusters/ODF/hosts/am123/host_components/METRICS_MONITOR