在ambari-server所在节点进行下载
wget https://github.com/prestodb/ambari-presto-service/releases/download/v1.2/ambari-presto-1.2.tar.gz
创建文件夹备用
mkdir /var/lib/ambari-server/resources/stacks/HDP/2.6/services/PRESTO
将下载好的包解压到新建的目录中
tar -zxvf ambari-presto-1.2.tar.gz --strip-components 1 -C /var/lib/ambari-server/resources/stacks/HDP/2.6/services/PRESTO
修改文件权限
chmod -R +x /var/lib/ambari-server/resources/stacks/HDP/2.6/services/PRESTO/*
修改presto版本与下载安装包一致(第二步中下载的离线包版本)
vim /var/lib/ambari-server/resources/stacks/HDP/2.6/services/PRESTO/metainfo.xml
修改下载链接为本地路径(第三步配置的本地yum源)
vim /var/lib/ambari-server/resources/stacks/HDP/2.6/services/PRESTO/package/scripts/download.ini
mkdir presto_repo && cd presto_repo/
wget http://search.maven.org/remotecontent?filepath=com/facebook/presto/presto-server-rpm/0.198/presto-server-rpm-0.198.rpm
wget http://search.maven.org/remotecontent?filepath=com/facebook/presto/presto-cli/0.198/presto-cli-0.198-executable.jar
yum install createrepo -y
进入第二步离线包下载目录
createrepo ${PWD}
python -m SimpleHTTPServer 8081 #在该目录下创建一个http服务,监听指定的8081端口
添加repo文件
vim /etc/yum.repos.d/presto.repo
[presto_repo]
name=presto_repo
baseurl=http://192.168.2.30:8081
enable=1
gpgcheck=0
如下图:
scp /etc/yum.repos.d/presto.repo root@hadoop-03:/etc/yum.repos.d/
scp /etc/yum.repos.d/presto.repo root@hadoop-04:/etc/yum.repos.d/
ambari-server restart
这一步当时未撰写文档,这一步和在Ambari安装其它服务组件的步骤是差不多的,根据提示即可安装成功。这里记录了一些安装注意事项和安装中需要的关键信息
注意第3步中的8081端口服务需要先启动
进入presto安装包所在目录执行python -m SimpleHTTPServer 8081
discovery.uri: http://hadoop-01:8285
现象:查询报错Query 20190604_033105_00007_rx2js failed: java.net.UnknownHostException: mycluster
分析:无法识别集群主节点
解决办法:
在ambari界面增加配置:
{
'hive':[
'connector.name=hive-hadoop2',
'hive.metastore.uri=thrift://hadoop-02:9083',
'hive.config.resources=/etc/hadoop/conf/core-site.xml,/etc/hadoop/conf/hdfs-site.xml'
]
}