siaron edited a comment on issue #5233:
URL: https://github.com/apache/apisix/issues/5233#issuecomment-943328645


   > use `dig uaa-service` and show the result, and proveide the environment 
info
   
   ```
   apisix version (cmd: apisix version): 2.10.0
   OS (cmd: uname -a): macos
   OpenResty / Nginx version (cmd: nginx -V or openresty -V):
   etcd version, if have (cmd: run curl http://127.0.0.1:9090/v1/server_info to 
get the info from server-info API):
   ```
   {
   "version": "2.10.0",
   "hostname": "localhost",
   "etcd_version": "3.5.0",
   "up_time": 48,
   "id": "c1141ba7-70c4-41a9-8d9d-c54c70ac2912",
   "boot_time": 1634215727,
   "last_report_time": 1634215727
   }
   ```
   apisix-dashboard version, if have:
   the plugin runner version, if the issue is about a plugin runner (cmd: 
depended on the kind of runner):
   luarocks version, if the issue is about installation (cmd: luarocks 
--version):
   ```
   
   ### 复现方式
   - discovery config
   ```
   discovery:                       # service discovery center
   #  dns:
   #    servers:
   #      - "127.0.0.1:8600"         # use the real address of your dns server
    nacos:
     host:                        # it's possible to define multiple eureka 
hosts addresses of the same eureka cluster.
       - "http://nacos:[email protected]:8848";
     prefix: "/nacos/v1/"
     fetch_interval: 3    # default 30 sec
     weight: 10           # default 100
     timeout:
       connect: 2000       # default 2000 ms
       send: 2000          # default 2000 ms
       read: 5000          # default 5000 ms
   ```
   - nacos注册服务为
   
![image](https://user-images.githubusercontent.com/13701232/137320809-ac9294d9-6b43-4072-bc69-61601983eb8f.png)
   - host 配置
   ```
   localhost:apisix-2.10.0 xxx$ cat /etc/hosts
   127.0.0.1 uaa-service uaa-service-host
   ```
   - 路由配置
   ```
   {
     "uri": "/uaa/*",
     "name": "uaa服务",
     "methods": [
       "GET",
       "POST",
       "PUT",
       "DELETE",
       "PATCH",
       "HEAD",
       "OPTIONS",
       "CONNECT",
       "TRACE"
     ],
     "upstream_id": "376959049259811901",
     "status": 1
   }
   ```
   - 上游服务
   ```
   {
     "timeout": {
       "connect": 6,
       "send": 6,
       "read": 6
     },
     "type": "roundrobin",
     "scheme": "http",
     "discovery_type": "nacos",
     "pass_host": "pass",
     "name": "uaa2",
     "service_name": "uaa-service",
     "keepalive_pool": {
       "idle_timeout": 60,
       "requests": 1000,
       "size": 320
     }
   }
   ```
   - 调用服务
   
![image](https://user-images.githubusercontent.com/13701232/137321223-40b1090d-50c0-4317-9a18-2258688ec8a1.png)
   
   - 测试
   ```
   localhost:apisix-2.10.0 xielongwang$ ping uaa-service-host
   PING uaa-service (127.0.0.1): 56 data bytes
   64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.147 ms
   64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.249 ms
   64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.269 ms
   64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.109 ms
   64 bytes from 127.0.0.1: icmp_seq=4 ttl=64 time=0.232 ms
   64 bytes from 127.0.0.1: icmp_seq=5 ttl=64 time=0.258 ms
   64 bytes from 127.0.0.1: icmp_seq=6 ttl=64 time=0.371 ms
   64 bytes from 127.0.0.1: icmp_seq=7 ttl=64 time=0.239 ms
   ^C
   --- uaa-service ping statistics ---
   8 packets transmitted, 8 packets received, 0.0% packet loss
   round-trip min/avg/max/stddev = 0.109/0.234/0.371/0.074 ms
   localhost:apisix-2.10.0 xielongwang$ dig uaa-service-host
   
   ; <<>> DiG 9.10.6 <<>> uaa-service-host
   ;; global options: +cmd
   ;; Got answer:
   ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 55283
   ;; flags: qr rd ra ad; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
   
   ;; QUESTION SECTION:
   ;uaa-service-host.           IN      A
   
   ;; Query time: 86 msec
   ;; SERVER: 192.168.31.1#53(192.168.31.1)
   ;; WHEN: Thu Oct 14 20:54:55 CST 2021
   ;; MSG SIZE  rcvd: 34
   
   localhost:apisix-2.10.0 xielongwang$
   ```
   - 日志打印
   ```
   2021/10/14 20:49:04 [error] 71097#853898: *2184 [lua] balancer.lua:353: 
run(): failed to set server peer [uaa-service-host:30101] err: no host allowed 
while connecting to upstream, client: 127.0.0.1, server: _, request: "GET 
/uaa/test/hello HTTP/1.1", host: "127.0.0.1:9080"
   ```
   - 相关 issues
   https://github.com/openresty/lua-resty-core/issues/45
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to