The English version of CloudQuery is officially launched!

初次安装 CloudQuery ,看这篇就够啦!

 二维码
发表时间:2023-08-29 10:09作者:尚雷

图片


前言:8 月 17 日,CloudQuery 社区第一期征文活动正式对外发布。小编也陆续收到了很多用户的投稿,再次感谢大家对 CQ 的支持。本文来自社区用户 ID:尚雷的分享,下面就来看看他的 CQ 初体验吧,希望能对初次接触 CQ 的你有所帮助。



前言

在日常数据库运维中,为连接多种数据库,经常要安装不同的客户端,非常繁琐,且占用大量存储空间。如果能有一种工具,可以不用在自己电脑上安装,而且能够同时连接多种数据库该多好。


恰好有一天,我看到一朋友在朋友圈发了一条朋友圈信息,说 CloudQuery 在进行有奖征文。最近我不是刚参加完 OpenGauss 有奖征文吗,趁热打铁,看看这东西是什么,写写文章,看看能否得奖图片


于是点开了她发的朋友圈链接,里面只是描述文章征文的内容,并没有讲过多东西,没有讲解 CloudQuery 是干什么的,能做哪些事情,觉得好像也没啥啊,就有点失望了,正好也有事,就没再继续多看下去。过了两天,正好无事,于是又打开了那链接,关注了公众号,登录下官网。我去,这才了解到了 CloudQuery 的一些知识,没想到这 CloudQuery 这么强大,竟然可以连接好多数据库,而且还有审计、提工单等作用。


图片



于是,我决定好好使用了解下。
千里之行始于足下,先安装下试试,let’s go.


本篇主要讲述如何安装部署 CloudQuery 及相关注意事项,因为篇幅,下一篇将讲述如何使用 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 目录下。



安装 CloudQuery

安装 CloudQuery

使用 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 directorysetenforce: SELinux is disabled输入路径为无效文件夹,使用默认路径:/opt/cloudquery开始安装docker与docker-composesetenforce: SELinux is disabledCreatedsymlink 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-busterLoadedimage: base-redis:5.0.0Loadedimage: base-terminal:latestcb42413394c4: Loading layer [==================================================>]   72.51MB/72.51MB1c44f9d6c008: Loading layer [==================================================>]   9.079MB/9.079MBc9c81fb767cc: Loading layer [==================================================>]   3.584kB/3.584kBe339e3812d99: Loading layer [==================================================>]   127.2MB/127.2MB741b957481de: Loading layer [==================================================>]   340.5kB/340.5kB6db8ffdd7458: Loading layer [==================================================>]   12.49MB/12.49MB3da4783ff617: Loading layer [==================================================>]   36.54MB/36.54MB1b56d8f0f28d: Loading layer [==================================================>]   3.072kB/3.072kBLoadedimage: base-zookeeper:3.6.2b93c1bd012ab: Loading layer [==================================================>]   80.33MB/80.33MB680d4ad25629: Loading layer [==================================================>]   80.66MB/80.66MB7f7e8ccae681: Loading layer [==================================================>]   759.9MB/759.9MB5f9f0ed99f1d: Loading layer [==================================================>]   578.6kB/578.6kB06b4d412e3fe: Loading layer [==================================================>]   3.063MB/3.063MB7e7548a12c69: Loading layer [==================================================>]   1.536kB/1.536kB615b033a1040: Loading layer [==================================================>]   3.584kB/3.584kBdd007340d02c: Loading layer [==================================================>]   9.728kB/9.728kB5f70bf18a086: Loading layer [==================================================>]   1.024kB/1.024kBLoadedimage: clickhouse/clickhouse-server:23.3.2.37e8cf91efbcb0: Loading layer [==================================================>]   58.49MB/58.49MB00f438525221: Loading layer [==================================================>]   10.44MB/10.44MB53225373e343: Loading layer [==================================================>]   339.5kB/339.5kB4d5f0af8bd5c: Loading layer [==================================================>]   4.174MB/4.174MB7599efc97cb6: Loading layer [==================================================>]   17.1MB/17.1MBf7ee3866e7fe: Loading layer [==================================================>]   1.425MB/1.425MB717ce2a08388: Loading layer [==================================================>]   1.536kB/1.536kBcdaa32d2ec3d: Loading layer [==================================================>]   9.216kB/9.216kB535acdbb15a8: Loading layer [==================================================>]   197.7MB/197.7MB919e5a1fcb6c: Loading layer [==================================================>]   56.32kB/56.32kB52c5b1e57bcd: Loading layer [==================================================>]   2.048kB/2.048kB72434b8f5e29: Loading layer [==================================================>]   3.072kB/3.072kBf88c039d7fc6: Loading layer [==================================================>]   14.34kB/14.34kB73321121ac16: Loading layer [==================================================>]   1.536kB/1.536kBLoadedimage: postgres:11.8开始加载业务镜像Sendingbuild context to Docker daemon   144.1MBStep1/11 : FROM basejdkpython:8-jdk-slim-buster AS builder--->ed637a4763c8Step2/11 : MAINTAINER zhiyou "jian.huang@bintools.cn"--->Running in a26680e23237Removingintermediate container a26680e23237--->d33533b24031Step3/11 : WORKDIR /opt/cloudquery--->Running in 9f43335e0f92Removingintermediate container 9f43335e0f92--->a36c7d68ab49Step4/11 : ADD target/cloudquery-user*.jar   ./cloudquery-user.jar--->7ce80605ccccStep5/11 : RUN mkdir config && mkdir -p /opt/cloudquery/dmc/modules && mkdir -p /opt/cloudquery/dmc/dms_home--->Running in e1c7dc094ef6Removingintermediate container e1c7dc094ef6--->2fb90af3cc3aStep6/11 : ADD ignore/dmc/modules /opt/cloudquery/dmc/modules--->64f5755ab83eStep7/11 : COPY target/classes/application-prod.yml ./config/application.yml--->024bbe6c6901Step8/11 : ADD target/sjt_agent.jar ./sjt_agent.jar--->a04332697017Step9/11 : EXPOSE 8002--->Running in fb0652633b36Removingintermediate container fb0652633b36--->b5acf1ea6ecbStep10/11 : EXPOSE 8802--->Running in bd5d1c34d64bRemovingintermediate container bd5d1c34d64b--->c4b7fa6fc7e4Step11/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 d51313e590d3Removingintermediate container d51313e590d3--->bf2a930020f5Successfullybuilt bf2a930020f5Successfullytagged user:cloudquery-club-V2.2.0Sendingbuild context to Docker daemon    161MBStep1/11 : FROM basejdkpython:8-jdk-slim-buster AS builder--->ed637a4763c8Step2/11 : MAINTAINER lianjun "lianjun@bintools.cn"--->Running in 23fb56316bbfRemovingintermediate container 23fb56316bbf--->aa9481f7b501Step3/11 : WORKDIR /opt/cloudquery--->Running in 1de42dc9c07dRemovingintermediate container 1de42dc9c07d--->b7dd7ddcd9a3Step4/11 : RUN mkdir -p /opt/cloudquery/dmc/modules && mkdir -p /opt/cloudquery/dmc/dms_home && mkdir config--->Running in 9e3e6b4156ceRemovingintermediate container 9e3e6b4156ce--->8afc18cc3e3bStep5/11 : ADD ignore/dmc/modules /opt/cloudquery/dmc/modules--->3f534f93c81fStep6/11 : ADD target/cloudquery-data-dict*.jar   ./cloudquery-data-dict.jar--->7396e1a1ee6dStep7/11 : COPY target/classes/application-prod.yml ./config/application.yml--->2b94014373beStep8/11 : ADD target/sjt_agent.jar ./sjt_agent.jar--->cbcc86c8943dStep9/11 : EXPOSE 9191--->Running in 33b7abe5fc19Removingintermediate container 33b7abe5fc19--->e90d22adf102Step10/11 : EXPOSE 9100--->Running in 0d4e999a0d06Removingintermediate container 0d4e999a0d06--->ff61a94e587bStep11/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 47f3b9409cf4Removingintermediate container 47f3b9409cf4--->335f5fae4f74Successfullybuilt 335f5fae4f74Successfullytagged data-dict:cloudquery-club-V2.2.0Sendingbuild context to Docker daemon   158.3MBStep1/11 : FROM basejdkpython:8-jdk-slim-buster AS builder--->ed637a4763c8Step2/11 : MAINTAINER zhiyou "jian.huang@bintools.cn"--->Using cache--->d33533b24031Step3/11 : WORKDIR /opt/cloudquery--->Using cache--->a36c7d68ab49Step4/11 : RUN mkdir -p /opt/cloudquery/dmc/modules && mkdir -p /opt/cloudquery/dmc/dms_home && mkdir config--->Running in 17d4c5f7be69Removingintermediate container 17d4c5f7be69--->f9414ee93a6dStep5/11 : ADD ignore/dmc/modules /opt/cloudquery/dmc/modules--->931aea6894d9Step6/11 : ADD target/cloudquery-desens*.jar   ./cloudquery-desens.jar--->ca1bb6fd3e6dStep7/11 : COPY target/classes/application-prod.yml ./config/application.yml--->866c73123d19Step8/11 : ADD target/sjt_agent.jar ./sjt_agent.jar--->f63712fb10e2Step9/11 : EXPOSE 6202--->Running in defa7e77cf08Removingintermediate container defa7e77cf08--->10386a8c7eaeStep10/11 : EXPOSE 6203--->Running in 1d72029d8df3Removingintermediate container 1d72029d8df3--->0b9517a32a3bStep11/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 a50584fed44fRemovingintermediate container a50584fed44f--->0c6285c465efSuccessfullybuilt 0c6285c465efSuccessfullytagged desens:cloudquery-club-V2.2.0Sendingbuild context to Docker daemon    528MBStep1/12 : FROM basejdkpython:8-jdk-slim-buster AS builder--->ed637a4763c8Step2/12 : MAINTAINER zhiyou "jian.huang@bintools.cn"--->Using cache--->d33533b24031Step3/12 : WORKDIR /opt/cloudquery--->Using cache--->a36c7d68ab49Step4/12 : RUN mkdir -p /opt/cloudquery/dmc/modules && mkdir -p /opt/cloudquery/dmc/dms_home && mkdir config--->Using cache--->f9414ee93a6dStep5/12 : ADD ignore/dmc/modules /opt/cloudquery/dmc/modules--->b6145b227132Step6/12 : ADD src/main/resources/DataSourceStatement.stg /opt/cloudquery/dmc/modules--->e9ac4c90a5f1Step7/12 : ADD target/cloudquery-dms.jar   ./cloudquery-dms.jar--->b591a32bcb13Step8/12 : ADD target/sjt_agent.jar ./sjt_agent.jar--->ddac7fdd18ecStep9/12 : COPY target/classes/application-prod.yml ./config/application.yml--->83aa3f9a2058Step10/12 : EXPOSE 9001--->Running in 601925e4e89dRemovingintermediate container 601925e4e89d--->4f692cd59da7Step11/12 : EXPOSE 9802--->Running in 2a3eee066264Removingintermediate container 2a3eee066264--->db45a370b3c3Step12/12 : ENTRYPOINT ["java","-javaagent:/opt/cloudquery/sjt_agent.jar","-jar","cloudquery-dms.jar","--spring.config.location=/opt/cloudquery/config/application.yml"]--->Running in a1cdfe8593f1Removingintermediate container a1cdfe8593f1--->10490b0fb46dSuccessfullybuilt 10490b0fb46dSuccessfullytagged dms:cloudquery-club-V2.2.0Sendingbuild context to Docker daemon   386.1MBStep1/11 : FROM basejdkpython:8-jdk-slim-buster AS builder--->ed637a4763c8Step2/11 : MAINTAINER zhiyou "jian.huang@bintools.cn"--->Using cache--->d33533b24031Step3/11 : WORKDIR /opt/cloudquery--->Using cache--->a36c7d68ab49Step4/11 : RUN mkdir -p /opt/cloudquery/dmc/modules && mkdir -p /opt/cloudquery/dmc/dms_home && mkdir config--->Using cache--->f9414ee93a6dStep5/11 : ADD ignore/dmc/modules /opt/cloudquery/dmc/modules--->c546352c13efStep6/11 : ADD target/cloudquery-export*.jar   ./cloudquery-export.jar--->619df2c5cfe8Step7/11 : COPY target/classes/application-prod.yml ./config/application.yml--->a08981a20c41Step8/11 : ADD target/sjt_agent.jar ./sjt_agent.jar--->2cf3b93bad45Step9/11 : EXPOSE 9001--->Running in d66a72bc0bc8Removingintermediate container d66a72bc0bc8--->dbd312de5ef8Step10/11 : EXPOSE 9803--->Running in d48a09fc5521Removingintermediate container d48a09fc5521--->7db16d4b5a28Step11/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 5d55134339fcRemovingintermediate container 5d55134339fc--->6a7df0842d60Successfullybuilt 6a7df0842d60Successfullytagged export:cloudquery-club-V2.2.0Sendingbuild context to Docker daemon   121.8MBStep1/10 : FROM basejdkpython:8-jdk-slim-buster AS builder--->ed637a4763c8Step2/10 : MAINTAINER zhiyou "qipeng.lu@bintools.cn"--->Running in 7d682f308838Removingintermediate container 7d682f308838--->6d449362ae74Step3/10 : WORKDIR /opt/cloudquery--->Running in 340ab95b7dd5Removingintermediate container 340ab95b7dd5--->d06ee0715f23Step4/10 : ADD target/cloudquery-flow*.jar   ./cloudquery-flow.jar--->f950a7a25d5fStep5/10 : RUN mkdir config--->Running in d640caa4c469Removingintermediate container d640caa4c469--->bac2e203c398Step6/10 : COPY target/classes/application-prod.yml ./config/application.yml--->67537c5abd07Step7/10 : ADD target/sjt_agent.jar ./sjt_agent.jar--->7a09048f8ee5Step8/10 : EXPOSE 9876--->Running in cc25a20eca44Removingintermediate container cc25a20eca44--->09e54c1ba1d7Step9/10 : EXPOSE 9877--->Running in 738d017bd0e2Removingintermediate container 738d017bd0e2--->aca0e0a98d68Step10/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 61bf43525a06Removingintermediate container 61bf43525a06--->7c4d91244fe7Successfullybuilt 7c4d91244fe7Successfullytagged flow:cloudquery-club-V2.2.0Sendingbuild context to Docker daemon   116.1MBStep1/11 : FROM basejdkpython:8-jdk-slim-buster AS builder--->ed637a4763c8Step2/11 : MAINTAINER zhiyou "jian.huang@bintools.cn"--->Using cache--->d33533b24031Step3/11 : WORKDIR /opt/cloudquery--->Using cache--->a36c7d68ab49Step4/11 : ADD target/cloudquery-message*.jar   ./cloudquery-message.jar--->26170fd14fa8Step5/11 : RUN mkdir config--->Running in 3a8c7b9a2443Removingintermediate container 3a8c7b9a2443--->71c56c427e27Step6/11 : COPY target/classes/application-prod.yml ./config/application.yml--->c9b4916ea0ccStep7/11 : ADD target/sjt_agent.jar ./sjt_agent.jar--->39529834997eStep8/11 : EXPOSE 8899--->Running in 2cef156e6fa7Removingintermediate container 2cef156e6fa7--->61afeb9cc053Step9/11 : EXPOSE 8892--->Running in b4d4410b5c74Removingintermediate container b4d4410b5c74--->e4ce66cdeb1fStep10/11 : EXPOSE 7090--->Running in 31e541a6134cRemovingintermediate container 31e541a6134c--->f1081157a8f6Step11/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 86ae64218e85Removingintermediate container 86ae64218e85--->cecf9f36db5dSuccessfullybuilt cecf9f36db5dSuccessfullytagged message:cloudquery-club-V2.2.0Sendingbuild context to Docker daemon    113MBStep1/10 : FROM basejdkpython:8-jdk-slim-buster AS builder--->ed637a4763c8Step2/10 : MAINTAINER zhiyou "qipeng.lu@bintools.cn"--->Using cache--->6d449362ae74Step3/10 : WORKDIR /opt/cloudquery--->Using cache--->d06ee0715f23Step4/10 : ADD target/cloudquery-gateway*.jar   ./cloudquery-gateway.jar--->ba68324cc4d6Step5/10 : RUN mkdir config--->Running in 22222ec884d9Removingintermediate container 22222ec884d9--->845c80c3fa4fStep6/10 : COPY target/classes/application-prod.yml ./config/application.yml--->67d133819769Step7/10 : ADD target/sjt_agent.jar ./sjt_agent.jar--->f282c4b50759Step8/10 : EXPOSE 8888--->Running in e8e361bf6b84Removingintermediate container e8e361bf6b84--->ba7c8abbced9Step9/10 : EXPOSE 8889--->Running in 1ff9e0083d20Removingintermediate container 1ff9e0083d20--->67d08e686955Step10/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 0f468e451704Removingintermediate container 0f468e451704--->f7a9a73d3f9eSuccessfullybuilt f7a9a73d3f9eSuccessfullytagged gateway:cloudquery-club-V2.2.0Sendingbuild context to Docker daemon   93.54MBStep1/9 : FROM basejdkpython:8-jdk-slim-buster AS builder--->ed637a4763c8Step2/9 : MAINTAINER zhiyou "jian.huang@bintools.cn"--->Using cache--->d33533b24031Step3/9 : WORKDIR /opt/cloudquery--->Using cache--->a36c7d68ab49Step4/9 : ADD target/cloudquery-debug*.jar   ./cloudquery-debug.jar--->fa561413a862Step5/9 : COPY target/classes/application.yml ./config/application.yml--->2afd7b4f0352Step6/9 : ADD target/sjt_agent.jar ./sjt_agent.jar--->8c53b271460fStep7/9 : EXPOSE 8899--->Running in 7a0294d3dfd0Removingintermediate container 7a0294d3dfd0--->119203055625Step8/9 : EXPOSE 8890--->Running in 44d30edea545Removingintermediate container 44d30edea545--->d2a9cb49d292Step9/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 54b5edfa62fcRemovingintermediate container 54b5edfa62fc--->c9b39ecfb814Successfullybuilt c9b39ecfb814Successfullytagged debug:cloudquery-club-V2.2.0unableto prepare context: path "./CloudQuery/audit-etl" not foundunableto prepare context: path "./CloudQuery/audit-display" not foundSendingbuild context to Docker daemon   140.7MBStep1/13 : FROM basejdkpython:8-jdk-slim-buster AS builder--->ed637a4763c8Step2/13 : MAINTAINER zhiyou "yaolei.chen@bintools.cn"--->Running in 11ff1a1b1c67Removingintermediate container 11ff1a1b1c67--->e88f813b16dfStep3/13 : WORKDIR /opt/cloudquery--->Running in 9f2a054b8c6eRemovingintermediate container 9f2a054b8c6e--->599c6759f30bStep4/13 : ADD target/cloudquery-analyze*.jar   ./cloudquery-analyze.jar--->f233c62166b2Step5/13 : RUN mkdir config--->Running in 9296f1ce7aecRemovingintermediate container 9296f1ce7aec--->e4789694c8e5Step6/13 : RUN mkdir script-path--->Running in 1aff06afc22aRemovingintermediate container 1aff06afc22a--->c4e8c16bc1c0Step7/13 : COPY target/classes/application-prod.yml ./config/application.yml--->45eb3f2c0acfStep8/13 : COPY target/classes/sql.properties ./config/sql.properties--->72abb64ac241Step9/13 : COPY target/classes/spring-context.xml ./config/spring-context.xml--->6ad9b295277aStep10/13 : COPY target/classes/script-path ./script-path--->9d638d4fed78Step11/13 : ADD target/sjt_agent.jar ./sjt_agent.jar--->36c2f83b8c95Step12/13 : EXPOSE 9007--->Running in b4b5d7c648e8Removingintermediate container b4b5d7c648e8--->9a5ee9b6be9dStep13/13 : ENTRYPOINT ["java","-javaagent:/opt/cloudquery/sjt_agent.jar","-jar","cloudquery-analyze.jar","--spring.config.location=file:/opt/cloudquery/config/application.yml"]--->Running in 7e5695e3dc82Removingintermediate container 7e5695e3dc82--->45be2be0d08bSuccessfullybuilt 45be2be0d08bSuccessfullytagged analyze:cloudquery-club-V2.2.043b3c4e3001c: Loading layer [==================================================>]   83.87MB/83.87MB3a8f99f3bd90: Loading layer [==================================================>]   62.03MB/62.03MB9f803fac20f7: Loading layer [==================================================>]   3.072kB/3.072kB42e6e8955651: Loading layer [==================================================>]   4.096kB/4.096kB35f05d5547f4: Loading layer [==================================================>]   3.584kB/3.584kBe36a14968fa3: Loading layer [==================================================>]   7.168kB/7.168kBb823f0fa5eab: Loading layer [==================================================>]   76.6MB/76.6MBLoadedimage: base-web:cloudquery-club-V2.2.0生成cloudquery运行目录WARNING: bridge-nf-call-iptables is disabledWARNING: bridge-nf-call-ip6tables is disabled镜像加载完毕,正在启动...WARNING: bridge-nf-call-iptables is disabledWARNING: bridge-nf-call-ip6tables is disabledCreatingnetwork "resource_cloudquerynet" with driver "bridge"Creatingcloudquery-postgreSQL ... doneCreatingcloudquery-clickhouse ... doneCreatingcloudquery-redis      ... doneCreatingcloudquery-zookeeper   ... done开始初始化postgreSQL数据...正在初始化postgreSQL数据....初始化postgreSQL数据完成...Creatingcloudquery-desens ... donecloudquery-desensis up-to-dateCreatingcloudquery-dms      ... doneCreatingcloudquery-message   ... doneCreatingcloudquery-gateway   ... doneCreatingcloudquery-flow     ... doneCreatingcloudquery-debug    ... doneCreatingcloudquery-user     ... doneCreatingcloudquery-analyze   ... doneCreatingcloudquery-terminal ... doneCreatingcloudquery-export   ... doneCreatingenterprise_web ... done启动


查看进程

可通过如下两种方式查看进程:






































-- 通过docker命令查看[root@xsky-node2 ~]# docker ps -aCONTAINER ID        IMAGE                                    COMMAND                  CREATED             STATUS              PORTS                                                  NAMES68618d8a2b01        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_web3e4b39f8294b        debug:cloudquery-club-V2.2.0"java -javaagent:/op…"56 minutes ago      Up 56 minutes       8890/tcp, 8899/tcp                                     cloudquery-debuge8ee86fc4533        dms:cloudquery-club-V2.2.0"java -javaagent:/op…"56 minutes ago      Up 56 minutes       9001/tcp, 9802/tcp                                     cloudquery-dms5f1b1c152b52        user:cloudquery-club-V2.2.0"java -javaagent:/op…"56 minutes ago      Up 56 minutes       8002/tcp, 8802/tcp                                     cloudquery-userb3eff991fc2e        desens:cloudquery-club-V2.2.0"java -javaagent:/op…"56 minutes ago      Up 56 minutes       6202-6203/tcp                                          cloudquery-desens3a849cda4bb7        export:cloudquery-club-V2.2.0"java -javaagent:/op…"56 minutes ago      Up 56 minutes       9001/tcp, 9803/tcp                                     cloudquery-export046eeb0f23a6        flow:cloudquery-club-V2.2.0"java -javaagent:/op…"56 minutes ago      Up 56 minutes       9876-9877/tcp                                          cloudquery-flow20e33e8f123b        gateway:cloudquery-club-V2.2.0"java -javaagent:/op…"56 minutes ago      Up 56 minutes       8888-8889/tcp                                          cloudquery-gatewayfefd276df63a        base-terminal:latest                     "/opt/cloudquery/ter…"56 minutes ago      Up 56 minutes       9950/tcp                                               cloudquery-terminal7366934b8802        analyze:cloudquery-club-V2.2.0"java -javaagent:/op…"56 minutes ago      Up 56 minutes       9007/tcp                                               cloudquery-analyze4c396281a6a1        message:cloudquery-club-V2.2.0"java -javaagent:/op…"56 minutes ago      Up 56 minutes       7090/tcp, 8892/tcp, 8899/tcp                           cloudquery-messagea3f3edd22d74        base-redis:5.0.0"docker-entrypoint.s…"2 hours ago         Up 58 minutes       6379/tcp                                               cloudquery-redisdabcf1209ac1        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-zookeeper20639899b5a0        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-clickhousebcc95d1519df        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 lsCONTAINER ID        IMAGE                                    COMMAND                  CREATED             STATUS              PORTS                                                  NAMES68618d8a2b01        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_web3e4b39f8294b        debug:cloudquery-club-V2.2.0"java -javaagent:/op…"56 minutes ago      Up 56 minutes       8890/tcp, 8899/tcp                                     cloudquery-debuge8ee86fc4533        dms:cloudquery-club-V2.2.0"java -javaagent:/op…"56 minutes ago      Up 56 minutes       9001/tcp, 9802/tcp                                     cloudquery-dms5f1b1c152b52        user:cloudquery-club-V2.2.0"java -javaagent:/op…"56 minutes ago      Up 56 minutes       8002/tcp, 8802/tcp                                     cloudquery-userb3eff991fc2e        desens:cloudquery-club-V2.2.0"java -javaagent:/op…"56 minutes ago      Up 56 minutes       6202-6203/tcp                                          cloudquery-desens3a849cda4bb7        export:cloudquery-club-V2.2.0"java -javaagent:/op…"56 minutes ago      Up 56 minutes       9001/tcp, 9803/tcp                                     cloudquery-export046eeb0f23a6        flow:cloudquery-club-V2.2.0"java -javaagent:/op…"56 minutes ago      Up 56 minutes       9876-9877/tcp                                          cloudquery-flow20e33e8f123b        gateway:cloudquery-club-V2.2.0"java -javaagent:/op…"56 minutes ago      Up 56 minutes       8888-8889/tcp                                          cloudquery-gatewayfefd276df63a        base-terminal:latest                     "/opt/cloudquery/ter…"56 minutes ago      Up 56 minutes       9950/tcp                                               cloudquery-terminal7366934b8802        analyze:cloudquery-club-V2.2.0"java -javaagent:/op…"56 minutes ago      Up 56 minutes       9007/tcp                                               cloudquery-analyze4c396281a6a1        message:cloudquery-club-V2.2.0"java -javaagent:/op…"56 minutes ago      Up 56 minutes       7090/tcp, 8892/tcp, 8899/tcp                           cloudquery-messagea3f3edd22d74        base-redis:5.0.0"docker-entrypoint.s…"2 hours ago         Up 58 minutes       6379/tcp                                               cloudquery-redisdabcf1209ac1        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-zookeeper20639899b5a0        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-clickhousebcc95d1519df        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/tcpcloudquery-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

可以使用如下方式启停 CloudQuery:

















































-- root用户[root@xsky-node2 cloudquery]# ./cloudquery.sh stopStopping enterprise_web ... doneRemoving enterprise_web ... doneNetwork resource_cloudquerynet is external, skippingStopping cloudquery-terminal ... doneStopping cloudquery-export   ... doneStopping cloudquery-analyze   ... doneStopping cloudquery-user     ... doneStopping cloudquery-message   ... doneStopping cloudquery-debug    ... doneStopping cloudquery-flow     ... doneStopping cloudquery-gateway   ... doneStopping cloudquery-dms      ... doneStopping cloudquery-desens   ... doneRemoving cloudquery-terminal ... doneRemoving cloudquery-export   ... doneRemoving cloudquery-analyze   ... doneRemoving cloudquery-user     ... doneRemoving cloudquery-message   ... doneRemoving cloudquery-debug    ... doneRemoving cloudquery-flow     ... doneRemoving cloudquery-gateway   ... doneRemoving cloudquery-dms      ... doneRemoving cloudquery-desens   ... doneNetwork resource_cloudquerynet is external, skipping停止除resource之外的服务[root@xsky-node2 cloudquery]# [root@xsky-node2 cloudquery]# ./cloudquery.sh startcloudquery-clickhouse is up-to-datecloudquery-zookeeper is up-to-datecloudquery-postgreSQL is up-to-datecloudquery-redis is up-to-date等待postgreSQL数据库启动...postgreSQL数据库启动完成...Creating cloudquery-message   ... doneCreating cloudquery-analyze   ... doneCreating cloudquery-flow     ... doneCreating cloudquery-export   ... doneCreating cloudquery-gateway   ... doneCreating cloudquery-dms      ... doneCreating cloudquery-terminal ... doneCreating cloudquery-debug    ... doneCreating cloudquery-desens   ... doneCreating cloudquery-user     ... doneCreating enterprise_web ... done启动

图片



排查日志

可以通过如下方法来查看应用相关日志:



[root@xsky-node2 ~]# docker logs -f --tail 200 cloudquery-dms

图片



登录 CloudQuery

CloudQuery 安装部署后,默认使用80端口,可通过http://IP:端口(默认 80)进行页面登录。


使用如下默认账号和密码登录控制台。

默认帐号: admin001
默认密码: Hello123$


图片



登录后的控制台主界面如下:


图片



附录

安装部署过程中,可能会遇到如下问题:


服务器上原已安装 redis

我初次安装时其中一台服务器出现了如下报错。




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 inuseERROR: Encountered errors while bringing up the project.

CloudQuery 内部通讯需要使用 Redis,如果已安装了 Redis,会因端口导致冲突,为此,可通过如下方式进行调整:





# cd /cloudquery/resource/   --修改 docker-compose.yml 文件-- 注释 redis的端口,如下所示


图片


然后通过:cloudquery.sh stop/start 启停服务。



Docker 版本过低

如果安装 CloudQuery 的服务器已安装了 Docker,但版本过低,会导致安装失败,如下所所示。












[root@xsky-node2 cloudquery-club-V2.2.0]# ./deploy.sh install请输入cloudQuery安装绝对路径(默认为/opt/cloudquery):/opt/cloudquerysetenforce: SELinux is disabled输入路径为无效文件夹,使用默认路径:/opt/cloudquerydocker 已安装docker版本小于19,无法运行cloudQuery。请安装新版本docker与docker-compose。
[root@xsky-node2 cloudquery-club-V2.2.0]# docker --versionDocker version 18.09.9, build 039a7df9ba

图片



安装新版CloudQuery V2 要求Docker 版本不能低于 19.03.12,如果服务器未安装Docker,安装CloudQuery后安装的Docker版本是19.03.12。


此时可有两种解决办法:


一是升级 Docker 版本,二是完全卸载当前 Docker,使用软件自动安装的 Docker。


服务器未安装 docker-compose

如果服务器安装了 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 ~]# cat /etc/default/grub GRUB_TIMEOUT=5GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"GRUB_DEFAULT=savedGRUB_DISABLE_SUBMENU=trueGRUB_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 restartshutdown -r 0


如上操作后,正常情况可打开控制台页面。


文章待续......本周持续更新《我和 CQ 的故事(中)CloudQuery 数据连接查询使用》


作者墨天轮博客 ID :尚雷