cdh实现 impala deamon 和hiveserver2 ha 并在hue内集成他们jdbcha

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/haoxiaoyan/article/details/86152506
  • 安装haproxy实现ha

Install the load balancer: 

root@bigdata-150021:~#  yum -y install haproxy

root@bigdata-150021:~# cp /etc/haproxy/haproxy.cfg /etc/haproxy/haproxy.cfg.bak

  • 配置haproxy

cat /etc/haproxy/haproxy.cfg

root@bigdata-150021:~# cat /etc/haproxy/haproxy.cfg|grep -v "#"

 

global

    log         127.0.0.1 local0

    log         127.0.0.1 local1 notice

    chroot      /var/lib/haproxy

    pidfile     /var/run/haproxy.pid

扫描二维码关注公众号,回复: 4847577 查看本文章

    maxconn     4000

    user        haproxy

    group       haproxy

    daemon

 

 

defaults

    mode                    http

    log                     global

    option                  httplog

    option                  dontlognull

    option http-server-close

    option forwardfor       except 127.0.0.0/8

    option                  redispatch

    retries                 3

    maxconn                                 3000

    timeout connect         5000

    timeout client          1m

    timeout server          1m

    timeout http-keep-alive 10s

    timeout check           10s

    maxconn                 3000

listen stats :1080#定义管理界面

        balance

        stats enable

        stats uri /stats

        stats refresh 30s

        stats auth admin:admin

listen jdbchive :25005

           option tcplog

           server hiveServer1 bigdata-150022:10000 check

           server hiveServer2 bigdata-150023:10000 check

listen impalashell :25003

                option tcplog

                server impalashell_dn1 bigdata-150021:21000 check

                server impalashell_dn2 bigdata-150022:21000 check

                server impalashell_dn3 bigdata-150023:21000 check

listen impalajdbc :25004

                option tcplog

                server impalajdbc_dn1 bigdata-150021:21050 check

                server impalajdbc_dn2 bigdata-150022:21050 check

                server impalajdbc_dn3 bigdata-150023:21050 check

  • 启动haproxy

root@bigdata-150021:~# systemctl enable haproxy.service

root@bigdata-150021:~# systemctl start haproxy.service

http://10.5.15.21:1080/stats

  • Hue集成hiveserver2和impala deamon jdbc连接

hue_safety_valve.ini

[impala]

server_host=bigdata-150021

server_port=25004

[beeswax]

server_host=bigdata-150021

server_port=25005

 

在此,我的Haproxy服务安装在了bigdata-150021节点上,所以此处填写bigdata-150021:25003

 

 

  • Impala shell 测试

使用多个终端同时访问,并执行SQL语句,查看是否会通过HAProxy服务自动负载到其它Impala Daemon节点。

打开第一个终端访问并执行SQL

 

 

猜你喜欢

转载自blog.csdn.net/haoxiaoyan/article/details/86152506
今日推荐