Preston 官網:http://prestodb.io/
Preston Github 主頁:https://github.com/facebook/presto
一 安裝環境
二 安裝Presto
wget https://repo1.maven.org/maven2/com/facebook/presto/presto-server/0.105/presto-server-0.105.tar.gz
tar -xf presto-server-0.105.tar.gz
node.environment=test
node.id=ffffffff-ffff-ffff-ffff-ffffffffffff
node.data-dir=/var/presto/data
參數說明:
node.environment
:環境名稱。一個集羣節點中的所有節點的名稱應該保持一致。node.id
:節點唯一標識的名稱。node.data-dir
:數據和日誌存放路徑
-server
-Xmx4G
-XX:+UseConcMarkSweepGC
-XX:+ExplicitGCInvokesConcurrent
-XX:+AggressiveOpts
-XX:+HeapDumpOnOutOfMemoryError
-XX:OnOutOfMemoryError=kill -9 %p
2.2.3 配置config.properties
coordinator=true
node-scheduler.include-coordinator=false
http-server.http.port=8001
task.max-memory=1GB
discovery-server.enabled=true
discovery.uri=http://10.199.xxx.xx:8001
參數說明:
coordinator
:Presto 實例是否以 coordinator 對外提供服務node-scheduler.include-coordinator
:是否允許在 coordinator 上進行調度任務http-server.http.port
:HTTP 服務的端口task.max-memory=1GB
:每一個任務(對應一個節點上的一個查詢計劃)所能使用的最大內存discovery-server.enabled
:是否使用 Discovery service 發現集羣中的每一個節點。discovery.uri
:Discovery server 的 url
com.facebook.presto=INFO
設置某一個 java 包的日誌等級2.2.5 關於 Catalog 的配置(與kafka連接配置)
connector.name=kafka
kafka.table-names=table1,table2
kafka.nodes=host1:port,host2:port
具體配置參考http://prestodb-china.com/docs/current/connector/kafka.html三 啓動Presto
launcher --help
以後臺方式啓動prestolauncher start
一般啓動方式,且輸出並打印日誌launcher run
停止prestolauncher stop
四 測試Presto CLI
wget https://repo1.maven.org/maven2/com/facebook/presto/presto-cli/0.100/presto-cli-0.100-executable.jar
將mv presto-cli-0.100-executable.jar重命名爲prestomv presto-cli-0.100-executable.jar presto
將presto添加執行權限chmod 777 presto
啓動presto cli./presto --server localhost:8001 --catalog kafka --schema default
執行show tables,如下