CDH 5.15.1 部署及集群优化

集群部署

机器要求
  • 操作系统 : CentOS 7.1以上(CentOS Linux release 7.4.1708)
  • java版本: jdk 1.8.0_191
  • mysql: 版本5.7.16
  • 网络和安全: 关闭防火墙和SELinux,NTP 时间同步
文档参考
  • CDH
  • kafka
  • mysql
软件包
  • cloudera-manager
    • cloudera-manager-centos7-cm5.15.1_x86_64.tar.gz
  • CDH-parcel
    • manifest.json
    • .parcel
    • .parcel.sha1
  • mysql驱动
    • mysql-connector-java-5.1.43.jar
  • mysql
    • mysql-5.7.24-1.el7.x86_64.rpm-bundle.tar
  • jdk
    • jdk-8u191-linux-x64.rpm
  • ntp.conf
driftfile  /var/lib/ntp/drift
pidfile    /var/run/ntpd.pid
logfile    /var/log/ntp.log
 
 
# Access Control Support
restrict    default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery
restrict 127.0.0.1
restrict 192.168.0.0 mask 255.255.0.0 nomodify notrap nopeer noquery
restrict 172.16.0.0 mask 255.240.0.0 nomodify notrap nopeer noquery
restrict 100.64.0.0 mask 255.192.0.0 nomodify notrap nopeer noquery
restrict 10.0.0.0 mask 255.0.0.0 nomodify notrap nopeer noquery
 
 
# local clock
server 127.127.1.0
fudge  127.127.1.0 stratum 10
 
 
restrict ntp1.aliyun.com nomodify notrap nopeer noquery
restrict ntp1.cloud.aliyuncs.com nomodify notrap nopeer noquery
restrict ntp10.cloud.aliyuncs.com nomodify notrap nopeer noquery
restrict ntp11.cloud.aliyuncs.com nomodify notrap nopeer noquery
restrict ntp12.cloud.aliyuncs.com nomodify notrap nopeer noquery
restrict ntp2.aliyun.com nomodify notrap nopeer noquery
restrict ntp2.cloud.aliyuncs.com nomodify notrap nopeer noquery
restrict ntp3.aliyun.com nomodify notrap nopeer noquery
restrict ntp3.cloud.aliyuncs.com nomodify notrap nopeer noquery
restrict ntp4.aliyun.com nomodify notrap nopeer noquery
restrict ntp4.cloud.aliyuncs.com nomodify notrap nopeer noquery
restrict ntp5.aliyun.com nomodify notrap nopeer noquery
restrict ntp5.cloud.aliyuncs.com nomodify notrap nopeer noquery
restrict ntp6.aliyun.com nomodify notrap nopeer noquery
restrict ntp6.cloud.aliyuncs.com nomodify notrap nopeer noquery
restrict ntp7.cloud.aliyuncs.com nomodify notrap nopeer noquery
restrict ntp8.cloud.aliyuncs.com nomodify notrap nopeer noquery
restrict ntp9.cloud.aliyuncs.com nomodify notrap nopeer noquery
 
 
server ntp1.aliyun.com iburst minpoll 4 maxpoll 10
server ntp1.cloud.aliyuncs.com iburst minpoll 4 maxpoll 10
server ntp10.cloud.aliyuncs.com iburst minpoll 4 maxpoll 10
server ntp11.cloud.aliyuncs.com iburst minpoll 4 maxpoll 10
server ntp12.cloud.aliyuncs.com iburst minpoll 4 maxpoll 10
server ntp2.aliyun.com iburst minpoll 4 maxpoll 10
server ntp2.cloud.aliyuncs.com iburst minpoll 4 maxpoll 10
server ntp3.aliyun.com iburst minpoll 4 maxpoll 10
server ntp3.cloud.aliyuncs.com iburst minpoll 4 maxpoll 10
server ntp4.aliyun.com iburst minpoll 4 maxpoll 10
server ntp4.cloud.aliyuncs.com iburst minpoll 4 maxpoll 10
server ntp5.aliyun.com iburst minpoll 4 maxpoll 10
server ntp5.cloud.aliyuncs.com iburst minpoll 4 maxpoll 10
server ntp6.aliyun.com iburst minpoll 4 maxpoll 10
server ntp6.cloud.aliyuncs.com iburst minpoll 4 maxpoll 10
server ntp7.cloud.aliyuncs.com iburst minpoll 4 maxpoll 10
server ntp8.cloud.aliyuncs.com iburst minpoll 4 maxpoll 10
server ntp9.cloud.aliyuncs.com iburst minpoll 4 maxpoll 10
自动化脚本
  • kudu启动失败,如下错误信息:
    F1224 18:05:40.439416 6270 init.cc:84] Check failed: _s.ok() Bad status: Not implemented: The CPU on this system (Common KVM processor����������������������������) does not support the SSE4.2 instruction set which is required for running Kudu. If you are running inside a VM, you may need to enable SSE4.2 pass-through
    需要启动虚拟机的SSE4.2
  • hive启动时 mysql驱动问题
    ln -s /opt/cm-5.15.1/share/cmf/lib/mysql-connector-java-5.1.43.jar /opt/cloudera/parcels/CDH/lib/hive/lib/mysql-connector-java.jar
    在每个节点上的/opt/cloudera/parcels/CDH/lib/hive/lib下建一个软链接
  • oozie mysql驱动问题
    ln -s /opt/cm-5.15.1/share/cmf/lib/mysql-connector-java-5.1.43.jar /var/lib/oozie/mysql-connector-java.jar
  • 启动NFS Gateway报错
    No portmap or rpcbind service is running on this host. Please start portmap or rpcbind service before attempting to start the NFS Gateway role on this host.
    需要安装rpcbind: yum install rpcbind.x86_64 -y, 参考

集群优化

impala 优化
  • impala 实现负载均衡
    利用 HAProxy 对 Impala Daemon 实现负载均衡, 正对目前的查询量 HAProxy 为单节点部署,若查询量比较大请参考 Impala+HAProxy+Kerberos 方式部署(仅供参考)
  • impala 集群参数调优
KUDU优化
  • 参数调节 Configuring Tablet Servers
Flag Valid Options Default Description
–block_cache_capacity_mb integer 512 分配给Kudu Tablet服务器块缓存的最大内存量。(虽然较高的值有助于提高读写性能,但是不要将 block_cache_capacity_mb 提高到内存压力阈值以上,因为这将导致即使写吞吐量很低,Kudu也会频繁刷新,建议将block_cache_capacity_mb保持在内存压力阈值的50%以下)
–memory_limit_hard_bytes integer 4294967296 在开始拒绝所有输入的写之前,Tablet Server 可以消耗的最大内存量。(根据机器内存去调整,如果主机有更多的内存可供Kudu使用,那么建议设置大一点。根据系统总内存自动调整大小的值为0,值-1禁用所有内存限制,单位:bytes)
–maintenance_manager_num_threads int32 1 维护管理器线程池的大小。对于旋转磁盘,线程数不应超过设备数。(通常,建议的维护管理器线程与数据目录的比例为1:3)
–default_num_replicas int32 3 每个tablet的默认副本数
  • Kudu 的内存背压解决方案: 官网
    尽管官网给出了参数调节的说明,但在实际情况中, 当出现Kudu背压时, 所有业务均停掉, 而Kudu占用内存并没有及时下降, 导致数据无法写入使业务瘫痪. 这一原因目前并没有得到很好的解决方案, 但对以上参数的调节可尽量避免该错误的发生, 后期持续更新.

未完待续…

你可能感兴趣的:(kudu,hadoop)