码迷,mamicode.com
首页 > Web开发 > 详细

单层gmetad高可用

时间:2016-06-12 07:03:22      阅读:293      评论:0      收藏:0      [点我收藏+]

标签:

虽然gmetad可以多层,但是层层gmetad都需要开启gweb,还是很麻烦。如果只是担心一个gmetad不安全,可以做成gmetad高可用,但是我还不知道有没有想hadoop ha那样自动failover的办法。

资源安排:

hdp1:gmetad、gmond、gweb

hdp2:gmetad、gmond、gweb

hdp3:gmond

配置目的:

hdp1和hdp2的gmetad、gweb高可用,每个节点的gweb都可以展示整个集群的数据

hdp1、2、3均属于一个集群

配置文件:

hdp3——gmond.conf:

cluster {

  name = "hdp3"

  owner = "unspecified"

  latlong = "unspecified"

  url = "unspecified"

}

 

/* The host section describes attributes of the host, like the location */

host {

  location = "unspecified"

}

 

/* Feel free to specify as many udp_send_channels as you like.  Gmond

   used to only support having a single channel */

udp_send_channel {

  #bind_hostname = yes # Highly recommended, soon to be default.

                       # This option tells gmond to use a source address

                       # that resolves to the machine‘s hostname.  Without

                       # this, the metrics may appear to come from any

                       # interface and the DNS names associated with

                       # those IPs will be used to create the RRDs.

  #mcast_join = 239.2.11.71

  host = hdp1

  port = 8649

  ttl = 1

}

 

udp_send_channel {

  #bind_hostname = yes # Highly recommended, soon to be default.

                       # This option tells gmond to use a source address

                       # that resolves to the machine‘s hostname.  Without

                       # this, the metrics may appear to come from any

                       # interface and the DNS names associated with

                       # those IPs will be used to create the RRDs.

  #mcast_join = 239.2.11.71

  host = hdp2

  port = 8649

  ttl = 1

}

 

/* You can specify as many udp_recv_channels as you like as well. */

udp_recv_channel {

  #mcast_join = 239.2.11.71

  #port = 8649

  #bind = 239.2.11.71

  #retry_bind = true

  # Size of the UDP buffer. If you are handling lots of metrics you really

  # should bump it up to e.g. 10MB or even higher.

  # buffer = 10485760

}

 

/* You can specify as many tcp_accept_channels as you like to share

   an xml description of the state of the cluster */

tcp_accept_channel {

  #port = 8649

  # If you want to gzip XML output

  gzip_output = no

}

hdp1——gmond.conf:

cluster {

  name = "hdp3"

  owner = "unspecified"

  latlong = "unspecified"

  url = "unspecified"

}

 

/* The host section describes attributes of the host, like the location */

host {

  location = "unspecified"

}

 

/* Feel free to specify as many udp_send_channels as you like.  Gmond

   used to only support having a single channel */

udp_send_channel {

  #bind_hostname = yes # Highly recommended, soon to be default.

                       # This option tells gmond to use a source address

                       # that resolves to the machine‘s hostname.  Without

                       # this, the metrics may appear to come from any

                       # interface and the DNS names associated with

                       # those IPs will be used to create the RRDs.

  #mcast_join = 239.2.11.71

  host = hdp1

  port = 8649

  ttl = 1

}

 

udp_send_channel {

  #bind_hostname = yes # Highly recommended, soon to be default.

                       # This option tells gmond to use a source address

                       # that resolves to the machine‘s hostname.  Without

                       # this, the metrics may appear to come from any

                       # interface and the DNS names associated with

                       # those IPs will be used to create the RRDs.

  #mcast_join = 239.2.11.71

  host = hdp2

  port = 8649

  ttl = 1

}

 

 

/* You can specify as many udp_recv_channels as you like as well. */

udp_recv_channel {

  #mcast_join = 239.2.11.71

  port = 8649

  #bind = 239.2.11.71

}

 

/* You can specify as many tcp_accept_channels as you like to share

   an xml description of the state of the cluster */

tcp_accept_channel {

  port = 8649

}

 

hdp1——gmetad.conf:

[root@hdp1 ganglia]# grep -v ^# gmetad.conf 

 data_source "hdp3" localhost

 RRAs "RRA:AVERAGE:0.5:1:244" "RRA:AVERAGE:0.5:24:244" "RRA:AVERAGE:0.5:168:244" "RRA:AVERAGE:0.5:672:244" \

 gridname "HDP" 

 all_trusted on

setuid_username ganglia

 xml_port 8651

 interactive_port 8652

case_sensitive_hostnames 0

 

hdp2——gmond.conf:

效仿hdp1的配置即可

 

效果达到配置目的

单层gmetad高可用

标签:

原文地址:http://www.cnblogs.com/roger888/p/5576355.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!