# Apache Kudu

• Fast processing of OLAP workloads.
• Integration with MapReduce, Spark and other Hadoop ecosystem components.
• Tight integration with Cloudera Impala, making it a good, mutable alternative to using HDFS with Parquet.
• Strong but flexible consistency model, allowing you to choose consistency requirements on a per-request basis, including the option for strict-serializable consistency.
• Strong performance for running sequential and random workloads simultaneously.
• Easy to administer and manage with Cloudera Manager.
• High availability. Tablet Servers and Masters use the Raft Consensus Algorithm, which ensures that as long as more than half the total number of replicas is available, the tablet is available for reads and writes. For instance, if 2 out of 3 replicas or 3 out of 5 replicas are available, the tablet is available.
• Reads can be serviced by read-only follower tablets, even in the event of a leader tablet failure.
• Structured data model.

• Reporting applications where newly-arrived data needs to be immediately available for end users
• Time-series applications that must simultaneously support:
• queries across large amounts of historic data
• granular queries about an individual entity that must return very quickly
• Applications that use predictive models to make real-time decisions with periodic refreshes of the predictive model based on all historic data

# 安装

kudu的安装分为两部分，一个是kudu本身的安装，另外一个是安装kudu版本的impala，公司这边用的CDH5.8，装起来比较简单，需要注意的是CDH原本带的impala是不支持kudu的，需要重新安装impala_kudu才行，而且我是删了以后重新安装了一遍。

## kudu

kudu的安装比较简单，添个parcels就行了，也不需要什么特殊设置，唯一注意的是fs_wal_dirfs_data_dirs两个参数，前者可以和后者值相同，但不能是后者的子目录。另外需要注意的是，如果在一台服务器上，需要同时运行kudu master和kudu tablet，这两个值需要设置为不同的值，否则就会导致服务无法启动。

## impala_kudu

• Impala Service Environment Advanced Configuration Snippet (Safety Valve)需要加上IMPALA_KUDU=1，这个用中文UI还搜不到，换了英文UI才搜到
• Impala Daemon Command Line Argument Advanced Configuration Snippet (Safety Valve)需要配置master的地址，例如-kudu_master_hosts=10.0.1.1:7051，不知道为毛Cloudera Manager为毛不会自己配置

## 建表

kudu的文档里的建表语句已经不能在最新版本上用了，IMPALA-2848这个issue已经“简化”了建表语句，同时原来的已经不能用了……这里给个新的例子吧：

STORED AS KUDU取代了原先的table properties的方式。