菜单
登录注册
欢 迎
登录
自动登录
忘记密码?
新朋友
注册
注册
老朋友
登录
笔记内容为空!
TA的笔记树 >>
Impala添加负载
Impala
### 序 添加负载后会将sql负载分配到集群 ### 1. 安装haproxy ``` yum install haproxy ``` ### 2. 替换配置`/etc/haproxy/haproxy.cfg` ``` #--------------------------------------------------------------------- # Global settings #--------------------------------------------------------------------- global log 127.0.0.1 local2 chroot /var/lib/haproxy pidfile /var/run/haproxy.pid maxconn 4000 user haproxy group haproxy daemon # turn on stats unix socket stats socket /var/lib/haproxy/stats #--------------------------------------------------------------------- # common defaults that all the 'listen' and 'backend' sections will # use if not designated in their block #--------------------------------------------------------------------- defaults mode http #mode { tcp|http|health },tcp 表示4层,http表示7层,health仅作为健康检查使⽤ log global option httplog option dontlognull #option http-server-close #option forwardfor except 127.0.0.0/8 #option abortonclose ##连接数过⼤⾃动关闭 option redispatch #如果失效则强制转换其他服务器 retries 3 #尝试3次失败则从集群摘除 timeout http-request 10s timeout queue 1m #timeout connect 10s #timeout client 1m #timeout server 1m timeout connect 1d #连接超时时间,重要,hive查询数据能返回结果的保证 timeout client 1d#同上 timeout server 1d#同上 timeout http-keep-alive 10s timeout check 10s #健康检查时间 maxconn 3000 #最大连接数 listen status #定义管理界⾯ bind 0.0.0.0:1080#管理界⾯访问IP和端⼝ mode http #管理界面所使用的协议 option httplog maxconn 5000 #最大连接数 stats refresh 30s#30秒⾃动刷新 stats uri /stats listen impalashell bind 0.0.0.0:25003 #ha作为proxy所绑定的IP和端⼝ mode tcp #以4层⽅式代理,重要 option tcplog balance leastconn #调度算法 'leastconn' 最少连接数分配,或者 'roundrobin',轮询分 server impalashell_1 realtime-1:21000 check server impalashell_2 realtime-2:21000 check server impalashell_3 realtime-3:21000 check server impalashell_4 realtime-4:21000 check server impalashell_5 realtime-5:21000 check server impalashell_6 realtime-6:21000 check listen impalajdbc bind 0.0.0.0:25004 #ha作为proxy所绑定的IP和端⼝ mode tcp #以4层⽅式代理,重要 option tcplog balance leastconn #调度算法 'leastconn' 最少连接数分配,或者 'roundrobin',轮询分 server impalajdbc_1 realtime-1:21050 check server impalajdbc_2 realtime-2:21050 check server impalajdbc_3 realtime-3:21050 check server impalajdbc_4 realtime-4:21050 check server impalajdbc_5 realtime-5:21050 check server impalajdbc_6 realtime-6:21050 check #--------------------------------------------------------------------- # main frontend which proxys to the backends #--------------------------------------------------------------------- frontend main *:5000 acl url_static path_beg -i /static /images /javascript/stylesheets acl url_static path_end -i .jpg .gif .png .css .js use_backend static if url_static default_backend app #--------------------------------------------------------------------- # static backend for serving up images, stylesheets and such #--------------------------------------------------------------------- backend static balance roundrobin server static 127.0.0.1:4331 check #--------------------------------------------------------------------- # round robin balancing between the various backends #--------------------------------------------------------------------- backend app balance leastconn server app1 127.0.0.1:5001 check server app2 127.0.0.1:5002 check server app3 127.0.0.1:5003 check server app4 127.0.0.1:5004 check ``` - 注意点 ``` 配置中有两处集群节点配置:realtime-x 根据自身集群数据和host增删即可 ``` ### 3. 重启服务 ``` 开启: service haproxy start 关闭: service haproxy stop 重启: service haproxy restart ``` ### 4. 修改程序连接端口 ``` im.url=jdbc\:impala\://realtime-2\:21050/db 改成: im.url=jdbc\:impala\://realtime-2\:25004/ ``` ### 5. 完成!
vanki
不要说我们一无所有,我们要做天下的主人!
浏览:
1740
创建:
2021-07-15 14:17:40
更新:
2021-07-15 14:24:56
TA的最新笔记
spring-boot配置redis多数据源
linux源修改(阿里)
python安装postgresql依赖
arthas使用
java基于spring的NamedParameterJdbcTemplate封装的获取sql工具类
Impala添加负载
S3常用使用
redis常用操作
hdfs相关命令
crontab使用
TA的最热笔记
java异步http请求工具类(org.asynchttpclient)
iTerm2主题配置与常用技巧
java基于spring.redisTemplate实现分布式锁工具类
Kotlin + SpringBoot + JPA(Hibernate) + Repository自定义方法
IDEA汉化
Sequel Pro连接mysql8打开数据库报错
centos-Hadoop2.7.3完全分布式搭建(HA)
SpringBoot上传文件报错(The temporary upload location [..] is not valid)
mac常用软件
kotlin对象属性值拷贝工具类