更新Inceptor UDF步骤
1. 在终端窗口1,上传UDF Jar包aa-inceptor-function-0.0.1-SNAPSHOT.jar到192.168.1.1服务器的 /tmp/backUdfJar 目录
2. 在终端窗口1,查询Inceptor server镜像
[root@test-tdh01 backUdfJar]# docker images | grep inceptor
test-tdh01:5000/transwarp/inceptor transwarp-6.0.2-final 64c28fe2025c 10 minutes ago 3.84GB
镜像名为: test-tdh01:5000/transwarp/inceptor:transwarp-6.0.2-final
备份当前镜像
docker tag 64c28fe2025c test-tdh01:5000/transwarp/inceptor:transwarp-6.0.2-final_Backup
3. 在终端窗口1,进入容器
[root@test-tdh01 ~]# docker run -ti -v /tmp/backUdfJar:/tmp/new test-tdh01:5000/transwarp/inceptor:transwarp-6.0.2-final bash
[root@7896d4e8f158 ~]#
4. 在终端窗口1,容器中执行命令,替换jar包
[root@7896d4e8f158 ~]# mv /tmp/new/aa-inceptor-function-0.0.1-SNAPSHOT.jar /usr/lib/inceptor/lib
5. 在终端窗口1,容器中验证是否替换成功,核对时间和包大小
[root@7896d4e8f158 ~]# ll /usr/lib/inceptor/lib/ | grep aa-inceptor
-rw-r--r-- 1 root root 31007 Apr 8 15:12 aa-inceptor-function-0.0.1-SNAPSHOT.jar
6. 保留终端窗口1,另起一个终端窗口2,终端窗口2中执行命令,可以找出上面第3步运行的docer id
[root@test-tdh01 ~]# docker ps | grep inceptor
7896d4e8f158 test-tdh01:5000/transwarp/inceptor:transwarp-6.0.2-final "bash" 3 minutes ago Up 3 minutes youthful_goldberg
找出docer id为:7896d4e8f158
7. 终端窗口2,更新docker镜像
docker commit -a “inceptor-udfs” 7896d4e8f158 test-tdh01:5000/transwarp/inceptor:transwarp-6.0.2-final
8. 终端窗口2,提交修改的image到仓库中
docker push test-tdh01:5000/transwarp/inceptor:transwarp-6.0.2-final
9. 在终端窗口1,退出容器
[root@7896d4e8f158 ~]# exit
exit
[root@test-tdh01 ~]#
10. 登录http://192.168.1.1:8180 页面,重启Inceptor服务
11. 注册函数,UDF函数生效
--删除永久函数
drop permanent function betaUDF;
drop permanent function chkunitrdNavUDF;
...
--注册永久函数
create permanent function betaUDF as 'com.xc.function.BetaUDF' ;
create permanent function chkunitrdNavUDF as 'com.xc.function.ChkUnitrdNavUDF' ;
...