开发者社区> 问答> 正文

adapter1.1.5同步es7.3.2,出现NoNodeAvailableException,求

logger打印正常更变的数据,无法同步到es中,

java.lang.RuntimeException: NoNodeAvailableException[None of the configured nodes are available: [{#transport#-1}{pPHaJwc_Rpaz6XSEviY_WA}{192.168.56.117}{192.168.56.117:9300}]] at com.alibaba.otter.canal.client.adapter.es.core.service.ESSyncService.sync(ESSyncService.java:116) ~[na:na] at com.alibaba.otter.canal.client.adapter.es.core.service.ESSyncService.sync(ESSyncService.java:64) ~[na:na] at com.alibaba.otter.canal.client.adapter.es.core.ESAdapter.sync(ESAdapter.java:115) ~[na:na] at com.alibaba.otter.canal.client.adapter.es.core.ESAdapter.sync(ESAdapter.java:94) ~[na:na] at com.alibaba.otter.canal.adapter.launcher.loader.AdapterProcessor.batchSync(AdapterProcessor.java:139) ~[client-adapter.launcher-1.1.5.jar:na] at com.alibaba.otter.canal.adapter.launcher.loader.AdapterProcessor.lambda$null$1(AdapterProcessor.java:97) ~[client-adapter.launcher-1.1.5.jar:na] at java.util.concurrent.CopyOnWriteArrayList.forEach(CopyOnWriteArrayList.java:891) ~[na:1.8.0_251] at com.alibaba.otter.canal.adapter.launcher.loader.AdapterProcessor.lambda$null$2(AdapterProcessor.java:94) ~[client-adapter.launcher-1.1.5.jar:na] at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[na:1.8.0_251] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[na:1.8.0_251] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[na:1.8.0_251] at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_251] Caused by: org.elasticsearch.client.transport.NoNodeAvailableException: None of the configured nodes are available: [{#transport#-1}{pPHaJwc_Rpaz6XSEviY_WA}{192.168.56.117}{192.168.56.117:9300}] at org.elasticsearch.client.transport.TransportClientNodesService.ensureNodesAreAvailable(TransportClientNodesService.java:352) ~[na:na] at org.elasticsearch.client.transport.TransportClientNodesService.execute(TransportClientNodesService.java:248) ~[na:na] at org.elasticsearch.client.transport.TransportProxyClient.execute(TransportProxyClient.java:57) ~[na:na] at org.elasticsearch.client.transport.TransportClient.doExecute(TransportClient.java:394) ~[na:na] at org.elasticsearch.client.support.AbstractClient.execute(AbstractClient.java:392) ~[na:na] at org.elasticsearch.client.support.AbstractClient.execute(AbstractClient.java:381) ~[na:na] at org.elasticsearch.client.support.AbstractClient$ClusterAdmin.execute(AbstractClient.java:675) ~[na:na]

application.yml

server: port: 8081 spring: jackson: date-format: yyyy-MM-dd HH:mm:ss time-zone: GMT+8 default-property-inclusion: non_null

canal.conf: mode: tcp #tcp kafka rocketMQ rabbitMQ flatMessage: true zookeeperHosts: syncBatchSize: 1000 retries: 0 timeout: accessKey: secretKey: consumerProperties: # canal tcp consumer canal.tcp.server.host: 192.168.56.117:11111 #canal.tcp.zookeeper.hosts: canal.tcp.batch.size: 500 #canal.tcp.username: #canal.tcp.password: # kafka consumer kafka.bootstrap.servers: 127.0.0.1:9092 kafka.enable.auto.commit: false kafka.auto.commit.interval.ms: 1000 kafka.auto.offset.reset: latest kafka.request.timeout.ms: 40000 kafka.session.timeout.ms: 30000 kafka.isolation.level: read_committed kafka.max.poll.records: 1000 # rocketMQ consumer rocketmq.namespace: rocketmq.namesrv.addr: 127.0.0.1:9876 rocketmq.batch.size: 1000 rocketmq.enable.message.trace: false rocketmq.customized.trace.topic: rocketmq.access.channel: rocketmq.subscribe.filter: # rabbitMQ consumer rabbitmq.host: rabbitmq.virtual.host: rabbitmq.username: rabbitmq.password: rabbitmq.resource.ownerId:

srcDataSources: defaultDS: url: jdbc:mysql://127.0.0.1:3306/cloud_wall?useUnicode=true username: root password: a9530.A. canalAdapters: - instance: example groups: - groupId: g1 outerAdapters: - name: logger - name: es7 key: exampleKey hosts: 127.0.0.1:9300 # es 集群地址, 逗号分隔 properties: mode: rest#可指定transport模式或者rest模式 # security.auth: test:123456 # only used for rest mode cluster.name: elasticsearch # es cluster name

es7.yml

dataSourceKey: defaultDS outerAdapterKey: exampleKey destination: example groupId: g1 esMapping: _index: ana _id: _id upsert: true

pk: id

sql: "SELECT a.id as _id, a.user_id, u.user_nick_name, a.ana_type_id, t.ana_type_name, a.ana_title, a.ana_content, a.comment_num, a.prize_num, a.create_date, a.update_date FROM ana a LEFT JOIN ana_type t ON a.ana_type_id = t.id LEFT JOIN user u ON a.user_id = u.id"

objFields:

_labels: array:;

etlCondition: "where a.create_date>={'0'}" commitBatch: 3000

原提问者GitHub用户caipeishen

展开
收起
后端老大 2023-04-27 10:35:50 367 0
2 条回答
写回答
取消 提交回答
  • 值得去的地方都没有捷径

    请确认您的 Elasticsearch 节点是否已经启动并且可用。如果您的 Elasticsearch 节点已经启动,请检查您的网络设置和防火墙设置是否正确,以确保您的 Canal 适配器可以连接到 Elasticsearch 节点。如果您的 Elasticsearch 节点未启动,请启动它并确认它已经成功启动。最后,请检查您的 Canal 适配器配置文件是否正确配置了 Elasticsearch 节点的地址和端口。

    2023-04-27 15:00:33
    赞同 展开评论 打赏
  • 1.5有问题。没成功,1.6可以

    原回答者GitHub用户maclinuxp

    2023-04-27 10:44:23
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载