实测:NLPchina/elasticsearch-sql

1、安装elasticsearch-sql插件

(1)安装elasticsearch-sql插件

D:\app\elasticsearch-7.12.0>bin\elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.12.0.0/elasticsearch-sql-7.12.0.0.zip
"warning: usage of JAVA_HOME is deprecated, use ES_JAVA_HOME"
-> Installing https://github.com/NLPchina/elasticsearch-sql/releases/download/7.12.0.0/elasticsearch-sql-7.12.0.0.zip
-> Downloading https://github.com/NLPchina/elasticsearch-sql/releases/download/7.12.0.0/elasticsearch-sql-7.12.0.0.zip
[=================================================] 100%??
-> Installed sql
-> Please restart Elasticsearch to activate any plugins installed

D:\app\elasticsearch-7.12.0>

(2)启动elasticsearch

D:\app\elasticsearch-7.12.0>bin\elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.12.0.0/elasticsearch-sql-7.12.0.0.zip
"warning: usage of JAVA_HOME is deprecated, use ES_JAVA_HOME"
-> Installing https://github.com/NLPchina/elasticsearch-sql/releases/download/7.12.0.0/elasticsearch-sql-7.12.0.0.zip
-> Downloading https://github.com/NLPchina/elasticsearch-sql/releases/download/7.12.0.0/elasticsearch-sql-7.12.0.0.zip
[=================================================] 100%??
-> Installed sql
-> Please restart Elasticsearch to activate any plugins installed

D:\app\elasticsearch-7.12.0>bin\elasticsearch
"warning: usage of JAVA_HOME is deprecated, use ES_JAVA_HOME"
Java HotSpot(TM) 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
Unable to get Charset 'cp65001' for property 'sun.stdout.encoding', using default UTF-8 and continuing.
[2021-08-09T16:29:32,395][INFO ][o.e.n.Node               ] [TPA-VDI-OA11-17] version[7.12.0], pid[12244], build[default/zip/78722783c38caa25a70982b5b042074cde5d3b3a/2021-03-18T06:17:15.410153305Z], OS[Windows 10/10.0/amd64], JVM[Oracle Corporation/Java HotSpot(TM) 64-Bit Server VM/11.0.3/11.0.3+12-LTS]
[2021-08-09T16:29:32,403][INFO ][o.e.n.Node               ] [TPA-VDI-OA11-17] JVM home [C:\Program Files\Java\jdk-11.0.3], using bundled JDK [false]
[2021-08-09T16:29:32,405][INFO ][o.e.n.Node               ] [TPA-VDI-OA11-17] JVM arguments [-Des.networkaddress.cache.ttl=60, -Des.networkaddress.cache.negative.ttl=10, -XX:+AlwaysPreTouch, -Xss1m, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djna.nosys=true, -XX:-OmitStackTraceInFastThrow, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=0, -Dio.netty.allocator.numDirectArenas=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Djava.locale.providers=SPI,COMPAT, --add-opens=java.base/java.io=ALL-UNNAMED, -XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -Djava.io.tmpdir=D:\Users\chengyq\AppData\Local\Temp\elasticsearch, -XX:+HeapDumpOnOutOfMemoryError, -XX:HeapDumpPath=data, -XX:ErrorFile=logs/hs_err_pid%p.log, -Xlog:gc*,gc+age=trace,safepoint:file=logs/gc.log:utctime,pid,tags:filecount=32,filesize=64m, -Xms1024m, -Xmx1024m, -XX:MaxDirectMemorySize=536870912, -Delasticsearch, -Des.path.home=D:\app\elasticsearch-7.12.0, -Des.path.conf=D:\app\elasticsearch-7.12.0\config, -Des.distribution.flavor=default, -Des.distribution.type=zip, -Des.bundled_jdk=true]
[2021-08-09T16:29:37,674][INFO ][o.e.p.PluginsService     ] [TPA-VDI-OA11-17] loaded module [aggs-matrix-stats]
[2021-08-09T16:29:37,676][INFO ][o.e.p.PluginsService     ] [TPA-VDI-OA11-17] loaded module [analysis-common]
[2021-08-09T16:29:37,681][INFO ][o.e.p.PluginsService     ] [TPA-VDI-OA11-17] loaded module [constant-keyword]
[2021-08-09T16:29:37,682][INFO ][o.e.p.PluginsService     ] [TPA-VDI-OA11-17] loaded module [flattened]
[2021-08-09T16:29:37,683][INFO ][o.e.p.PluginsService     ] [TPA-VDI-OA11-17] loaded module [frozen-indices]
[2021-08-09T16:29:37,684][INFO ][o.e.p.PluginsService     ] [TPA-VDI-OA11-17] loaded module [ingest-common]
[2021-08-09T16:29:37,684][INFO ][o.e.p.PluginsService     ] [TPA-VDI-OA11-17] loaded module [ingest-geoip]
[2021-08-09T16:29:37,685][INFO ][o.e.p.PluginsService     ] [TPA-VDI-OA11-17] loaded module [ingest-user-agent]
[2021-08-09T16:29:37,686][INFO ][o.e.p.PluginsService     ] [TPA-VDI-OA11-17] loaded module [kibana]
[2021-08-09T16:29:37,687][INFO ][o.e.p.PluginsService     ] [TPA-VDI-OA11-17] loaded module [lang-expression]
[2021-08-09T16:29:37,687][INFO ][o.e.p.PluginsService     ] [TPA-VDI-OA11-17] loaded module [lang-mustache]
[2021-08-09T16:29:37,688][INFO ][o.e.p.PluginsService     ] [TPA-VDI-OA11-17] loaded module [lang-painless]
[2021-08-09T16:29:37,689][INFO ][o.e.p.PluginsService     ] [TPA-VDI-OA11-17] loaded module [mapper-extras]
[2021-08-09T16:29:37,695][INFO ][o.e.p.PluginsService     ] [TPA-VDI-OA11-17] loaded module [mapper-version]
[2021-08-09T16:29:37,696][INFO ][o.e.p.PluginsService     ] [TPA-VDI-OA11-17] loaded module [parent-join]
[2021-08-09T16:29:37,697][INFO ][o.e.p.PluginsService     ] [TPA-VDI-OA11-17] loaded module [percolator]
[2021-08-09T16:29:37,698][INFO ][o.e.p.PluginsService     ] [TPA-VDI-OA11-17] loaded module [rank-eval]
[2021-08-09T16:29:37,698][INFO ][o.e.p.PluginsService     ] [TPA-VDI-OA11-17] loaded module [reindex]
[2021-08-09T16:29:37,699][INFO ][o.e.p.PluginsService     ] [TPA-VDI-OA11-17] loaded module [repositories-metering-api]
[2021-08-09T16:29:37,700][INFO ][o.e.p.PluginsService     ] [TPA-VDI-OA11-17] loaded module [repository-encrypted]
[2021-08-09T16:29:37,701][INFO ][o.e.p.PluginsService     ] [TPA-VDI-OA11-17] loaded module [repository-url]
[2021-08-09T16:29:37,702][INFO ][o.e.p.PluginsService     ] [TPA-VDI-OA11-17] loaded module [search-business-rules]
[2021-08-09T16:29:37,703][INFO ][o.e.p.PluginsService     ] [TPA-VDI-OA11-17] loaded module [searchable-snapshots]
[2021-08-09T16:29:37,708][INFO ][o.e.p.PluginsService     ] [TPA-VDI-OA11-17] loaded module [snapshot-repo-test-kit]
[2021-08-09T16:29:37,709][INFO ][o.e.p.PluginsService     ] [TPA-VDI-OA11-17] loaded module [spatial]
[2021-08-09T16:29:37,710][INFO ][o.e.p.PluginsService     ] [TPA-VDI-OA11-17] loaded module [transform]
[2021-08-09T16:29:37,712][INFO ][o.e.p.PluginsService     ] [TPA-VDI-OA11-17] loaded module [transport-netty4]
[2021-08-09T16:29:37,713][INFO ][o.e.p.PluginsService     ] [TPA-VDI-OA11-17] loaded module [unsigned-long]
[2021-08-09T16:29:37,713][INFO ][o.e.p.PluginsService     ] [TPA-VDI-OA11-17] loaded module [vectors]
[2021-08-09T16:29:37,714][INFO ][o.e.p.PluginsService     ] [TPA-VDI-OA11-17] loaded module [wildcard]
[2021-08-09T16:29:37,715][INFO ][o.e.p.PluginsService     ] [TPA-VDI-OA11-17] loaded module [x-pack-aggregate-metric]
[2021-08-09T16:29:37,716][INFO ][o.e.p.PluginsService     ] [TPA-VDI-OA11-17] loaded module [x-pack-analytics]
[2021-08-09T16:29:37,722][INFO ][o.e.p.PluginsService     ] [TPA-VDI-OA11-17] loaded module [x-pack-async]
[2021-08-09T16:29:37,723][INFO ][o.e.p.PluginsService     ] [TPA-VDI-OA11-17] loaded module [x-pack-async-search]
[2021-08-09T16:29:37,724][INFO ][o.e.p.PluginsService     ] [TPA-VDI-OA11-17] loaded module [x-pack-autoscaling]
[2021-08-09T16:29:37,725][INFO ][o.e.p.PluginsService     ] [TPA-VDI-OA11-17] loaded module [x-pack-ccr]
[2021-08-09T16:29:37,728][INFO ][o.e.p.PluginsService     ] [TPA-VDI-OA11-17] loaded module [x-pack-core]
[2021-08-09T16:29:37,728][INFO ][o.e.p.PluginsService     ] [TPA-VDI-OA11-17] loaded module [x-pack-data-streams]
[2021-08-09T16:29:37,733][INFO ][o.e.p.PluginsService     ] [TPA-VDI-OA11-17] loaded module [x-pack-deprecation]
[2021-08-09T16:29:37,734][INFO ][o.e.p.PluginsService     ] [TPA-VDI-OA11-17] loaded module [x-pack-enrich]
[2021-08-09T16:29:37,737][INFO ][o.e.p.PluginsService     ] [TPA-VDI-OA11-17] loaded module [x-pack-eql]
[2021-08-09T16:29:37,738][INFO ][o.e.p.PluginsService     ] [TPA-VDI-OA11-17] loaded module [x-pack-fleet]
[2021-08-09T16:29:37,745][INFO ][o.e.p.PluginsService     ] [TPA-VDI-OA11-17] loaded module [x-pack-graph]
[2021-08-09T16:29:37,748][INFO ][o.e.p.PluginsService     ] [TPA-VDI-OA11-17] loaded module [x-pack-identity-provider]
[2021-08-09T16:29:37,749][INFO ][o.e.p.PluginsService     ] [TPA-VDI-OA11-17] loaded module [x-pack-ilm]
[2021-08-09T16:29:37,749][INFO ][o.e.p.PluginsService     ] [TPA-VDI-OA11-17] loaded module [x-pack-ingest]
[2021-08-09T16:29:37,751][INFO ][o.e.p.PluginsService     ] [TPA-VDI-OA11-17] loaded module [x-pack-logstash]
[2021-08-09T16:29:37,752][INFO ][o.e.p.PluginsService     ] [TPA-VDI-OA11-17] loaded module [x-pack-ml]
[2021-08-09T16:29:37,754][INFO ][o.e.p.PluginsService     ] [TPA-VDI-OA11-17] loaded module [x-pack-monitoring]
[2021-08-09T16:29:37,754][INFO ][o.e.p.PluginsService     ] [TPA-VDI-OA11-17] loaded module [x-pack-ql]
[2021-08-09T16:29:37,760][INFO ][o.e.p.PluginsService     ] [TPA-VDI-OA11-17] loaded module [x-pack-rollup]
[2021-08-09T16:29:37,763][INFO ][o.e.p.PluginsService     ] [TPA-VDI-OA11-17] loaded module [x-pack-runtime-fields]
[2021-08-09T16:29:37,764][INFO ][o.e.p.PluginsService     ] [TPA-VDI-OA11-17] loaded module [x-pack-security]
[2021-08-09T16:29:37,765][INFO ][o.e.p.PluginsService     ] [TPA-VDI-OA11-17] loaded module [x-pack-sql]
[2021-08-09T16:29:37,770][INFO ][o.e.p.PluginsService     ] [TPA-VDI-OA11-17] loaded module [x-pack-stack]
[2021-08-09T16:29:37,776][INFO ][o.e.p.PluginsService     ] [TPA-VDI-OA11-17] loaded module [x-pack-text-structure]
[2021-08-09T16:29:37,776][INFO ][o.e.p.PluginsService     ] [TPA-VDI-OA11-17] loaded module [x-pack-voting-only-node]
[2021-08-09T16:29:37,777][INFO ][o.e.p.PluginsService     ] [TPA-VDI-OA11-17] loaded module [x-pack-watcher]
[2021-08-09T16:29:37,778][INFO ][o.e.p.PluginsService     ] [TPA-VDI-OA11-17] loaded plugin [sql]
[2021-08-09T16:29:38,878][INFO ][o.e.e.NodeEnvironment    ] [TPA-VDI-OA11-17] using [1] data paths, mounts [[Data (D:)]], net usable_space [95.3gb], net total_space [199.9gb], types [NTFS]
[2021-08-09T16:29:38,880][INFO ][o.e.e.NodeEnvironment    ] [TPA-VDI-OA11-17] heap size [990.7mb], compressed ordinary object pointers [true]
[2021-08-09T16:29:39,001][INFO ][o.e.n.Node               ] [TPA-VDI-OA11-17] node name [TPA-VDI-OA11-17], node ID [31x-7zHgTPG_kJ7DQWDGVg], cluster name [elasticsearch], roles [transform, data_frozen, master, remote_cluster_client, data, ml, data_content, data_hot, data_warm, data_cold, ingest]
[2021-08-09T16:29:46,091][INFO ][o.e.x.m.p.l.CppLogMessageHandler] [TPA-VDI-OA11-17] [controller/9336] [Main.cc@117] controller (64 bit): Version 7.12.0 (Build 778cc7261dfdd1) Copyright (c) 2021 Elasticsearch BV
[2021-08-09T16:29:46,755][INFO ][o.e.x.s.a.s.FileRolesStore] [TPA-VDI-OA11-17] parsed [0] roles from file [D:\app\elasticsearch-7.12.0\config\roles.yml]
[2021-08-09T16:29:49,321][INFO ][o.e.t.NettyAllocator     ] [TPA-VDI-OA11-17] creating NettyAllocator with the following configs: [name=unpooled, suggested_max_allocation_size=1mb, factors={es.unsafe.use_unpooled_allocator=null, g1gc_enabled=false, g1gc_region_size=0b, heap_size=990.7mb}]
[2021-08-09T16:29:49,449][INFO ][o.e.d.DiscoveryModule    ] [TPA-VDI-OA11-17] using discovery type [zen] and seed hosts providers [settings]
[2021-08-09T16:29:50,238][INFO ][o.e.g.DanglingIndicesState] [TPA-VDI-OA11-17] gateway.auto_import_dangling_indices is disabled, dangling indices will not be automatically detected or imported and must be managed manually
[2021-08-09T16:29:51,030][INFO ][o.e.n.Node               ] [TPA-VDI-OA11-17] initialized
[2021-08-09T16:29:51,031][INFO ][o.e.n.Node               ] [TPA-VDI-OA11-17] starting ...
[2021-08-09T16:29:51,073][INFO ][o.e.x.s.c.PersistentCache] [TPA-VDI-OA11-17] persistent cache index loaded
[2021-08-09T16:29:51,494][INFO ][o.e.t.TransportService   ] [TPA-VDI-OA11-17] publish_address {127.0.0.1:9300}, bound_addresses {127.0.0.1:9300}, {[::1]:9300}
[2021-08-09T16:29:51,964][WARN ][o.e.b.BootstrapChecks    ] [TPA-VDI-OA11-17] the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured
[2021-08-09T16:29:51,966][INFO ][o.e.c.c.Coordinator      ] [TPA-VDI-OA11-17] cluster UUID [xP6UaBjkTeCtah8_WO5RbQ]
[2021-08-09T16:29:51,987][INFO ][o.e.c.c.ClusterBootstrapService] [TPA-VDI-OA11-17] no discovery configuration found, will perform best-effort cluster bootstrapping after [3s] unless existing master is discovered
[2021-08-09T16:29:52,189][INFO ][o.e.c.s.MasterService    ] [TPA-VDI-OA11-17] elected-as-master ([1] nodes joined)[{TPA-VDI-OA11-17}{31x-7zHgTPG_kJ7DQWDGVg}{jCe6oELgReChSpDLcSwTYQ}{127.0.0.1}{127.0.0.1:9300}{cdfhilmrstw}{ml.machine_memory=12884430848, xpack.installed=true, transform.node=true, ml.max_open_jobs=20, ml.max_jvm_size=1038876672} elect leader, _BECOME_MASTER_TASK_, _FINISH_ELECTION_], term: 2, version: 37, delta: master node changed {previous [], current [{TPA-VDI-OA11-17}{31x-7zHgTPG_kJ7DQWDGVg}{jCe6oELgReChSpDLcSwTYQ}{127.0.0.1}{127.0.0.1:9300}{cdfhilmrstw}{ml.machine_memory=12884430848, xpack.installed=true, transform.node=true, ml.max_open_jobs=20, ml.max_jvm_size=1038876672}]}
[2021-08-09T16:29:52,455][INFO ][o.e.c.s.ClusterApplierService] [TPA-VDI-OA11-17] master node changed {previous [], current [{TPA-VDI-OA11-17}{31x-7zHgTPG_kJ7DQWDGVg}{jCe6oELgReChSpDLcSwTYQ}{127.0.0.1}{127.0.0.1:9300}{cdfhilmrstw}{ml.machine_memory=12884430848, xpack.installed=true, transform.node=true, ml.max_open_jobs=20, ml.max_jvm_size=1038876672}]}, term: 2, version: 37, reason: Publication{term=2, version=37}
[2021-08-09T16:29:52,849][INFO ][o.e.h.AbstractHttpServerTransport] [TPA-VDI-OA11-17] publish_address {127.0.0.1:9200}, bound_addresses {127.0.0.1:9200}, {[::1]:9200}
[2021-08-09T16:29:52,849][INFO ][o.e.n.Node               ] [TPA-VDI-OA11-17] started
[2021-08-09T16:29:53,052][INFO ][o.e.l.LicenseService     ] [TPA-VDI-OA11-17] license [267a1720-5d10-42f0-b8db-66ea642485f0] mode [basic] - valid
[2021-08-09T16:29:53,055][INFO ][o.e.x.s.s.SecurityStatusChangeListener] [TPA-VDI-OA11-17] Active license is now [BASIC]; Security is disabled
[2021-08-09T16:29:53,068][INFO ][o.e.g.GatewayService     ] [TPA-VDI-OA11-17] recovered [0] indices into cluster_state
[2021-08-09T16:57:16,122][INFO ][o.e.n.Node               ] [TPA-VDI-OA11-17] stopping ...
[2021-08-09T16:57:16,132][INFO ][o.e.x.w.WatcherService   ] [TPA-VDI-OA11-17] stopping watch service, reason [shutdown initiated]
[2021-08-09T16:57:16,139][INFO ][o.e.x.w.WatcherLifeCycleService] [TPA-VDI-OA11-17] watcher has stopped and shutdown
[2021-08-09T16:57:16,162][INFO ][o.e.x.m.p.NativeController] [TPA-VDI-OA11-17] Native controller process has stopped - no new native processes can be started

可以看到loaded plugin [sql]插件已经启动。

2、导入测试数据

POST /blog/_bulk?refresh
{ "index": { "_id": "1" }}
{ "title": "VMware安装" ,"author":"程裕强","content":"VMware Workstation虚拟机软件安装图解" , "url":"http://x.co/6nc81","postdate":"2018-12-11"}
{ "index": {"_id": "2" }}
{ "title":  "Linux安装" ,"author":  "程裕强" ,"content": "VMware模拟Linux服务器安装图解" , "url": "http://x.co/6nc82","postdate":"2018-12-12"}
{ "index": { "_id": "3" }}
{ "title":  "Xshell6安装" , "author": "程裕强" ,"content": "Xshell6个人版安装与远程操作连接服务器..." , "url": "http://x.co/6nc84" ,"postdate":"2018-12-13"}
{ "index": {"_id": "4" }}
{ "title": "CentOS 7.x基本设置" ,"author":"程裕强","content":"CentOS 7.x基本设置","url":"http://x.co/6nc85" ,"postdate":"2018-12-15"}
{ "create": {"_id": "5" }}
{ "title": "JDK安装与配置","author":"程裕强" ,"content": "图解JDK安装配置" , "url": "http://x.co/6nc86","postdate":"2018-12-15"}
{ "create": {"_id": "6" }}
{ "title": "Intellij IDEA安装","author":"程裕强" ,"content": "图解Windows平台下Intellij IDEA安装配置" , "url": "http://x.co/6nc89","postdate":"2019-01-03"}
GET blog/_search

在这里插入图片描述


3、安装谷歌浏览器的elasticsearch-sql-site-chrome插件

(1)下载插件:https://github.com/shi-yuan/elasticsearch-sql-site-chrome
在这里插入图片描述
(2)解压
在这里插入图片描述

(3)在chrome浏览器输入:chrome://extensions/
先打开开发者模式,然后出现“加载已解压的扩展程序”按钮,单击该按钮,加载刚才已解压的扩展程序
在这里插入图片描述
(4)开打插件
在这里插入图片描述
(5)执行SQL命令 (首先在右上角填写对应的ES集群地址,此处填写了本地地址:http://127.0.0.1:9200/)
在这里插入图片描述
在这里插入图片描述

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
好的,您可以按照以下的方式来编写docker-compose.yml文件: ``` version: '3.7' services: jobmanager: image: flink:1.17.0 command: jobmanager ports: - "8081:8081" taskmanager: image: flink:1.17.0 command: taskmanager depends_on: - jobmanager links: - jobmanager:jobmanager environment: - JOB_MANAGER_RPC_ADDRESS=jobmanager - FLINK_TASK_MANAGER_MEMORY_PROCESS_SIZE=1024m elasticsearch: image: docker.elastic.co/elasticsearch/elasticsearch:7.10.2 environment: - discovery.type=single-node ports: - "9200:9200" mysql: image: mysql:8.0 environment: - MYSQL_ROOT_PASSWORD=<your_password> - MYSQL_USER=<your_user> - MYSQL_PASSWORD=<your_password> - MYSQL_DATABASE=<your_database> ports: - "3306:3306" postgres: image: postgres:13.1 environment: - POSTGRES_USER=<your_user> - POSTGRES_PASSWORD=<your_password> - POSTGRES_DB=<your_database> ports: - "5432:5432" flink-job: image: flink:1.17.0 volumes: - ./flink-conf.yaml:/opt/flink/conf/flink-conf.yaml - ./lib/flink-sql-connector-elasticsearch7-3.0.1-1.17.jar:/opt/flink/lib/flink-sql-connector-elasticsearch7-3.0.1-1.17.jar - ./lib/flink-sql-connector-mysql-cdc-2.3.0.jar:/opt/flink/lib/flink-sql-connector-mysql-cdc-2.3.0.jar - ./lib/flink-sql-connector-postgres-cdc-2.3.0.jar:/opt/flink/lib/flink-sql-connector-postgres-cdc-2.3.0.jar command: jobmanager depends_on: - jobmanager - elasticsearch - mysql - postgres links: - elasticsearch:elasticsearch - mysql:mysql - postgres:postgres environment: - JOB_MANAGER_RPC_ADDRESS=jobmanager - FLINK_TM_HEAP_SIZE=1024m - FLINK_PROPERTIES= - FLINK_ENV_JAVA_OPTS= - FLINK_ENV_JAVA_TOOL_OPTIONS= - FLINK_CONF_DIR=/opt/flink/conf - FLINK_LIB_DIR=/opt/flink/lib - FLINK_PLUGINS_DIR=/opt/flink/plugins - FLINK_OPT_DIR=/opt/flink/opt - FLINK_LOG_DIR=/opt/flink/log - FLINK_HOME=/opt/flink volumes: - ./job.jar:/opt/flink/job.jar - ./flink-conf.yaml:/opt/flink/conf/flink-conf.yaml ``` 其中需要注意的是: 1. 在 `flink-job` 服务中,我们使用了 `volumes` 来挂载 `flink-conf.yaml` 和三个依赖的jar包到容器的 `/opt/flink/conf` 和 `/opt/flink/lib` 目录中。 2. 我们在 `flink-job` 服务的环境变量中设置了 `FLINK_PROPERTIES`,因为 Flink 在启动时会读取这个环境变量中的配置信息。 3. 我们在 `flink-job` 服务的环境变量中设置了 `FLINK_LIB_DIR`,这是因为 Flink 在启动时会从这个目录中加载依赖的jar包。 4. 我们在 `flink-job` 服务的环境变量中设置了 `FLINK_CONF_DIR`,这是因为 Flink 在启动时会读取这个目录中的配置文件。 5. 我们在 `flink-job` 服务的环境变量中设置了 `FLINK_HOME`,这是因为 Flink 在启动时需要知道它的安装路径。 上述的docker-compose.yml文件可以满足您的要求,在启动容器后,您可以使用以下的命令来进入到flink-job容器中: ``` docker-compose run flink-job /bin/bash ``` 然后,您可以在容器中运行Flink任务了。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值