ShuLian1984 commented on issue #9847:
URL: https://github.com/apache/apisix/issues/9847#issuecomment-1637317039

   docker-compose.yml
   ```
   version: '2.4'
   services:
     etcd:
       container_name: etcd
       image: bitnami/etcd:3.5.9-2
       restart: always
       environment:
         ETCD_ENABLE_V2: "true"
         ALLOW_NONE_AUTHENTICATION: "yes"
         ETCD_ADVERTISE_CLIENT_URLS: "http://etcd:2379";
         ETCD_LISTEN_CLIENT_URLS: "http://0.0.0.0:2379";
       volumes:
         - "./data:/bitnami/etcd/data"
       ports:
         - "2379:2379/tcp"
       networks:
         apisix:
           ipv4_address: 172.64.0.2
   
     apisix:
       container_name: apisix
       image: apache/apisix:3.3.0
       restart: always
       environment:
         - TZ=Asia/Shanghai
       volumes:
         - ./config/apisix.yaml:/usr/local/apisix/conf/config.yaml:ro
         - ./apisix:/usr/local/apisix/apisix
         - ./logs:/usr/local/apisix/logs:rw
       ports:
         - "19180:9180/tcp" # admin api port
         - "19080:9080/tcp" # http port
         - "19091:9091/tcp" # Prometheus port
         - "19443:9443/tcp" # https port
         - "19092:9092/tcp" # control port
         - "19100-19120:9100-9120/tcp" # tcp port
       depends_on:
         - etcd
       networks:
         apisix:
           ipv4_address: 172.64.0.3
   
     apisix-dashboard:
       container_name: apisix-dashboard
       image: apache/apisix-dashboard:latest
       restart: always
       environment:
         - TZ=Asia/Shanghai
       volumes:
         - ./config/dashboard.yaml:/usr/local/apisix-dashboard/conf/conf.yaml:ro
         - ./config/schema.json:/usr/local/apisix-dashboard/conf/schema.json:ro
         - ./logs:/usr/local/apisix-dashboard/logs:rw
       ports:
         - "19000:9000/tcp" # Dashboard port
       depends_on:
         - etcd
         - apisix
       networks:
         apisix:
           ipv4_address: 172.64.0.4
   
   # docker network create apisix_net --subnet 172.64.0.0/16 --gateway 
172.64.0.1
   networks:
     apisix:
       external:
         name: apisix_net
   ```
   ---
   my config.yaml
   ```
   apisix:
     node_listen: 9080
     enable_ipv6: false
     enable_control: true
     control:
       ip: "0.0.0.0"
       port: 9092
     stream_proxy:
       only: false
       tcp:
         - 9100
         - 9101
         - 9102
         - 9103
         - 9104
         - 9105
         - 9106
         - 9107
         - 9108
         - 9109
         - 9110
         - 9111
         - 9112
         - 9113
         - 9114
         - 9115
         - 9116
         - 9117
         - 9118
         - 9119
         - 9120
     # extra_lua_path: "/usr/local/apisix/apisix/ext_plugins/?.lua" 
   
   deployment:
     role: traditional
     role_traditional:
       config_provider: etcd
     admin:
       allow_admin:
         - 0.0.0.0/0
       admin_key:
         - name: "admin"
           key: edd1c9f034335f136f87ad84b625c8f1
           role: admin
         - name: "viewer"
           key: 4054f7cf07e344346cd3f287985e76a2
           role: viewer
   
       enable_admin_cors: true
       admin_listen:
         ip: 0.0.0.0
         port: 9180
   
     etcd:
       host:
         - "http://etcd:2379";
       prefix: "/apisix"
       timeout: 30
   
   plugins:
   - server-info
   - skywalking
   - skywalking-logger
   
   plugin_attr:
   
     prometheus:
       export_uri: /apisix/metrics
       export_addr:
         ip: "0.0.0.0"
         port: 9091
     skywalking:
       service_name: dev::APISIX
       service_instance_name: 10.10.85.14
       endpoint_addr: http://10.10.85.14:12800
   
   discovery:
     nacos:
       host:
         - "http://nacos:[email protected]:8848";
       prefix: "/nacos/v1/"
       fetch_interval: 30
       weight: 100
       timeout:
         connect: 2000
         send: 2000
         read: 5000
   ```
   ---
   Route information obtained from the admin API
   
   ```
   {
       "total": 5,
       "list": [
           {
               "createdIndex": 3,
               "modifiedIndex": 1973,
               "key": "/apisix/routes/"
           },
           {
               "createdIndex": 1470,
               "value": {
                   "id": "468393803724620526",
                   "uri": "/device-transport/mqtt/*",
                   "upstream": {
                       "pass_host": "pass",
                       "scheme": "http",
                       "nodes": [
                           {
                               "host": "10.10.19.179",
                               "port": 9988,
                               "weight": 1
                           }
                       ],
                       "timeout": {
                           "send": 6,
                           "read": 6,
                           "connect": 6
                       },
                       "type": "roundrobin",
                       "keepalive_pool": {
                           "requests": 1000,
                           "size": 320,
                           "idle_timeout": 60
                       }
                   },
                   "name": "device-transport",
                   "status": 1,
                   "create_time": 1688714062,
                   "plugins": {
                       "ucsp-auth": {
                           "secret": "7b5cde0a41bf4588983e7e1685492b29",
                           "key": "1234567890abcdef",
                           "secret_map": {
                               "100080012": "56e608c295d4415b88938e290c507953",
                               "970010016": "7b5cde0a41bf4588983e7e1685492b29"
                           },
                           "redis": {
                               "idle_time": 20000,
                               "redis_host": "10.10.85.14",
                               "redis_password": "ubt83474428",
                               "redis_port": "19100",
                               "pool_size": 20,
                               "redis_ssl": "",
                               "redis_ssl_verify": "",
                               "redis_timeout": 1000,
                               "redis_database": "0"
                           },
                           "_meta": {
                               "disable": false
                           },
                           "iv": "1234567890123456"
                       }
                   },
                   "methods": [
                       "GET",
                       "POST",
                       "PUT",
                       "DELETE",
                       "PATCH",
                       "HEAD",
                       "OPTIONS",
                       "CONNECT",
                       "TRACE",
                       "PURGE"
                   ],
                   "update_time": 1689325213
               },
               "key": "/apisix/routes/468393803724620526",
               "modifiedIndex": 1918
           },
           {
               "createdIndex": 1659,
               "value": {
                   "update_time": 1689304188,
                   "id": "468965470297391854",
                   "status": 0,
                   "upstream": {
                       "pass_host": "pass",
                       "scheme": "http",
                       "nodes": [
                           {
                               "host": "10.10.85.14",
                               "port": 8848,
                               "weight": 1
                           }
                       ],
                       "timeout": {
                           "send": 6,
                           "read": 6,
                           "connect": 6
                       },
                       "type": "roundrobin",
                       "keepalive_pool": {
                           "requests": 1000,
                           "size": 320,
                           "idle_timeout": 60
                       }
                   },
                   "create_time": 1689054802,
                   "uri": "/nacos/*",
                   "methods": [
                       "GET",
                       "POST",
                       "PUT",
                       "DELETE",
                       "PATCH",
                       "HEAD",
                       "OPTIONS",
                       "CONNECT",
                       "TRACE",
                       "PURGE"
                   ],
                   "name": "nacos"
               },
               "key": "/apisix/routes/468965470297391854",
               "modifiedIndex": 1810
           },
           {
               "createdIndex": 1751,
               "value": {
                   "id": "469259980801835758",
                   "uri": "/usercenter/*",
                   "name": "usercenter-local",
                   "upstream_id": "469259855744467694",
                   "status": 1,
                   "host": "ucsp-dev.ubtrobot.com",
                   "methods": [
                       "GET",
                       "POST",
                       "PUT",
                       "DELETE",
                       "PATCH",
                       "HEAD",
                       "OPTIONS",
                       "CONNECT",
                       "TRACE",
                       "PURGE"
                   ],
                   "create_time": 1689230344,
                   "update_time": 1689325903
               },
               "key": "/apisix/routes/469259980801835758",
               "modifiedIndex": 1933
           },
           {
               "createdIndex": 1752,
               "value": {
                   "update_time": 1689325908,
                   "id": "469260008534573806",
                   "status": 1,
                   "uri": "/usercenter/*",
                   "create_time": 1689230361,
                   "methods": [
                       "GET",
                       "POST",
                       "PUT",
                       "DELETE",
                       "PATCH",
                       "HEAD",
                       "OPTIONS",
                       "CONNECT",
                       "TRACE",
                       "PURGE"
                   ],
                   "upstream_id": "469259940989502190",
                   "name": "usercenter"
               },
               "key": "/apisix/routes/469260008534573806",
               "modifiedIndex": 1934
           }
       ]
   }
   ```
   ---
   Access Results
   ```
   [dev@bigdata-304 apisix]$ curl 
http://10.10.85.14:19080/device-transport/mqtt/v1/test/gateway
   {"error_msg":"404 Route Not Found"}
   ```
   ---
   apisix access.log
   ```
   10.10.85.14 - - [17/Jul/2023:11:06:35 +0800] 10.10.85.14:19080 "GET 
/device-transport/mqtt/v1/test/gateway HTTP/1.1" 404 47 0.000 "-" "curl/7.29.0" 
- - - "http://10.10.85.14:19080";
   ```
   the error.log no records for this request.


-- 
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