注意配置大数据集群hostname1.解压压缩包
主节点安装
2.修改配置文件(vi presto/presto-server-0.232/etc/)
node.properties
node.environment=production
node.id=hadoop1
node.data-dir=/web/soft/presto/data
# node.id 是每个节点的唯一标识,每个节点id不一样;
# node.data-dir 是日志配置文件等的目录,需要将 /web/soft替换为你软件的安装目录
config.properties
coordinator=true
node-scheduler.include-coordinator=true
http-server.http.port=8888
# 内存配置成倍增长
query.max-memory=8GB
query.max-memory-per-node=1GB
query.max-total-memory-per-node=2GB
discovery-server.enabled=true
discovery.uri=http://10.255.53.197:8888
http-server.http.port
# 是server请求的端口,需要确保该端口打开,如果该端口被占用请配置其他端口;
query.max-memory
# 是查询计划在整个集群中所占用的总内存量,配置成20GB;
query.max-memory-per-node=1GB
# 是查询计划在在每个节点上面占用最大内存,不动;query.max-total-memory-per-node=2GB 是每个查询在每台节点上面总的内存占用 不动;
discovery.uri=http://10.255.53.197:8888
# 中Ip 为主节点IP地址,8888端口需要与上面server请求端口保持一致;其他配置不动;
jvm.config
-server
-Xmx10G
-XX:+UseG1GC
-XX:G1HeapRegionSize=32M
-XX:+UseGCOverheadLimit
-XX:+ExplicitGCInvokesConcurrent
-XX:+HeapDumpOnOutOfMemoryError
-XX:+ExitOnOutOfMemoryError
-Xmx10G 是Jvm 运行最大内存占用量,调整为 16G 即-Xmx16G,其他配置不动;
catalog/hive.properties
connector.name=hive-hadoop2
hive.metastore.uri=thrift://10.255.53.197:9083
hive.config.resources=/web/soft/hadoop-2.6.5/etc/hadoop/core-site.xml,/web/soft/hadoop-2.6.5/etc/hadoop/hdfs-site.xml
hive.metastore.uri
# 需要配置为节点IP;
hive.config.resources
# 需要配置为对应hadoop配置的目录
3.启动服务
服务端
后台启动:bin/launcher start
前台运行:bin/launcher run
help:bin/launcher–help
安装检查:bin/launcher –verbose
运行日志:
launcher.log:由launcher创建,包括了server的初始化日志和jvm的日志。
server.log:Presto主要日志。
http-request.log:HTTP请求日志。
客户端
./presto-cli --server localhost:8080:启动客户端
./presto-cli --server localhost:8080 --execute="cmd":直接执行命令
./presto-cli --help:查看帮助
前台启动成功
从节点安装
1.直接将刚才安装好的presto 打包 /web/soft/presto 这个打包成presto.tar.gz 然后分发到其中一个从节点相同目录
2.进入 /web/soft/presto/presto-server-0.232/etc 编辑config.properties
将文件内容直接替换为以下内容(对应ip端口如果变了也请记得更改)
coordinator=false
http-server.http.port=8888
query.max-memory=20GB
query.max-memory-per-node=1GB
query.max-total-memory-per-node=2GB
discovery.uri=http://10.255.53.197:8888
注意:discovery.uri的IP也必须是主节点IP
3.进入 /web/soft/presto/presto-server-0.232/etc 编辑 node.properties;将 node.id 更改为该节点唯一标识
4.该从节点部署好后,同样 进入 /web/soft/presto/presto-server-0.232/bin
前台启动:
./launcher run
验证安装成功
所有节点部署好后并启动服务后,进入主节点 /web/soft/presto 目录,首先开启hive metastore服务 :
hive --service metastore &
然后开启presto客户端
./presto --server localhost:8888 --catalog hive --schema nginxlog
进入客户端执行命令:show schemas;
如果查询出数据说明安装完全成功