部署yanagishima纪实

简介

     yanagishima 是presto的一个客户端web工具,目前支持相对较好,部署一下。

Gradle安装

// A code block
# 下载Gradle
wget http://services.gradle.org/distributions/gradle-5.6.2-bin.zip 
mv gradle-5.6.2-bin.zip /usr/local

# 解压
unzip /usr/local/gradle-5.6.2-bin.zip
mv /usr/local/gradle-5.6.2 /usr/local/gradle

# 配置到环境变量。将下面的两行插入到 /etc/profile。记得:source /etc/profile
export GRADLE_HOME=/usr/local/gradle
export PATH=$PATH:$GRADLE_HOME/bin

# 查看是否生效
gradle -v

Node.js安装

// A code block
# 1下载Node.js包
wget https://nodejs.org/dist/v10.16.3/node-v10.16.3-linux-x64.tar.xz

# 2 解压
tar -xf node-v10.16.3-linux-x64.tar.xz -C /usr/local
# 3 重命名
mv /usr/local/node-v10.16.3-linux-x64 /usr/local/nodejs

# 4 修改属组
chown -R root:root /usr/local/nodejs

# 5 执行node命令,查看版本
/usr/local/nodejs/bin/node -v

# 6 创建软连接
ln -s /usr/local/nodejs/bin/node /usr/local/bin
ln -s /usr/local/nodejs/bin/npm  /usr/local/bin

# 7 设置权限问题
npm config set unsafe-perm(针对当前用户的)   
npm config -g set unsafe-perm(全局的)

# 8 安装node-sass。Install from mirror in China。
# 详细说明访问:https://github.com/sass/node-sass#install-from-mirror-in-china
# 注意:如果报文件权限不够,就赋予 774 权限。如果没有文件就手动创建。

npm install -g mirror-config-china --registry=http://registry.npm.taobao.org
npm install node-sass

下载源码并编译

# 1克隆 yanagishima
git clone https://github.com/yanagishima/yanagishima.git
cd yanagishima/

# 2 编译
# 2.1 查看当前的可供选择的tag
git tag
# 2.2 切换到对应的分支上。这里选择20.0版本,因为之后的对jdk要求是 Java 11,我们使用Java 8的来编译
git checkout -b 20.0 refs/tags/20.0
# 2.3 查看当前所在的分支
git branch
# 2.4 编译打包。如果重新编译,
# ./gradlew clean
./gradlew distZip
#……
#> Task :compileJava
#Note: Some input files use unchecked or unsafe operations.
#Note: Recompile with -Xlint:unchecked for details.
#BUILD SUCCESSFUL in 7m 30s
#11 actionable tasks: 11 executed

# 3 将编译好的包发送的安装节点
scp  build/distributions/yanagishima-20.0.zip root@node2:/opt/presto-0.219

# 4 到node2节点,解压配置
cd /opt/presto-0.219/
unzip yanagishima-20.0.zip

修改yanagishima的配置文件

我们主要修改/opt/presto-0.219/yanagishima-20.0/conf/yanagishima.properties配置文件。为了防止端口冲突(lsof -i:8080),可以修改为其它端口号,这里我修改为 38080。

# yanagishima web port
jetty.port=38080
# 30 minutes. If presto query exceeds this time, yanagishima cancel the query.
presto.query.max-run-time-seconds=1800
# 1GB. If presto query result file size exceeds this value, yanagishima cancel the query.
presto.max-result-file-byte-size=1073741824
# you can specify freely. But you need to specify same name to presto.coordinator.server.[...] and presto.redirect.server.[...] and catalog.[...] and schema.[...]
presto.datasources=my-presto
auth.my-presto=false
# presto coordinator url
presto.coordinator.server.my-presto=http://cdh2:8080
# almost same as presto coordinator url. If you use reverse proxy, specify it
presto.redirect.server.my-presto=http://cdh2:8080
# presto catalog name
catalog.my-presto=hive
# presto schema name
schema.my-presto=default
# if query result exceeds this limit, to show rest of result is skipped
select.limit=500
# http header name for audit log
audit.http.header.name=some.auth.header
use.audit.http.header.name=false
# limit to convert from tsv to values query
to.values.query.limit=500
# authorization feature
check.datasource=false
hive.jdbc.url.your-hive=jdbc:hive2://cdh3:10000/default
hive.jdbc.user.your-hive=hive
hive.jdbc.password.your-hive=hive
hive.query.max-run-time-seconds=3600
hive.query.max-run-time-seconds.your-hive=3600
resource.manager.url.your-hive=http://cdh3:8088
sql.query.engines=presto,hive
hive.datasources=your-hive
hive.disallowed.keywords.your-hive=insert,drop
# 1GB. If hive query result file size exceeds this value, yanagishima cancel the query.
hive.max-result-file-byte-size=1073741824
# 注意一定要在这个目录下新建一个空的hive_setup_query_your-hive文件
hive.setup.query.path.your-hive=/opt/presto-0.219/yanagishima-20.0/conf/hive_setup_query_your-hive
cors.enabled=false

yanagishima的启停

# 启动。注意:务必进入到yanagishima-20.0目录下启动,否则页面会报 404 
cd /opt/presto-0.219/yanagishima-20.0/
nohup bin/yanagishima-start.sh >y.log 2>&1 &

# 停止
/opt/presto-0.219/yanagishima-20.0/bin/yanagishima-shutdown.sh

  • 1
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 7
    评论
评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值