前言:8 月 17 日,CloudQuery 社区第一期征文活动正式对外发布。小编也陆续收到了很多用户的投稿,再次感谢大家对 CQ 的支持。本文来自社区用户 ID:尚雷的分享,下面就来看看他的 CQ 初体验吧,希望能对初次接触 CQ 的你有所帮助。
在日常数据库运维中,为连接多种数据库,经常要安装不同的客户端,非常繁琐,且占用大量存储空间。如果能有一种工具,可以不用在自己电脑上安装,而且能够同时连接多种数据库该多好。
恰好有一天,我看到一朋友在朋友圈发了一条朋友圈信息,说 CloudQuery 在进行有奖征文。最近我不是刚参加完 OpenGauss 有奖征文吗,趁热打铁,看看这东西是什么,写写文章,看看能否得奖。
于是点开了她发的朋友圈链接,里面只是描述文章征文的内容,并没有讲过多东西,没有讲解 CloudQuery 是干什么的,能做哪些事情,觉得好像也没啥啊,就有点失望了,正好也有事,就没再继续多看下去。过了两天,正好无事,于是又打开了那链接,关注了公众号,登录下官网。我去,这才了解到了 CloudQuery 的一些知识,没想到这 CloudQuery 这么强大,竟然可以连接好多数据库,而且还有审计、提工单等作用。
于是,我决定好好使用了解下。
千里之行始于足下,先安装下试试,let’s go.
本篇主要讲述如何安装部署 CloudQuery 及相关注意事项,因为篇幅,下一篇将讲述如何使用 CloudQuery 来连接数据库。
登录CloudQuery官网,打开下载链接: https://www.cloudquery.club/download,可下载当前最新的社区版 V2.3.0.,(或直接点击文末阅读原文)适合在 RHEL/CentOS 等操作系统安装。
备注:由于我当时测试的时候 V2.3.0 还未发布,只进行了 V2.2.0 的安装,不过已经确认过,两个版本的安装操作相同,大家可放心参考。
点击“立即下载”,将软件下载到本地,下载后的软件名称为 cloudquery-club-V2.2.0.tar.gz 。
然后将下载的安装包上传到安装 CloudQuery 的服务器某个目录,我习惯放在 /root/soft 目录下。
使用 root 用户安装 CloudQuery
解压 CloudQuery-club-V2.2.0.tar.gz,然后进行安装,操作如下:
--- 解压安装包
[root@xsky-node2 ~]# cd /root/soft
[root@xsky-node2 soft]# tar -zxf cloudquery-club-V2.2.0.tar.gz
-- 执行安装
[root@xsky-node2 soft]# cd cloudquery-club-V2.2.0
[root@xsky-node2 cloudquery-club-V2.2.0]# ./deploy.sh install
完整安装结果如下,稍微有些长,为让大家看到整个安装过程,我把整个安装过程代码都附上,如下所示:
[root@xsky-node2cloudquery-club-V2.2.0]# ./deploy.sh install
请输入cloudQuery安装绝对路径(默认为/opt/cloudquery): -- 此处可以直接按回车,默认安装在 /opt/cloudquery 目录
realpath: ‘’: No such file or directory
setenforce: SELinux is disabled
输入路径为无效文件夹,使用默认路径:/opt/cloudquery
开始安装docker与docker-compose
setenforce: SELinux is disabled
Createdsymlink from /etc/systemd/system/multi-user.target.wants/docker.service to /etc/systemd/system/docker.service.
------dockerinstall success-----
------docker-composeinstall success------
------installationis complete------
开始加载docker镜像
setenforce: SELinux is disabled
开始加载base_support镜像
Loadedimage: basejdkpython:8-jdk-slim-buster
Loadedimage: base-redis:5.0.0
Loadedimage: base-terminal:latest
cb42413394c4: Loading layer [==================================================>] 72.51MB/72.51MB
1c44f9d6c008: Loading layer [==================================================>] 9.079MB/9.079MB
c9c81fb767cc: Loading layer [==================================================>] 3.584kB/3.584kB
e339e3812d99: Loading layer [==================================================>] 127.2MB/127.2MB
741b957481de: Loading layer [==================================================>] 340.5kB/340.5kB
6db8ffdd7458: Loading layer [==================================================>] 12.49MB/12.49MB
3da4783ff617: Loading layer [==================================================>] 36.54MB/36.54MB
1b56d8f0f28d: Loading layer [==================================================>] 3.072kB/3.072kB
Loadedimage: base-zookeeper:3.6.2
b93c1bd012ab: Loading layer [==================================================>] 80.33MB/80.33MB
680d4ad25629: Loading layer [==================================================>] 80.66MB/80.66MB
7f7e8ccae681: Loading layer [==================================================>] 759.9MB/759.9MB
5f9f0ed99f1d: Loading layer [==================================================>] 578.6kB/578.6kB
06b4d412e3fe: Loading layer [==================================================>] 3.063MB/3.063MB
7e7548a12c69: Loading layer [==================================================>] 1.536kB/1.536kB
615b033a1040: Loading layer [==================================================>] 3.584kB/3.584kB
dd007340d02c: Loading layer [==================================================>] 9.728kB/9.728kB
5f70bf18a086: Loading layer [==================================================>] 1.024kB/1.024kB
Loadedimage: clickhouse/clickhouse-server:23.3.2.37
e8cf91efbcb0: Loading layer [==================================================>] 58.49MB/58.49MB
00f438525221: Loading layer [==================================================>] 10.44MB/10.44MB
53225373e343: Loading layer [==================================================>] 339.5kB/339.5kB
4d5f0af8bd5c: Loading layer [==================================================>] 4.174MB/4.174MB
7599efc97cb6: Loading layer [==================================================>] 17.1MB/17.1MB
f7ee3866e7fe: Loading layer [==================================================>] 1.425MB/1.425MB
717ce2a08388: Loading layer [==================================================>] 1.536kB/1.536kB
cdaa32d2ec3d: Loading layer [==================================================>] 9.216kB/9.216kB
535acdbb15a8: Loading layer [==================================================>] 197.7MB/197.7MB
919e5a1fcb6c: Loading layer [==================================================>] 56.32kB/56.32kB
52c5b1e57bcd: Loading layer [==================================================>] 2.048kB/2.048kB
72434b8f5e29: Loading layer [==================================================>] 3.072kB/3.072kB
f88c039d7fc6: Loading layer [==================================================>] 14.34kB/14.34kB
73321121ac16: Loading layer [==================================================>] 1.536kB/1.536kB
Loadedimage: postgres:11.8
开始加载业务镜像
Sendingbuild context to Docker daemon 144.1MB
Step1/11 : FROM basejdkpython:8-jdk-slim-buster AS builder
--->ed637a4763c8
Step2/11 : MAINTAINER zhiyou "jian.huang@bintools.cn"
--->Running in a26680e23237
Removingintermediate container a26680e23237
--->d33533b24031
Step3/11 : WORKDIR /opt/cloudquery
--->Running in 9f43335e0f92
Removingintermediate container 9f43335e0f92
--->a36c7d68ab49
Step4/11 : ADD target/cloudquery-user*.jar ./cloudquery-user.jar
--->7ce80605cccc
Step5/11 : RUN mkdir config && mkdir -p /opt/cloudquery/dmc/modules && mkdir -p /opt/cloudquery/dmc/dms_home
--->Running in e1c7dc094ef6
Removingintermediate container e1c7dc094ef6
--->2fb90af3cc3a
Step6/11 : ADD ignore/dmc/modules /opt/cloudquery/dmc/modules
--->64f5755ab83e
Step7/11 : COPY target/classes/application-prod.yml ./config/application.yml
--->024bbe6c6901
Step8/11 : ADD target/sjt_agent.jar ./sjt_agent.jar
--->a04332697017
Step9/11 : EXPOSE 8002
--->Running in fb0652633b36
Removingintermediate container fb0652633b36
--->b5acf1ea6ecb
Step10/11 : EXPOSE 8802
--->Running in bd5d1c34d64b
Removingintermediate container bd5d1c34d64b
--->c4b7fa6fc7e4
Step11/11 : ENTRYPOINT ["java","-javaagent:/opt/cloudquery/sjt_agent.jar","-Xdebug","-Xrunjdwp:transport=dt_socket,suspend=n,server=y,address=8802","-jar","cloudquery-user.jar","--spring.config.location=/opt/cloudquery/config/application.yml"]
--->Running in d51313e590d3
Removingintermediate container d51313e590d3
--->bf2a930020f5
Successfullybuilt bf2a930020f5
Successfullytagged user:cloudquery-club-V2.2.0
Sendingbuild context to Docker daemon 161MB
Step1/11 : FROM basejdkpython:8-jdk-slim-buster AS builder
--->ed637a4763c8
Step2/11 : MAINTAINER lianjun "lianjun@bintools.cn"
--->Running in 23fb56316bbf
Removingintermediate container 23fb56316bbf
--->aa9481f7b501
Step3/11 : WORKDIR /opt/cloudquery
--->Running in 1de42dc9c07d
Removingintermediate container 1de42dc9c07d
--->b7dd7ddcd9a3
Step4/11 : RUN mkdir -p /opt/cloudquery/dmc/modules && mkdir -p /opt/cloudquery/dmc/dms_home && mkdir config
--->Running in 9e3e6b4156ce
Removingintermediate container 9e3e6b4156ce
--->8afc18cc3e3b
Step5/11 : ADD ignore/dmc/modules /opt/cloudquery/dmc/modules
--->3f534f93c81f
Step6/11 : ADD target/cloudquery-data-dict*.jar ./cloudquery-data-dict.jar
--->7396e1a1ee6d
Step7/11 : COPY target/classes/application-prod.yml ./config/application.yml
--->2b94014373be
Step8/11 : ADD target/sjt_agent.jar ./sjt_agent.jar
--->cbcc86c8943d
Step9/11 : EXPOSE 9191
--->Running in 33b7abe5fc19
Removingintermediate container 33b7abe5fc19
--->e90d22adf102
Step10/11 : EXPOSE 9100
--->Running in 0d4e999a0d06
Removingintermediate container 0d4e999a0d06
--->ff61a94e587b
Step11/11 : ENTRYPOINT ["java","-javaagent:/opt/cloudquery/sjt_agent.jar","-Xdebug","-Xrunjdwp:transport=dt_socket,suspend=n,server=y,address=9100","-jar","cloudquery-data-dict.jar","--spring.config.location=/opt/cloudquery/config/application.yml"]
--->Running in 47f3b9409cf4
Removingintermediate container 47f3b9409cf4
--->335f5fae4f74
Successfullybuilt 335f5fae4f74
Successfullytagged data-dict:cloudquery-club-V2.2.0
Sendingbuild context to Docker daemon 158.3MB
Step1/11 : FROM basejdkpython:8-jdk-slim-buster AS builder
--->ed637a4763c8
Step2/11 : MAINTAINER zhiyou "jian.huang@bintools.cn"
--->Using cache
--->d33533b24031
Step3/11 : WORKDIR /opt/cloudquery
--->Using cache
--->a36c7d68ab49
Step4/11 : RUN mkdir -p /opt/cloudquery/dmc/modules && mkdir -p /opt/cloudquery/dmc/dms_home && mkdir config
--->Running in 17d4c5f7be69
Removingintermediate container 17d4c5f7be69
--->f9414ee93a6d
Step5/11 : ADD ignore/dmc/modules /opt/cloudquery/dmc/modules
--->931aea6894d9
Step6/11 : ADD target/cloudquery-desens*.jar ./cloudquery-desens.jar
--->ca1bb6fd3e6d
Step7/11 : COPY target/classes/application-prod.yml ./config/application.yml
--->866c73123d19
Step8/11 : ADD target/sjt_agent.jar ./sjt_agent.jar
--->f63712fb10e2
Step9/11 : EXPOSE 6202
--->Running in defa7e77cf08
Removingintermediate container defa7e77cf08
--->10386a8c7eae
Step10/11 : EXPOSE 6203
--->Running in 1d72029d8df3
Removingintermediate container 1d72029d8df3
--->0b9517a32a3b
Step11/11 : ENTRYPOINT ["java","-javaagent:/opt/cloudquery/sjt_agent.jar","-Xdebug","-Xrunjdwp:transport=dt_socket,suspend=n,server=y,address=6203","-jar","cloudquery-desens.jar","--spring.config.location=/opt/cloudquery/config/application.yml"]
--->Running in a50584fed44f
Removingintermediate container a50584fed44f
--->0c6285c465ef
Successfullybuilt 0c6285c465ef
Successfullytagged desens:cloudquery-club-V2.2.0
Sendingbuild context to Docker daemon 528MB
Step1/12 : FROM basejdkpython:8-jdk-slim-buster AS builder
--->ed637a4763c8
Step2/12 : MAINTAINER zhiyou "jian.huang@bintools.cn"
--->Using cache
--->d33533b24031
Step3/12 : WORKDIR /opt/cloudquery
--->Using cache
--->a36c7d68ab49
Step4/12 : RUN mkdir -p /opt/cloudquery/dmc/modules && mkdir -p /opt/cloudquery/dmc/dms_home && mkdir config
--->Using cache
--->f9414ee93a6d
Step5/12 : ADD ignore/dmc/modules /opt/cloudquery/dmc/modules
--->b6145b227132
Step6/12 : ADD src/main/resources/DataSourceStatement.stg /opt/cloudquery/dmc/modules
--->e9ac4c90a5f1
Step7/12 : ADD target/cloudquery-dms.jar ./cloudquery-dms.jar
--->b591a32bcb13
Step8/12 : ADD target/sjt_agent.jar ./sjt_agent.jar
--->ddac7fdd18ec
Step9/12 : COPY target/classes/application-prod.yml ./config/application.yml
--->83aa3f9a2058
Step10/12 : EXPOSE 9001
--->Running in 601925e4e89d
Removingintermediate container 601925e4e89d
--->4f692cd59da7
Step11/12 : EXPOSE 9802
--->Running in 2a3eee066264
Removingintermediate container 2a3eee066264
--->db45a370b3c3
Step12/12 : ENTRYPOINT ["java","-javaagent:/opt/cloudquery/sjt_agent.jar","-jar","cloudquery-dms.jar","--spring.config.location=/opt/cloudquery/config/application.yml"]
--->Running in a1cdfe8593f1
Removingintermediate container a1cdfe8593f1
--->10490b0fb46d
Successfullybuilt 10490b0fb46d
Successfullytagged dms:cloudquery-club-V2.2.0
Sendingbuild context to Docker daemon 386.1MB
Step1/11 : FROM basejdkpython:8-jdk-slim-buster AS builder
--->ed637a4763c8
Step2/11 : MAINTAINER zhiyou "jian.huang@bintools.cn"
--->Using cache
--->d33533b24031
Step3/11 : WORKDIR /opt/cloudquery
--->Using cache
--->a36c7d68ab49
Step4/11 : RUN mkdir -p /opt/cloudquery/dmc/modules && mkdir -p /opt/cloudquery/dmc/dms_home && mkdir config
--->Using cache
--->f9414ee93a6d
Step5/11 : ADD ignore/dmc/modules /opt/cloudquery/dmc/modules
--->c546352c13ef
Step6/11 : ADD target/cloudquery-export*.jar ./cloudquery-export.jar
--->619df2c5cfe8
Step7/11 : COPY target/classes/application-prod.yml ./config/application.yml
--->a08981a20c41
Step8/11 : ADD target/sjt_agent.jar ./sjt_agent.jar
--->2cf3b93bad45
Step9/11 : EXPOSE 9001
--->Running in d66a72bc0bc8
Removingintermediate container d66a72bc0bc8
--->dbd312de5ef8
Step10/11 : EXPOSE 9803
--->Running in d48a09fc5521
Removingintermediate container d48a09fc5521
--->7db16d4b5a28
Step11/11 : ENTRYPOINT ["java","-javaagent:/opt/cloudquery/sjt_agent.jar","-Xdebug","-Xrunjdwp:transport=dt_socket,suspend=n,server=y,address=9803","-jar","cloudquery-export.jar","--spring.config.location=/opt/cloudquery/config/application.yml"]
--->Running in 5d55134339fc
Removingintermediate container 5d55134339fc
--->6a7df0842d60
Successfullybuilt 6a7df0842d60
Successfullytagged export:cloudquery-club-V2.2.0
Sendingbuild context to Docker daemon 121.8MB
Step1/10 : FROM basejdkpython:8-jdk-slim-buster AS builder
--->ed637a4763c8
Step2/10 : MAINTAINER zhiyou "qipeng.lu@bintools.cn"
--->Running in 7d682f308838
Removingintermediate container 7d682f308838
--->6d449362ae74
Step3/10 : WORKDIR /opt/cloudquery
--->Running in 340ab95b7dd5
Removingintermediate container 340ab95b7dd5
--->d06ee0715f23
Step4/10 : ADD target/cloudquery-flow*.jar ./cloudquery-flow.jar
--->f950a7a25d5f
Step5/10 : RUN mkdir config
--->Running in d640caa4c469
Removingintermediate container d640caa4c469
--->bac2e203c398
Step6/10 : COPY target/classes/application-prod.yml ./config/application.yml
--->67537c5abd07
Step7/10 : ADD target/sjt_agent.jar ./sjt_agent.jar
--->7a09048f8ee5
Step8/10 : EXPOSE 9876
--->Running in cc25a20eca44
Removingintermediate container cc25a20eca44
--->09e54c1ba1d7
Step9/10 : EXPOSE 9877
--->Running in 738d017bd0e2
Removingintermediate container 738d017bd0e2
--->aca0e0a98d68
Step10/10 : ENTRYPOINT ["java","-javaagent:/opt/cloudquery/sjt_agent.jar","-Xdebug","-Xrunjdwp:transport=dt_socket,suspend=n,server=y,address=9877","-jar","cloudquery-flow.jar","--spring.config.location=/opt/cloudquery/config/application.yml"]
--->Running in 61bf43525a06
Removingintermediate container 61bf43525a06
--->7c4d91244fe7
Successfullybuilt 7c4d91244fe7
Successfullytagged flow:cloudquery-club-V2.2.0
Sendingbuild context to Docker daemon 116.1MB
Step1/11 : FROM basejdkpython:8-jdk-slim-buster AS builder
--->ed637a4763c8
Step2/11 : MAINTAINER zhiyou "jian.huang@bintools.cn"
--->Using cache
--->d33533b24031
Step3/11 : WORKDIR /opt/cloudquery
--->Using cache
--->a36c7d68ab49
Step4/11 : ADD target/cloudquery-message*.jar ./cloudquery-message.jar
--->26170fd14fa8
Step5/11 : RUN mkdir config
--->Running in 3a8c7b9a2443
Removingintermediate container 3a8c7b9a2443
--->71c56c427e27
Step6/11 : COPY target/classes/application-prod.yml ./config/application.yml
--->c9b4916ea0cc
Step7/11 : ADD target/sjt_agent.jar ./sjt_agent.jar
--->39529834997e
Step8/11 : EXPOSE 8899
--->Running in 2cef156e6fa7
Removingintermediate container 2cef156e6fa7
--->61afeb9cc053
Step9/11 : EXPOSE 8892
--->Running in b4d4410b5c74
Removingintermediate container b4d4410b5c74
--->e4ce66cdeb1f
Step10/11 : EXPOSE 7090
--->Running in 31e541a6134c
Removingintermediate container 31e541a6134c
--->f1081157a8f6
Step11/11 : ENTRYPOINT ["java","-javaagent:/opt/cloudquery/sjt_agent.jar","-Xdebug","-Xrunjdwp:transport=dt_socket,suspend=n,server=y,address=8892","-jar","cloudquery-message.jar","--spring.config.location=/opt/cloudquery/config/application.yml"]
--->Running in 86ae64218e85
Removingintermediate container 86ae64218e85
--->cecf9f36db5d
Successfullybuilt cecf9f36db5d
Successfullytagged message:cloudquery-club-V2.2.0
Sendingbuild context to Docker daemon 113MB
Step1/10 : FROM basejdkpython:8-jdk-slim-buster AS builder
--->ed637a4763c8
Step2/10 : MAINTAINER zhiyou "qipeng.lu@bintools.cn"
--->Using cache
--->6d449362ae74
Step3/10 : WORKDIR /opt/cloudquery
--->Using cache
--->d06ee0715f23
Step4/10 : ADD target/cloudquery-gateway*.jar ./cloudquery-gateway.jar
--->ba68324cc4d6
Step5/10 : RUN mkdir config
--->Running in 22222ec884d9
Removingintermediate container 22222ec884d9
--->845c80c3fa4f
Step6/10 : COPY target/classes/application-prod.yml ./config/application.yml
--->67d133819769
Step7/10 : ADD target/sjt_agent.jar ./sjt_agent.jar
--->f282c4b50759
Step8/10 : EXPOSE 8888
--->Running in e8e361bf6b84
Removingintermediate container e8e361bf6b84
--->ba7c8abbced9
Step9/10 : EXPOSE 8889
--->Running in 1ff9e0083d20
Removingintermediate container 1ff9e0083d20
--->67d08e686955
Step10/10 : ENTRYPOINT ["java","-javaagent:/opt/cloudquery/sjt_agent.jar","-Xdebug","-Xrunjdwp:transport=dt_socket,suspend=n,server=y,address=8889","-jar","cloudquery-gateway.jar","--spring.config.location=/opt/cloudquery/config/application.yml"]
--->Running in 0f468e451704
Removingintermediate container 0f468e451704
--->f7a9a73d3f9e
Successfullybuilt f7a9a73d3f9e
Successfullytagged gateway:cloudquery-club-V2.2.0
Sendingbuild context to Docker daemon 93.54MB
Step1/9 : FROM basejdkpython:8-jdk-slim-buster AS builder
--->ed637a4763c8
Step2/9 : MAINTAINER zhiyou "jian.huang@bintools.cn"
--->Using cache
--->d33533b24031
Step3/9 : WORKDIR /opt/cloudquery
--->Using cache
--->a36c7d68ab49
Step4/9 : ADD target/cloudquery-debug*.jar ./cloudquery-debug.jar
--->fa561413a862
Step5/9 : COPY target/classes/application.yml ./config/application.yml
--->2afd7b4f0352
Step6/9 : ADD target/sjt_agent.jar ./sjt_agent.jar
--->8c53b271460f
Step7/9 : EXPOSE 8899
--->Running in 7a0294d3dfd0
Removingintermediate container 7a0294d3dfd0
--->119203055625
Step8/9 : EXPOSE 8890
--->Running in 44d30edea545
Removingintermediate container 44d30edea545
--->d2a9cb49d292
Step9/9 : ENTRYPOINT ["java","-javaagent:/opt/cloudquery/sjt_agent.jar","-Xdebug","-Xrunjdwp:transport=dt_socket,suspend=n,server=y,address=8890","-jar","cloudquery-debug.jar","--spring.config.location=/opt/cloudquery/config/application.yml"]
--->Running in 54b5edfa62fc
Removingintermediate container 54b5edfa62fc
--->c9b39ecfb814
Successfullybuilt c9b39ecfb814
Successfullytagged debug:cloudquery-club-V2.2.0
unableto prepare context: path "./CloudQuery/audit-etl" not found
unableto prepare context: path "./CloudQuery/audit-display" not found
Sendingbuild context to Docker daemon 140.7MB
Step1/13 : FROM basejdkpython:8-jdk-slim-buster AS builder
--->ed637a4763c8
Step2/13 : MAINTAINER zhiyou "yaolei.chen@bintools.cn"
--->Running in 11ff1a1b1c67
Removingintermediate container 11ff1a1b1c67
--->e88f813b16df
Step3/13 : WORKDIR /opt/cloudquery
--->Running in 9f2a054b8c6e
Removingintermediate container 9f2a054b8c6e
--->599c6759f30b
Step4/13 : ADD target/cloudquery-analyze*.jar ./cloudquery-analyze.jar
--->f233c62166b2
Step5/13 : RUN mkdir config
--->Running in 9296f1ce7aec
Removingintermediate container 9296f1ce7aec
--->e4789694c8e5
Step6/13 : RUN mkdir script-path
--->Running in 1aff06afc22a
Removingintermediate container 1aff06afc22a
--->c4e8c16bc1c0
Step7/13 : COPY target/classes/application-prod.yml ./config/application.yml
--->45eb3f2c0acf
Step8/13 : COPY target/classes/sql.properties ./config/sql.properties
--->72abb64ac241
Step9/13 : COPY target/classes/spring-context.xml ./config/spring-context.xml
--->6ad9b295277a
Step10/13 : COPY target/classes/script-path ./script-path
--->9d638d4fed78
Step11/13 : ADD target/sjt_agent.jar ./sjt_agent.jar
--->36c2f83b8c95
Step12/13 : EXPOSE 9007
--->Running in b4b5d7c648e8
Removingintermediate container b4b5d7c648e8
--->9a5ee9b6be9d
Step13/13 : ENTRYPOINT ["java","-javaagent:/opt/cloudquery/sjt_agent.jar","-jar","cloudquery-analyze.jar","--spring.config.location=file:/opt/cloudquery/config/application.yml"]
--->Running in 7e5695e3dc82
Removingintermediate container 7e5695e3dc82
--->45be2be0d08b
Successfullybuilt 45be2be0d08b
Successfullytagged analyze:cloudquery-club-V2.2.0
43b3c4e3001c: Loading layer [==================================================>] 83.87MB/83.87MB
3a8f99f3bd90: Loading layer [==================================================>] 62.03MB/62.03MB
9f803fac20f7: Loading layer [==================================================>] 3.072kB/3.072kB
42e6e8955651: Loading layer [==================================================>] 4.096kB/4.096kB
35f05d5547f4: Loading layer [==================================================>] 3.584kB/3.584kB
e36a14968fa3: Loading layer [==================================================>] 7.168kB/7.168kB
b823f0fa5eab: Loading layer [==================================================>] 76.6MB/76.6MB
Loadedimage: base-web:cloudquery-club-V2.2.0
生成cloudquery运行目录
WARNING: bridge-nf-call-iptables is disabled
WARNING: bridge-nf-call-ip6tables is disabled
镜像加载完毕,正在启动...
WARNING: bridge-nf-call-iptables is disabled
WARNING: bridge-nf-call-ip6tables is disabled
Creatingnetwork "resource_cloudquerynet" with driver "bridge"
Creatingcloudquery-postgreSQL ... done
Creatingcloudquery-clickhouse ... done
Creatingcloudquery-redis ... done
Creatingcloudquery-zookeeper ... done
开始初始化postgreSQL数据...
正在初始化postgreSQL数据....
初始化postgreSQL数据完成...
Creatingcloudquery-desens ... done
cloudquery-desensis up-to-date
Creatingcloudquery-dms ... done
Creatingcloudquery-message ... done
Creatingcloudquery-gateway ... done
Creatingcloudquery-flow ... done
Creatingcloudquery-debug ... done
Creatingcloudquery-user ... done
Creatingcloudquery-analyze ... done
Creatingcloudquery-terminal ... done
Creatingcloudquery-export ... done
Creatingenterprise_web ... done
启动
可通过如下两种方式查看进程:
-- 通过docker命令查看
[root@xsky-node2 ~]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
68618d8a2b01 base-web:cloudquery-club-V2.2.0"/docker-entrypoint.…"56 minutes ago Up 56 minutes 80/tcp, 0.0.0.0:80->9898/tcp, 0.0.0.0:81->9999/tcp enterprise_web
3e4b39f8294b debug:cloudquery-club-V2.2.0"java -javaagent:/op…"56 minutes ago Up 56 minutes 8890/tcp, 8899/tcp cloudquery-debug
e8ee86fc4533 dms:cloudquery-club-V2.2.0"java -javaagent:/op…"56 minutes ago Up 56 minutes 9001/tcp, 9802/tcp cloudquery-dms
5f1b1c152b52 user:cloudquery-club-V2.2.0"java -javaagent:/op…"56 minutes ago Up 56 minutes 8002/tcp, 8802/tcp cloudquery-user
b3eff991fc2e desens:cloudquery-club-V2.2.0"java -javaagent:/op…"56 minutes ago Up 56 minutes 6202-6203/tcp cloudquery-desens
3a849cda4bb7 export:cloudquery-club-V2.2.0"java -javaagent:/op…"56 minutes ago Up 56 minutes 9001/tcp, 9803/tcp cloudquery-export
046eeb0f23a6 flow:cloudquery-club-V2.2.0"java -javaagent:/op…"56 minutes ago Up 56 minutes 9876-9877/tcp cloudquery-flow
20e33e8f123b gateway:cloudquery-club-V2.2.0"java -javaagent:/op…"56 minutes ago Up 56 minutes 8888-8889/tcp cloudquery-gateway
fefd276df63a base-terminal:latest "/opt/cloudquery/ter…"56 minutes ago Up 56 minutes 9950/tcp cloudquery-terminal
7366934b8802 analyze:cloudquery-club-V2.2.0"java -javaagent:/op…"56 minutes ago Up 56 minutes 9007/tcp cloudquery-analyze
4c396281a6a1 message:cloudquery-club-V2.2.0"java -javaagent:/op…"56 minutes ago Up 56 minutes 7090/tcp, 8892/tcp, 8899/tcp cloudquery-message
a3f3edd22d74 base-redis:5.0.0"docker-entrypoint.s…"2 hours ago Up 58 minutes 6379/tcp cloudquery-redis
dabcf1209ac1 base-zookeeper:3.6.2"/docker-entrypoint.…"2 hours ago Up 58 minutes 2888/tcp, 3888/tcp, 0.0.0.0:2181->2181/tcp, 8080/tcp cloudquery-zookeeper
20639899b5a0 clickhouse/clickhouse-server:23.3.2.37"/entrypoint.sh"2 hours ago Up 58 minutes 9000/tcp, 0.0.0.0:8123->8123/tcp, 9009/tcp cloudquery-clickhouse
bcc95d1519df postgres:11.8"docker-entrypoint.s…"2 hours ago Up 58 minutes 0.0.0.0:5432->5432/tcp cloudquery-postgreSQL
[root@xsky-node2 ~]#
[root@xsky-node2 ~]# docker container ls
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
68618d8a2b01 base-web:cloudquery-club-V2.2.0"/docker-entrypoint.…"56 minutes ago Up 56 minutes 80/tcp, 0.0.0.0:80->9898/tcp, 0.0.0.0:81->9999/tcp enterprise_web
3e4b39f8294b debug:cloudquery-club-V2.2.0"java -javaagent:/op…"56 minutes ago Up 56 minutes 8890/tcp, 8899/tcp cloudquery-debug
e8ee86fc4533 dms:cloudquery-club-V2.2.0"java -javaagent:/op…"56 minutes ago Up 56 minutes 9001/tcp, 9802/tcp cloudquery-dms
5f1b1c152b52 user:cloudquery-club-V2.2.0"java -javaagent:/op…"56 minutes ago Up 56 minutes 8002/tcp, 8802/tcp cloudquery-user
b3eff991fc2e desens:cloudquery-club-V2.2.0"java -javaagent:/op…"56 minutes ago Up 56 minutes 6202-6203/tcp cloudquery-desens
3a849cda4bb7 export:cloudquery-club-V2.2.0"java -javaagent:/op…"56 minutes ago Up 56 minutes 9001/tcp, 9803/tcp cloudquery-export
046eeb0f23a6 flow:cloudquery-club-V2.2.0"java -javaagent:/op…"56 minutes ago Up 56 minutes 9876-9877/tcp cloudquery-flow
20e33e8f123b gateway:cloudquery-club-V2.2.0"java -javaagent:/op…"56 minutes ago Up 56 minutes 8888-8889/tcp cloudquery-gateway
fefd276df63a base-terminal:latest "/opt/cloudquery/ter…"56 minutes ago Up 56 minutes 9950/tcp cloudquery-terminal
7366934b8802 analyze:cloudquery-club-V2.2.0"java -javaagent:/op…"56 minutes ago Up 56 minutes 9007/tcp cloudquery-analyze
4c396281a6a1 message:cloudquery-club-V2.2.0"java -javaagent:/op…"56 minutes ago Up 56 minutes 7090/tcp, 8892/tcp, 8899/tcp cloudquery-message
a3f3edd22d74 base-redis:5.0.0"docker-entrypoint.s…"2 hours ago Up 58 minutes 6379/tcp cloudquery-redis
dabcf1209ac1 base-zookeeper:3.6.2"/docker-entrypoint.…"2 hours ago Up 58 minutes 2888/tcp, 3888/tcp, 0.0.0.0:2181->2181/tcp, 8080/tcp cloudquery-zookeeper
20639899b5a0 clickhouse/clickhouse-server:23.3.2.37"/entrypoint.sh"2 hours ago Up 58 minutes 9000/tcp, 0.0.0.0:8123->8123/tcp, 9009/tcp cloudquery-clickhouse
bcc95d1519df postgres:11.8 "docker-entrypoint.s…" 2 hours ago Up 58 minutes 0.0.0.0:5432->5432/tcp cloudquery-postgreSQL
还可以使用 cloudquery.sh 脚本来查看,如下所示:
-- root用户
[root@xsky-node2 ~]# cd /cloudquery/
[root@xsky-node2 cloudquery]# ./cloudquery.sh status
Name Command State Ports
---------------------------------------------------------------------------------------------------------------------
cloudquery-clickhouse /entrypoint.sh Up 0.0.0.0:8123->8123/tcp, 9000/tcp, 9009/tcp
cloudquery-postgreSQL docker-entrypoint.sh postgres Up 0.0.0.0:5432->5432/tcp
cloudquery-redis docker-entrypoint.sh redis ... Up 6379/tcp
cloudquery-zookeeper /docker-entrypoint.sh zkSe ... Up 0.0.0.0:2181->2181/tcp, 2888/tcp, 3888/tcp, 8080/tcp
Name Command State Ports
-------------------------------------------------------------------------------------------
cloudquery-analyze java -javaagent:/opt/cloud ... Up 9007/tcp
cloudquery-debug java -javaagent:/opt/cloud ... Up 8890/tcp, 8899/tcp
cloudquery-desens java -javaagent:/opt/cloud ... Up 6202/tcp, 6203/tcp
cloudquery-dms java -javaagent:/opt/cloud ... Up 9001/tcp, 9802/tcp
cloudquery-export java -javaagent:/opt/cloud ... Up 9001/tcp, 9803/tcp
cloudquery-flow java -javaagent:/opt/cloud ... Up 9876/tcp, 9877/tcp
cloudquery-gateway java -javaagent:/opt/cloud ... Up 8888/tcp, 8889/tcp
cloudquery-message java -javaagent:/opt/cloud ... Up 7090/tcp, 8892/tcp, 8899/tcp
cloudquery-terminal /opt/cloudquery/terminal - ... Up 9950/tcp
cloudquery-user java -javaagent:/opt/cloud ... Up 8002/tcp, 8802/tcp
Name Command State Ports
------------------------------------------------------------------------------------------------------------
enterprise_web /docker-entrypoint.sh ngin ... Up 80/tcp, 0.0.0.0:80->9898/tcp, 0.0.0.0:81->9999/tcp
状态
可以使用如下方式启停 CloudQuery:
-- root用户
[root@xsky-node2 cloudquery]
Stopping enterprise_web ... done
Removing enterprise_web ... done
Network resource_cloudquerynet is external, skipping
Stopping cloudquery-terminal ... done
Stopping cloudquery-export ... done
Stopping cloudquery-analyze ... done
Stopping cloudquery-user ... done
Stopping cloudquery-message ... done
Stopping cloudquery-debug ... done
Stopping cloudquery-flow ... done
Stopping cloudquery-gateway ... done
Stopping cloudquery-dms ... done
Stopping cloudquery-desens ... done
Removing cloudquery-terminal ... done
Removing cloudquery-export ... done
Removing cloudquery-analyze ... done
Removing cloudquery-user ... done
Removing cloudquery-message ... done
Removing cloudquery-debug ... done
Removing cloudquery-flow ... done
Removing cloudquery-gateway ... done
Removing cloudquery-dms ... done
Removing cloudquery-desens ... done
Network resource_cloudquerynet is external, skipping
停止除resource之外的服务
[root@xsky-node2 cloudquery]
[root@xsky-node2 cloudquery]
cloudquery-clickhouse is up-to-date
cloudquery-zookeeper is up-to-date
cloudquery-postgreSQL is up-to-date
cloudquery-redis is up-to-date
等待postgreSQL数据库启动...
postgreSQL数据库启动完成...
Creating cloudquery-message ... done
Creating cloudquery-analyze ... done
Creating cloudquery-flow ... done
Creating cloudquery-export ... done
Creating cloudquery-gateway ... done
Creating cloudquery-dms ... done
Creating cloudquery-terminal ... done
Creating cloudquery-debug ... done
Creating cloudquery-desens ... done
Creating cloudquery-user ... done
Creating enterprise_web ... done
启动
可以通过如下方法来查看应用相关日志:
[root@xsky-node2 ~]# docker logs -f --tail 200 cloudquery-dms
CloudQuery 安装部署后,默认使用80端口,可通过http://IP:端口(默认 80)进行页面登录。
使用如下默认账号和密码登录控制台。
默认帐号: admin001
默认密码: Hello123$
登录后的控制台主界面如下:
安装部署过程中,可能会遇到如下问题:
我初次安装时其中一台服务器出现了如下报错。
ERROR: for redis Cannot start service redis: driver failed programming external connectivity on endpoint cloudquery-redis (c9d193b21566f6174e7328a8b214b37e0df0e86088f9057f1aab441aa0f5ab17): Errorstarting userland proxy: listen tcp 0.0.0.0:6379: bind: address already inuse
ERROR: Encountered errors while bringing up the project.
CloudQuery 内部通讯需要使用 Redis,如果已安装了 Redis,会因端口导致冲突,为此,可通过如下方式进行调整:
然后通过:cloudquery.sh stop/start 启停服务。
如果安装 CloudQuery 的服务器已安装了 Docker,但版本过低,会导致安装失败,如下所所示。
[root@xsky-node2 cloudquery-club-V2.2.0]
请输入cloudQuery安装绝对路径(默认为/opt/cloudquery):
/opt/cloudquery
setenforce: SELinux is disabled
输入路径为无效文件夹,使用默认路径:/opt/cloudquery
docker 已安装
docker版本小于19,无法运行cloudQuery。请安装新版本docker与docker-compose。
[root@xsky-node2 cloudquery-club-V2.2.0]
Docker version 18.09.9, build 039a7df9ba
安装新版CloudQuery V2 要求Docker 版本不能低于 19.03.12,如果服务器未安装Docker,安装CloudQuery后安装的Docker版本是19.03.12。
此时可有两种解决办法:
一是升级 Docker 版本,二是完全卸载当前 Docker,使用软件自动安装的 Docker。
如果服务器安装了 Docker,且版本不低于 CloudQuery 要求的版本,但未安装 docker-compose,也会导致安装失败。
此时可以采用完全卸载服务器上的 Docker,或者单独安装 docker-compose 至合适版本,然后重新执行 deploy.sh 进行软件安装。
有时会遇到软件安装后,进程也都正常,但使用http://IP:端口 却无法访问:
此时通过 netstat -ano|grep 80 看到 80 端口未被监听。
通过 telnet IP:80 也无法登录。
此时可通过如下方法解决:
1) 编辑 /etc/sysconfig/network 文件
修改 NETWORKING_IPV6=no
2) 编辑 /etc/default/grub 文件, 在GRUB_CMDLINE_LINUX=“添加ipv6.disable=1 后面保存不变”,如下所示:
[root@xsky-node2 ~]
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="ipv6.disable=1 crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet transparent_hugepage=never"
GRUB_DISABLE_RECOVERY="true"
3) 重启网卡和服务器
service network restart
shutdown -r 0
如上操作后,正常情况可打开控制台页面。
文章待续......本周持续更新《我和 CQ 的故事(中)CloudQuery 数据连接查询使用》
作者墨天轮博客 ID :尚雷