文章目录
- 一. 安装准备
- 二. 创建用户
- 三. 准备安装包
- 四. 修改配置
- 1. 修改config.sh
- 2. 修改db.sh
- 五、安装和使用
- 1. 执行安装脚本
- 2. 启动服务
- 3. 查看验证是否成功
- 六. 报错处理
- 报错一:The user is not logged in
- 报错二:dss接口报错
- 报错三:执行没有输出结果
dss官方安装文档
一. 安装准备
- 需要的命令工具(安装时会自动检查,并安装,如果安装失败则需手动安装):telnet; tar; sed; dos2unix; mysql; yum; java; unzip; zip; expect
- 需要安装的软件:MySQL (5.5+); JDK (1.8.0_141以上); Nginx
- Tips: 请确保已安装Links
二. 创建用户
- 假设部署用户是taiyi账号
- 在所有需要部署的机器上创建部署用户,用于安装:sudo useradd taiyi
- 改部署用户权限:vi /etc/sudoers
taiyi ALL=(ALL) NOPASSWD: NOPASSWD: ALL
三. 准备安装包
下载安装包:DSS Release-1.1.1,或者自己编译
这里选择了一键安装的dss安装包,安装起来比较方便。
DSS 一键安装部署包的层级目录结构如下:
├── dss_install# 一键部署主目录├── bin# 用于一键安装,以及一键启动 DSS├── conf# 一键部署的参数配置目录├── wedatasphere-dss-x.x.x-dist.tar.gz# DSS后端安装包├── wedatasphere-dss-web-x.x.x-dist.zip# DSS前端安装包四. 修改配置
1. 修改config.sh
### deploy user deployUser=taiyi ### DSS Web DSS_NGINX_IP=dss安装所在ip或hostname DSS_WEB_PORT=8085### DSS VERSION DSS_VERSION=1.1.1LINKIS_HOME=### EUREKA install information ########## 这些配置会产生dss的nginx配置,注意别写默认的127.0.0.1### You can access it in your browser at the address below:http://${EUREKA_INSTALL_IP}:${EUREKA_PORT}### Microservices Service Registration Discovery Center LINKIS_EUREKA_INSTALL_IP=linkis EUREKA所在节点ip LINKIS_EUREKA_PORT=20303#LINKIS_EUREKA_PREFER_IP=true### Gateway install information LINKIS_GATEWAY_INSTALL_IP=linkis GATEWAY所在节点ip LINKIS_GATEWAY_PORT=9001########## ## java applicationdefaultjvm memory export SERVER_HEAP_SIZE="512M"##sendemail配置,只影响DSS工作流中发邮件功能 EMAIL_HOST=smtp.163.com EMAIL_PORT=25EMAIL_USERNAME=xxx@163.com EMAIL_PASSWORD=xxxxx EMAIL_PROTOCOL=smtp ### Save the file path exported by the orchestrator service ORCHESTRATOR_FILE_PATH=/home/taiyi/dss1.1.1/orchestrator-service ### Save DSS flow execution service log path EXECUTION_LOG_PATH=/home/taiyi/dss1.1.1/logs2. 修改db.sh
###forDSS-Server and Eventchecker APPCONN MYSQL_HOST=ip MYSQL_PORT=3306MYSQL_DB=linkis_dss MYSQL_USER=user MYSQL_PASSWORD=pd #主要是配合scriptis一起使用,如果不配置,会默认尝试通过$HIVE_CONF_DIR 中的配置文件获取 # 或者不配置、或找不到配置则在scriptis使用不了hive HIVE_META_URL="jdbc:mysql://hostname:3306/hivedb?createDatabaseIfNotExist=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false"HIVE_META_USER="user"HIVE_META_PASSWORD="pd"五、安装和使用
1. 执行安装脚本
cd xx/dss_install/bin sh install.sh2. 启动服务
在xx/dss_install/bin目录下执行启动服务脚本
sh start-all.sh如果启动产生了错误信息,可以查看具体报错原因。启动后,各项微服务都会进行通信检测,如果有异常则可以帮助用户定位异常日志和原因。
3. 查看验证是否成功
- 用户可以在Linkis的Eureka界面查看 DSS 后台各微服务的启动情况,默认情况下DSS有7个微服务
- 用户可以使用谷歌浏览器访问以下前端地址:http://DSS_NGINX_IP:DSS_WEB_PORT 启动日志会打印此访问地址(在xx/dss_install/conf/config.sh中也配置了此地址)。
六. 报错处理
报错一:The user is not logged in
解决方式:手动添加令牌
日志分析
2023-07-2620:52:04.149[INFO][main]o.a.l.h.d.DWSHttpClient(110)[org$apache$linkis$httpclient$AbstractHttpClient$$addAttempt$1]-The user is not logged in,please log in first,you can set a retry2023-07-2620:52:04.153[ERROR][main]c.w.w.d.c.u.DSSExceptionUtils(42)[lambda$handling$0]-execute failed,reason:org.apache.linkis.httpclient.exception.HttpClientRetryException:errCode:10900,desc:The user is not logged in,please log in first,you can set a retry,message:这里是dds向links的gateway接口请求令牌{"method":"/api/rest_j/v1/bml/upload","status":-1,"message":"Token Authentication Failed, token: BML-AUTH,tokenUser: taiyi, reason: errCode: 15201 ,desc: Token is not valid or stale(token 令牌无效或已过期)! ,ip: bi50v.poc.bjmd.qihoo.net ,port: 9001 ,serviceKind: linkis-mg-gateway","data":{}},ip:bi50v.poc.bjmd.qihoo.net,port:9002,serviceKind:dss-framework-project-server at org.apache.linkis.httpclient.AbstractHttpClient.org$apache$linkis$httpclient$AbstractHttpClient$$addAttempt$1(AbstractHttpClient.scala:115)~[linkis-httpclient-1.1.1.jar:1.1.1]at org.apache.linkis.httpclient.AbstractHttpClient.execute(AbstractHttpClient.scala:123)~[linkis-httpclient-1.1.1.jar:1.1.1]at org.apache.linkis.httpclient.AbstractHttpClient.execute(AbstractHttpClient.scala:92)~[linkis-httpclient-1.1.1.jar:1.1.1]at org.apache.linkis.bml.client.impl.HttpBmlClient.uploadResource(HttpBmlClient.scala:313)~[linkis-bml-client-1.1.1.jar:1.1.1]at com.webank.wedatasphere.dss.framework.appconn.service.impl.AppConnResourceServiceImpl.upload(AppConnResourceServiceImpl.java:121)~[dss-appconn-framework-1.1.1.jar:?]at通过查看日志堆栈,基本可以定位到,dss调用links的gateway接口发送令牌,以便能成功与linkis连通,但因为令牌的原因(令牌无效或已过期)导致dss无法通过linkis gateway的校验。所以我们需要找到符合逻辑的令牌。
通过阅读相关linkis gateway代码知道,令牌存在linkis_mg_gateway_auth_token表中
而这些令牌是linkis安装时进行初始化的,接着看dss提供的令牌是:BML-AUTH,这里显然没有,那既然这样手动添加一个BML-AUTH令牌。
重启linkis服务,访问前端,输入用户名密码,进来了。
报错二:dss接口报错
rg.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)\n\tat org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadEx ecutor.java:409)\n\tat org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883)\n\tat org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034)\n\ tat java.lang.Thread.run(Thread.java:748)\nCaused by:org.apache.ibatis.exceptions.PersistenceException:\n### Error querying database.Cause:org.springframework.jdbc.CannotGetJdbcConnectionException:Failed to obtain JDBC Connection;nested exception is com.alibaba.druid.pool.GetConnectionTimeoutException:wait millis6000,active0,maxActive20,creating0,createErrorCount98652\n### The error may exist in URL[jar:file:/home/taiyi/linkis1.3.2/install/lib/linkis-public-enhancements/linkis-ps-publicservice/linkis-metadata-1.3.2.jar!/mapper/common/HiveMetaDao.xml]\n### The error may involve org.apache.linkis.metadata.hive.dao.HiveMetaDao.getAllDbs\n### The error occurredwhileexecuting a query\n### Cause:org.springframework.jdbc.CannotGetJdbcConnectionException:Failed to obtain JDBC Connection;nested exception is com.alibaba.druid.pool.GetConnectionTimeoutException:wait millis6000,active0,maxActive20,creating0,createErrorCount98652\n\tat org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)\n\tat通过观察报错信息getAllDbs所用的连接配置,定位到linkis-ps-publicservice模块下的配置出现了问题,如下:
修改配置:
vim conf/db.sh
vim conf/linkis-ps-publicservice.properties
### Provide the DB information of Hive metadata database.### Attention!If there are special characters like"&",they need to be enclosed in quotation marks.HIVE_META_URL="jdbc:mysql://hive_meta_hive_db:3306/hivedb?createDatabaseIfNotExist=true'&'amp;useUnicode=true'&'amp;characterEncoding=UTF-8'&'amp;useSSL=false"而错误的原因就是:
Attention! If there are special characters like “&”, they need to be enclosed in quotation marks.
报错三:执行没有输出结果
执行没有输出结果,报错如下:
具体是输出结果的路径配置的的不对,而输出结果路径是在安装时配置的,如下在install脚本中
安装后存在两个位置,修改:
vim install/conf/linkis-env.sh
vim linkis-cg-entrance.properties
重启linkis,再执行Script: