反向隧道手动工作,不适用于复制

编程入门 行业动态 更新时间:2024-10-23 13:23:12
本文介绍了反向隧道手动工作,不适用于复制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我的 MASTER mysql 服务器在本地网络上,我有一个新的远程从站(即在互联网上).由于 MASTER 没有可访问的 IP,我从文档中收集到我应该建立反向隧道.我执行这个:

My MASTER mysql server is on a local network, and I have a new slave which is remote (i.e. on the internet). As MASTER does not have an accessible IP, I gathered from the docs that I should establish a reverse tunnel. I execute this:

ssh -f -N -T -R 7777:localhost:3306 user@slave.slave

ssh -f -N -T -R 7777:localhost:3306 user@slave.slave

在 MASTER 上.连接似乎有效 - 我可以去从站并连接用 mysql 到 MASTER 没有问题.但出于某种原因,复制确实不开始.MASTER 已经可以毫无问题地复制到另外两个从站 - 那里的配置似乎是正确的.

on the MASTER. The connection seems to work - I can go to the slave and connect with mysql to the MASTER without problem. For some reason though, replication does not start. MASTER is already replicating to two other slaves without problems - seems the configuration is correct there.

我在从服务器上启动复制:

I initiated replication on the slave as:

CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=7777, MASTER_USER='my_repl', MASTER_PASSWORD='xxxxx', MASTER_LOG_FILE='mysql-bin.nnnnn', MASTER_LOG_POS=mm;

SLAVE STATUS 报告 mysql 尝试连接到远程,但从未成功:

SLAVE STATUS reports mysql trying to connect to the remote, but never succeeding:

error connecting to master 'my_repl@127.0.0.1:7777' - retry-time: 60 retries: 86400

谁能建议如何诊断这个问题?

Can anyone suggest how to diagnose this problem?

顺便说一句:操作系统是 Linux.

BTW: OS is Linux.

推荐答案

抱歉...我没有意识到我必须将 127.0.0.1 定义为新用户知识产权.

My apologies... I didn't realize I had to define a new user with 127.0.0.1 as IP.

所以,内网"连接使用

replication_user@machine_name

作为id,通过反向隧道的连接使用

as id, the connection which comes through the reverse tunnel uses

replication_user@127.0.0.1

作为 ID.两者都必须分别向 mysql 声明.原始消息中的其余信息是有效的 - 也许这有助于某人...

as id. Both have to be declared to mysql separately. The rest of the info in the original message is valid - maybe this helps someone...

您好,约翰

PS:忘了说了 - 我使用 tcpdump 远程调试了这个(MASTER 和 SLAVE 对我来说都是远程的):

PS: Forgot to mention - I debugged this remotely (both MASTER and SLAVE are remote to me) using tcpdump:

tcpdump -i lo 'tcp port 7777'

在 SLAVE 端,和

on the SLAVE side, and

tcpdump -i lo 'tcp port 3306'

在 MASTER 上(当然,当流量很大时,这不是很有用).

on the MASTER (of course that would not be very useful when there is much traffic).

更多推荐

反向隧道手动工作,不适用于复制

本文发布于:2023-10-24 14:43:43,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1524209.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:隧道   不适用于   工作

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!