happyfish100 / happyfish100/fastdfs-client-java
fastdfs配置外网应用访问内网fastdfs服务器
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.6k
- Forks
- 891
- PR merge metrics
- No merged PRs in 30d
Description
当集成fastdfs-client后,将应用配置到阿里云上面,fastdfs服务器在内网,然后配置fdfs.tracker-list为外网ip, 但是23000端口还是读取到了内网IP.
com.github.tobato.fastdfs.proto.AbstractFdfsCommand.send(AbstractFdfsCommand.java:74) - 发出交易请求..报文头为ProtoHead [contentLength=0, cmd=101, status=0]
[17:16:41:037] [DEBUG] - com.github.tobato.fastdfs.proto.AbstractFdfsCommand.send(AbstractFdfsCommand.java:75) - 交易参数为[]
[17:16:41:050] [DEBUG] - com.github.tobato.fastdfs.proto.AbstractFdfsCommand.receive(AbstractFdfsCommand.java:99) - 服务端返回报文头ProtoHead [contentLength=40, cmd=100, status=0]
[17:16:41:053] [DEBUG] - com.github.tobato.fastdfs.proto.mapper.ObjectMataData.dumpObjectMataData(ObjectMataData.java:201) - dump class=com.github.tobato.fastdfs.domain.StorageNode
[17:16:41:053] [DEBUG] - com.github.tobato.fastdfs.proto.mapper.ObjectMataData.dumpObjectMataData(ObjectMataData.java:202) - ----------------------------------------
[17:16:41:054] [DEBUG] - com.github.tobato.fastdfs.proto.mapper.ObjectMataData.dumpObjectMataData(ObjectMataData.java:204) - FieldMataData [field=groupName, index=0, max=16, size=16, offsize=0]
[17:16:41:054] [DEBUG] - com.github.tobato.fastdfs.proto.mapper.ObjectMataData.dumpObjectMataData(ObjectMataData.java:204) - FieldMataData [field=ip, index=1, max=15, size=15, offsize=16]
[17:16:41:054] [DEBUG] - com.github.tobato.fastdfs.proto.mapper.ObjectMataData.dumpObjectMataData(ObjectMataData.java:204) - FieldMataData [field=port, index=2, max=0, size=8, offsize=31]
[17:16:41:054] [DEBUG] - com.github.tobato.fastdfs.proto.mapper.ObjectMataData.dumpObjectMataData(ObjectMataData.java:204) - FieldMataData [field=storeIndex, index=3, max=0, size=1, offsize=39]
[17:16:41:055] [DEBUG] - com.github.tobato.fastdfs.proto.mapper.FdfsParamMapper.mapByIndex(FdfsParamMapper.java:94) - 设置值是 FieldMataData [field=groupName, index=0, max=16, size=16, offsize=0]group1
[17:16:41:087] [DEBUG] - org.apache.commons.beanutils.ConvertUtilsBean.convert(ConvertUtilsBean.java:418) - Convert string 'group1' to class 'java.lang.String'
[17:16:41:089] [DEBUG] - com.github.tobato.fastdfs.proto.mapper.FdfsParamMapper.mapByIndex(FdfsParamMapper.java:94) - 设置值是 FieldMataData [field=ip, index=1, max=15, size=15, offsize=16]192.168.99.223
[17:16:41:089] [DEBUG] - org.apache.commons.beanutils.ConvertUtilsBean.convert(ConvertUtilsBean.java:418) - Convert string '192.168.99.223' to class 'java.lang.String'
[17:16:41:089] [DEBUG] - com.github.tobato.fastdfs.proto.mapper.FdfsParamMapper.mapByIndex(FdfsParamMapper.java:94) - 设置值是 FieldMataData [field=port, index=2, max=0, size=8, offsize=31]23000
[17:16:41:090] [DEBUG] - org.apache.commons.beanutils.ConvertUtilsBean.convert(ConvertUtilsBean.java:418) - Convert string '23000' to class 'int'
[17:16:41:090] [DEBUG] - com.github.tobato.fastdfs.proto.mapper.FdfsParamMapper.mapByIndex(FdfsParamMapper.java:94) - 设置值是 FieldMataData [field=storeIndex, index=3, max=0, size=1, offsize=39]0
[17:16:41:090] [DEBUG] - org.apache.commons.beanutils.ConvertUtilsBean.convert(ConvertUtilsBean.java:418) - Convert string '0' to class 'byte'
[17:16:41:092] [DEBUG] - com.github.tobato.fastdfs.conn.DefaultConnection.(DefaultConnection.java:48) - connect to /192.168.99.223:23000 soTimeout=3000 connectTimeout=6000
[17:16:42:582] [DEBUG] - com.alibaba.dubbo.remoting.exchange.support.header.HeartbeatHandler.received(HeartbeatHandler.java:74) - [DUBBO] Received heartbeat from remote channel /113.118.199.215:62212, cause: The channel has no data-transmission exceeds a heartbeat period: 60000ms, dubbo version: 2.6.2, current host: 47.89.31.99
[17:16:44:568] [DEBUG] - org.apache.zookeeper.ClientCnxn$SendThread.readResponse(ClientCnxn.java:742) - Got ping response for sessionid: 0x1668201744503d6 after 13ms
[17:16:47:094] [ERROR] - com.bessky.erp.logistics.api.tengjia.GetTengJiaCall.submitOrder(GetTengJiaCall.java:168) - 无法获取服务端连接资源:can't create connection to/192.168.99.223:23000
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the tracker response mapping shown in AbstractFdfsCommand and the StorageNode fields logged by FdfsParamMapper, then follow the connection created in DefaultConnection. Reproduce the fdfs.tracker-list configuration and verify that the storage endpoint returned for port 23000 is usable from the external application rather than the private address.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100