(五)部署单机Datasphere大数据平台--Exchangis-1.0.0

安装exchangis
创建数据库
mysql -u hadoop -p -h hive --default-character-set=utf8
create database exchangis
通过在linkis数据库中执行以下语句,为Exchangis分配专属token:

use dss
INSERT INTO `linkis_mg_gateway_auth_token`(`token_name`,`legal_users`,`legal_hosts`,`business_owner`,`create_time`,`update_time`,`elapse_day`,`update_by`) VALUES ('EXCHANGIS-AUTH','*','*','BDP',curdate(),curdate(),-1,'LINKIS');

为exchangis加hive数据源的认证
INSERT INTO `linkis_ps_dm_datasource_env` (`env_name`, `env_desc`, `datasource_type_id`, `parameter`, `create_time`, `create_user`, `modify_time`, `modify_user`) VALUES ('开发环境SIT', '开发环境SIT', 4, '{"uris":"thrift://hadoop_master:8093", "hadoopConf":{"hive.metastore.execute.setugi":"true"}}',  now(), NULL,  now(), NULL);
INSERT INTO `linkis_ps_dm_datasource_env` (`env_name`, `env_desc`, `datasource_type_id`, `parameter`, `create_time`, `create_user`, `modify_time`, `modify_user`) VALUES ('开发环境UAT', '开发环境UAT', 4, '{"uris":"thrift://hadoop_master:8093", "hadoopConf":{"hive.metastore.execute.setugi":"true"}}',  now(), NULL,  now(), NULL);

在项目的根目录下执行如下命令:编译安装  
mvn clean install 
assembly-package/target 目录下生成安装包。

解压安装包
tar -zxvf wedatasphere-exchangis-{VERSION}.tar.gz -C /shds/datasphere/exchangis/
  
config/config.sh

#LINKIS_GATEWAY服务地址IP,用于查找linkis-mg-gateway服务
LINKIS_GATEWAY_HOST=datasphere

#LINKIS_GATEWAY服务地址端口,用于查找linkis-mg-gateway服务         
LINKIS_GATEWAY_PORT=9001

#Exchangis服务端口
EXCHANGIS_PORT=8092

#Eureka服务URL
EUREKA_URL=http://datasphere:20300/eureka/

config/db.sh

# 设置数据库的连接信息
# 包括IP地址、端口、用户名、密码和数据库名称
MYSQL_HOST=hive
MYSQL_PORT=3306
MYSQL_USERNAME=hadoop
MYSQL_PASSWORD=hadoop
DATABASE=exchangis

在sbin目录下执行 install.sh 脚本,完成一键安装部署:

./install.sh

启动
./daemon.sh start server

您也可以自行编译 Exchangis 前端,在 Exchangis 根目录下执行如下命令:

cd web
npm i
npm run build

# 请先将 Exchangis 前端包拷贝到 `/appcom/Install/exchangis/web` 目录
cd /appcom/Install/exchangis/web
unzip dist.zip


/etc/nginx/conf.d/exchangis.conf

        server {
            listen       8092; # 访问端口 如果该端口被占用,则需要修改
            server_name  localhost;
            #charset koi8-r;
            #access_log  /var/log/nginx/host.access.log  main;
            location /dist {
            root   /appcom/Install/exchangis/web; # Exchangis 前端部署目录
            autoindex on;
            }

            location /api {
            proxy_pass http://{IP}:{PORT};  # 后端Linkis的地址,需要修改
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header x_real_ipP $remote_addr;
            proxy_set_header remote_addr $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_http_version 1.1;
            proxy_connect_timeout 4s;
            proxy_read_timeout 600s;
            proxy_send_timeout 12s;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection upgrade;
            }

            #error_page  404              /404.html;
            # redirect server error pages to the static page /50x.html
            #
            error_page   500 502 503 504  /50x.html;
            location = /50x.html {
            root   /usr/share/nginx/html;
            }
        }

nginx -s reload


停止服务:lsof -i:8091
kill ${taskid}

添加数据源
1、能够在页面上显示出来
Exchangis-release-1.0.0\exchangis-datasource\extension-datasources路径下添加数据源类型,可以参照exchangis-datasource-ext-mysql
添加完编译,编译后的exchangis-datasource-ext-***要放在${exchangix_home}/exchangis-extds下,添加的数据源需要在linkis_ps_dm_datasource_type、linkis_ps_dm_datasource_type_key表里加入,并且前端也要添加对应数据源的图片,要不然不显示,数据如下图所示

2、完成连接
incubator-linkis-release-1.1.1\incubator-linkis-release-1.1.1\linkis-public-enhancements\linkis-datasource\linkis-metadata-manager\service

在这个下面添加数据源的连接方法和实现几个固定方法以供找数据抽取,编译后的包要放到${linkis_home}/lib/linkis-public-enhancements/linkis-ps-metadatamanager/service下

3、修改sqoop的连接(在exchangis的后端代码中修改)(已使用修改的代码无需重新操作)
Exchangis-release-1.0.0\exchangis-job\exchangis-job-server\src\main\java\com\webank\wedatasphere\exchangis\job\server\builder\transform\mappings添加数据源的ParamsMapping
Exchangis-release-1.0.0\exchangis-job\exchangis-job-server\src\main\java\com\webank\wedatasphere\exchangis\job\server\builder\engine\SqoopExchangisEngineJobBuilder.java修改参数
ps:可以用原生的sqoop跑一下任务,看看和这个生成的各个参数有什么不一致,然后慢慢修改,我在这里修改了CONNECT_PROTOCOL、NUM_MAPPERS,删除了参数Driver

4、sqoop中添加对应数据源的jar包
如:postgresql-42.2.2.jar(postgresql)
ojdbc6-11.2.0.4.jar(oracle)
另外,如果想正常执行oracle,需要安装oracle客户端

重启


[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-Vs621lHQ-1678595555846)(E:\ProgramData\Typora\typora-user-images\image-20221011094339975.png)]

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-jAzS3kb6-1678595555847)(E:\ProgramData\Typora\typora-user-images\image-20221011094408650.png)]

安装exchangis插件
编译
cd {EXCHANGIS_CODE_HOME}/exchangis-plugins/exchangis-appconn
mvn clean install

会在该路径下找到exchangis-appconn.zip安装包
{EXCHANGIS_CODE_HOME}/exchangis-plugins/exchangis-appconn/target/exchangis-appconn.zip


cd {DSS_Install_HOME}/dss/dss-appconns
unzip exchangis-appconn.zip

cd {DSS_INSTALL_HOME}/dss/bin
./install-appconn.sh
# 脚本是交互式的安装方案,您需要输入字符串exchangis以及exchangis服务的ip和端口,即可以完成安装
# 这里的exchangis端口是指前端端口,在nginx进行配置。而不是后端的服务端口


sh ./dss-stop-all.sh
sh ./dss-start-all.sh

在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值