You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@seata.apache.org by "bydongxing (via GitHub)" <gi...@apache.org> on 2024/01/10 04:19:10 UTC
[I] Unreal local address obtained by io.seata.common.util.NetUtil#getLocalIp [incubator-seata]
bydongxing opened a new issue, #6251:
URL: https://github.com/apache/incubator-seata/issues/6251
### Ⅰ. Issue Description
When the project started, the 192.168.64.1 obtained is not my real ip.
### Ⅱ. Describe what happened
```
2024-01-10 12:11:41.145 INFO [26943, ] --- [main] i.s.core.rpc.netty.NettyPoolableFactory : NettyPool create channel to transactionRole:TMROLE,address:193.168.11.122:8092,msg:< RegisterTMRequest{version='2.0.0', applicationId='stock-service', transactionServiceGroup='default-tx-group', extraData='ak=null
digest=default-tx-group,192.168.64.1,1704859901143
timestamp=1704859901143
authVersion=V4
vgroup=default-tx-group
ip=192.168.64.1
'} >
2024-01-10 12:11:41.152 ERROR [26943, ] --- [NettyClientSelector_TMROLE_1_1] i.s.c.r.n.AbstractNettyRemotingClient : 0318
java.io.IOException: Connection reset by peer
at sun.nio.ch.FileDispatcherImpl.read0(Native Method) ~[na:1.8.0_381]
at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39) ~[na:1.8.0_381]
at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223) ~[na:1.8.0_381]
at sun.nio.ch.IOUtil.read(IOUtil.java:192) ~[na:1.8.0_381]
at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:378) ~[na:1.8.0_381]
at io.netty.buffer.PooledByteBuf.setBytes(PooledByteBuf.java:259) ~[netty-buffer-4.1.84.Final.jar:4.1.84.Final]
```
### Ⅲ. Describe what you expected to happen
My local real ip is 193.168.11.122.
<img width="584" alt="image" src="https://github.com/apache/incubator-seata/assets/32316182/60f97a74-1148-4945-a6d5-d1ff96f1fcf2">

### Ⅳ. How to reproduce it (as minimally and precisely as possible)
1. xxx
2. xxx
3. xxx
Minimal yet complete reproducer code (or URL to code):
### Ⅴ. Anything else we need to know?
### Ⅵ. Environment:
- JDK version(e.g. `java -version`): 1.8
- Seata client/server version: 2.0.0
- Database version: mysql8
- OS(e.g. `uname -a`): macOS
- Others:
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [I] Unreal local address obtained by io.seata.common.util.NetUtil#getLocalIp [incubator-seata]
Posted by "leizhiyuan (via GitHub)" <gi...@apache.org>.
leizhiyuan commented on issue #6251:
URL: https://github.com/apache/incubator-seata/issues/6251#issuecomment-1909125759
<img width="662" alt="image" src="https://github.com/apache/incubator-seata/assets/2684384/9940b028-1f30-4e4b-8aaa-69a28cd6be97">
The current method does not pass this parameter.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [I] Unreal local address obtained by io.seata.common.util.NetUtil#getLocalIp [incubator-seata]
Posted by "bydongxing (via GitHub)" <gi...@apache.org>.
bydongxing commented on issue #6251:
URL: https://github.com/apache/incubator-seata/issues/6251#issuecomment-1884482863
> 是否存在多个网卡?如果存在多个网卡,请确保server的SEATA_IP配置无误或设置一下网卡偏好。 Is there more than one network card? If there are multiple NICs, make sure the server's SEATA_IP is configured correctly. Or set the network card preferences.
是有多个网卡的,server 的SEATA_IP 配置是正确的,`address:193.168.11.122:8092` ,这个就是我本地 server 的地址, 如何设置网卡偏好?我直接使用 hutool 的工具包获取到的是我本地真实的 ip
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [I] Unreal local address obtained by io.seata.common.util.NetUtil#getLocalIp [incubator-seata]
Posted by "slievrly (via GitHub)" <gi...@apache.org>.
slievrly commented on issue #6251:
URL: https://github.com/apache/incubator-seata/issues/6251#issuecomment-1894885091
@bydongxing Referring to the above method, has your issue been resolved?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [I] Unreal local address obtained by io.seata.common.util.NetUtil#getLocalIp [incubator-seata]
Posted by "liuqiufeng (via GitHub)" <gi...@apache.org>.
liuqiufeng commented on issue #6251:
URL: https://github.com/apache/incubator-seata/issues/6251#issuecomment-1884362637
是否存在多个网卡?如果存在多个网卡,请确保server的SEATA_IP配置无误或设置一下网卡偏好。
Is there more than one network card? If there are multiple NICs, make sure the server's SEATA_IP is configured correctly. Or set the network card preferences.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [I] Unreal local address obtained by io.seata.common.util.NetUtil#getLocalIp [incubator-seata]
Posted by "bydongxing (via GitHub)" <gi...@apache.org>.
bydongxing commented on issue #6251:
URL: https://github.com/apache/incubator-seata/issues/6251#issuecomment-1909283858
> > 我试了下还是不行,我看这边调用获取 本地 IP 的时候,并没有把 `preferred-networks` 配置的选项传递进来,不知道是不是我使用的问题? 
> > 
> > 
>
> Is the ip you're talking about the CLIENT side or the SERVER side? 你说的ip到底是client侧还是server侧
client 侧的,就是我本地是多网卡的,然后启动 seata 的 client 的时候,获取到的 IP 有问题的
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [I] Unreal local address obtained by io.seata.common.util.NetUtil#getLocalIp [incubator-seata]
Posted by "funky-eyes (via GitHub)" <gi...@apache.org>.
funky-eyes commented on issue #6251:
URL: https://github.com/apache/incubator-seata/issues/6251#issuecomment-1909202779
> 我试了下还是不行,我看这边调用获取 本地 IP 的时候,并没有把 `preferred-networks` 配置的选项传递进来,不知道是不是我使用的问题? 
>
> 
>
> 
Is the ip you're talking about the CLIENT side or the SERVER side?
你说的ip到底是client侧还是server侧
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [I] Unreal local address obtained by io.seata.common.util.NetUtil#getLocalIp [incubator-seata]
Posted by "bydongxing (via GitHub)" <gi...@apache.org>.
bydongxing commented on issue #6251:
URL: https://github.com/apache/incubator-seata/issues/6251#issuecomment-1894965092
我试了下还是不行,我看这边调用获取 本地 IP 的时候,并没有把 `preferred-networks` 配置的选项传递进来,不知道是不是我使用的问题?



--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [I] Unreal local address obtained by io.seata.common.util.NetUtil#getLocalIp [incubator-seata]
Posted by "funky-eyes (via GitHub)" <gi...@apache.org>.
funky-eyes commented on issue #6251:
URL: https://github.com/apache/incubator-seata/issues/6251#issuecomment-1909287233
client侧并没有这个配置,怪不得没有生效,请问这个ip不对的情况下,对server二阶段的下发产生了影响吗?
The client side doesn't have this configuration, so no wonder it didn't take effect, did this ip not being correct have an effect on the server second stage down?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [I] Unreal local address obtained by io.seata.common.util.NetUtil#getLocalIp [incubator-seata]
Posted by "leizhiyuan (via GitHub)" <gi...@apache.org>.
leizhiyuan commented on issue #6251:
URL: https://github.com/apache/incubator-seata/issues/6251#issuecomment-1909190162
那看代码,没有别的地方会获取这个配置来传递到netutil方法的。
这个你看看走到你之前debug 为空入参的时候,这个调用栈是怎么样的
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [I] Unreal local address obtained by io.seata.common.util.NetUtil#getLocalIp [incubator-seata]
Posted by "bydongxing (via GitHub)" <gi...@apache.org>.
bydongxing commented on issue #6251:
URL: https://github.com/apache/incubator-seata/issues/6251#issuecomment-1909176730
> please debug this line
>
> ```
> String preferredNetworks = ConfigurationFactory.getInstance().getConfig(REGISTRY_PREFERED_NETWORKS);
> if (StringUtils.isNotBlank(preferredNetworks)) {
> XID.setIpAddress(NetUtil.getLocalIp(preferredNetworks.split(REGEX_SPLIT_CHAR)));
> } else {
> XID.setIpAddress(NetUtil.getLocalIp());
> }
> ```
>
> it seems need to
>
> ```
> String REGISTRY_PREFERED_NETWORKS = ConfigurationKeys.FILE_ROOT_REGISTRY + ".preferredNetworks";
> ```
>
> not preferred-networks
我在这边打断点,好像并没有调用这个方法呢?

--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [I] Unreal local address obtained by io.seata.common.util.NetUtil#getLocalIp [incubator-seata]
Posted by "funky-eyes (via GitHub)" <gi...@apache.org>.
funky-eyes commented on issue #6251:
URL: https://github.com/apache/incubator-seata/issues/6251#issuecomment-1891241039
See the `preferred-networks` configuration item in this configuration file https://github.com/apache/incubator-seata/blob/2.x/server/src/main/resources/application.example.yml
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org