Git Product home page Git Product logo

Comments (39)

long2ice avatar long2ice commented on June 15, 2024

你需要设置mysql的binglog配置,不能用配置文件自带的,在mysql执行:

show master status

from synch.

BiwenXiao avatar BiwenXiao commented on June 15, 2024

只需要改一下ini文件吗?需要刷新么,我改了之后新的配置没有起作用。需要重启吗?

from synch.

long2ice avatar long2ice commented on June 15, 2024

需要重启

from synch.

BiwenXiao avatar BiwenXiao commented on June 15, 2024

能不能支持从多个不同数据库同步表啊?
我这个是在服务器上面,重启机器不可以的。

from synch.

BiwenXiao avatar BiwenXiao commented on June 15, 2024

我以前的版本要更新到最新有什么办法吗?

from synch.

long2ice avatar long2ice commented on June 15, 2024

重启mysql2ch不是重启机器,不同数据库实例建立多个配置文件

from synch.

BiwenXiao avatar BiwenXiao commented on June 15, 2024

mysql2ch 没有重启命令啊,只有etl,produce,consume

from synch.

long2ice avatar long2ice commented on June 15, 2024

你可以记录binlog位置,升级mysql2ch,修改配置,然后从最新binlog同步。

from synch.

long2ice avatar long2ice commented on June 15, 2024

就是把进程杀了然后重新启动

from synch.

BiwenXiao avatar BiwenXiao commented on June 15, 2024

谢谢,我先去试试

from synch.

BiwenXiao avatar BiwenXiao commented on June 15, 2024

这个进程名字是啥啊,我找了所有进程找不到看起来像的。

from synch.

long2ice avatar long2ice commented on June 15, 2024

你用什么启动的?

from synch.

BiwenXiao avatar BiwenXiao commented on June 15, 2024

直接命令mysql2ch etl --schema

from synch.

long2ice avatar long2ice commented on June 15, 2024

这是全量同步,执行了就完了,没有后台进程

from synch.

BiwenXiao avatar BiwenXiao commented on June 15, 2024

那为啥改了配置文件不生效啊

from synch.

long2ice avatar long2ice commented on June 15, 2024

你需要什么生效?

from synch.

BiwenXiao avatar BiwenXiao commented on June 15, 2024

mysql_server_id = 1
init_binlog_file = mysql-bin.000002
init_binlog_pos = 271943925

from synch.

BiwenXiao avatar BiwenXiao commented on June 15, 2024

这是我之前按照模板来的
2020-06-11 16:06:06 - mysql2ch.producer:26 - INFO - start producer success!
2020-06-11 16:06:06 - mysql2ch.reader:76 - INFO - start sync at 2020-06-11 16:06:06
2020-06-11 16:06:06 - mysql2ch.reader:77 - INFO - mysql binlog: binlog.000088:2238
Traceback (most recent call last):
File "/usr/local/bin/mysql2ch", line 8, in
sys.exit(cli())
File "/usr/local/lib/python3.6/site-packages/mysql2ch/cli.py", line 66, in cli
parse_args.run(parse_args)
File "/usr/local/lib/python3.6/site-packages/mysql2ch/cli.py", line 27, in run
args.func(args)
File "/usr/local/lib/python3.6/site-packages/mysql2ch/producer.py", line 43, in produce
skip_update_tables=settings.skip_update_tables,
File "/usr/local/lib/python3.6/site-packages/mysql2ch/reader.py", line 93, in binlog_reading
for binlog_event in stream:
File "/usr/local/lib/python3.6/site-packages/pymysqlreplication/binlogstream.py", line 430, in fetchone
pkt = self._stream_connection._read_packet()
File "/usr/local/lib/python3.6/site-packages/pymysql/connections.py", line 684, in _read_packet

from synch.

BiwenXiao avatar BiwenXiao commented on June 15, 2024

配置文件我已经换了一个了,然后还换了个位置,依然没有作用

from synch.

long2ice avatar long2ice commented on June 15, 2024

这好像是权限的问题

from synch.

BiwenXiao avatar BiwenXiao commented on June 15, 2024

我一直是root运行的

from synch.

long2ice avatar long2ice commented on June 15, 2024

mysql账号

from synch.

BiwenXiao avatar BiwenXiao commented on June 15, 2024

我的全量导入已经成功了。
这个binlog运行的时候没有用我最新的配置, 我的是mysql-bin00002

from synch.

long2ice avatar long2ice commented on June 15, 2024

要先清空redis里面的

from synch.

BiwenXiao avatar BiwenXiao commented on June 15, 2024

我去试试

from synch.

BiwenXiao avatar BiwenXiao commented on June 15, 2024

删除缓存,更改配置文件成功,还是报之前那个错误!连接数据库问题吗?

from synch.

long2ice avatar long2ice commented on June 15, 2024

应该是你的mysql账号没有同步权限

from synch.

BiwenXiao avatar BiwenXiao commented on June 15, 2024

好的,我去瞅瞅,真的太感谢了。已star

from synch.

BiwenXiao avatar BiwenXiao commented on June 15, 2024

root没有同步权限吗?还有这操作

from synch.

long2ice avatar long2ice commented on June 15, 2024

你检查下mysql2ch.ini中mysql相关配置

from synch.

BiwenXiao avatar BiwenXiao commented on June 15, 2024

配置有问题,全量导入应该会失败吧

from synch.

long2ice avatar long2ice commented on June 15, 2024

报错就是报的读不到binlog

from synch.

BiwenXiao avatar BiwenXiao commented on June 15, 2024

好的。。

from synch.

BiwenXiao avatar BiwenXiao commented on June 15, 2024

请教一下,工程的本地调试在哪儿启动啊,刚刚下载了工程,搞了个pycharm,没用过。

from synch.

long2ice avatar long2ice commented on June 15, 2024

先用poetry安装依赖,执行python -m mysql2ch.cli consume --schema test启动

from synch.

zhechu avatar zhechu commented on June 15, 2024

官方 docker-compose.yml 配置的 Redis 有问题,单独部署就解决了

version: '3'
services:
  producer:
#    depends_on:
#      - redis
    image: long2ice/synch
    command: synch --alias mysql_db produce
    volumes:
      - ./synch.yaml:/synch/synch.yaml
  # one service consume on schema
  consumer.doraemon_user:
#    depends_on:
#      - redis
    image: long2ice/synch
    command: synch --alias mysql_db consume --schema doraemon_user
    volumes:
      - ./synch.yaml:/synch/synch.yaml
#  redis:
#    image: redis:latest
#    volumes:
#      - redis:/data
#volumes:
#  redis:

from synch.

long2ice avatar long2ice commented on June 15, 2024

有报错吗

from synch.

zhechu avatar zhechu commented on June 15, 2024

事实上是Redis缓存的问题,若第一次运行报错,则Redis会缓存Mysql bin log 信息,而用 Docker 部署,若Redis数据卷未删除,只删除容器重新部署,那缓存是还在的,Redis重新部署时,缓存会从数据卷的磁盘读入。

from synch.

long2ice avatar long2ice commented on June 15, 2024

好的

from synch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.