pika
pika copied to clipboard
通过配置文件获取rsync和replication的端口
原本想加一个功能, 通过配置文件设置 rsync
和 replication
的端口, 如果配置文件中没有配置, 还和之前一样, 使用 port
+1000 和 +2000
看了一下现有的逻辑,如果改了会带来一些不兼容的问题
现在slaveof命令和配置文件里的 slaveof的配置中, 端口都是使用的 pika的服务端口, 在需要使用 rsync和replication 时才用 pika的服务端口+偏移量计算出来, 如果改成从配置文件中读取端口配置, 那么 slaveof
命令和配置文件中的 主从配置 使用的端口 都需要改成 replication
的端口了
比如
原来的slaveof命令是 slaveof 127.0.0.1 9221
修改后的slaveof 命令就要变成 slaveof 127.0.0.1 11221
1.修改配置文件 2.修改info命令:获取监听的rsync端口和心跳端口信息。
和谦祥讨论过 这里会前后不兼容 ,不修改比较好,但是可以在会冲突的地方加日志,出现这个问题后修改端口,这个问题只会在启动的时候出现,只要启动了一般都不会在触发
Bot detected the issue body's language is not English, translate it automatically.
I discussed with Qianxiang that this will be incompatible before and after. It is better not to modify it, but you can add logs where there will be conflicts. Modify the port after this problem occurs. This problem will only appear at startup, and it will generally not occur as long as it is started. triggering