我在“基于Docker容器的部署”后,在文件“confi g.ts”中设置了:baseURL,websocketUR...

Completed

Comments

26 comments

  • DJI Developer Support
    流程没有错,截图看下浏览器控制台的内容。
    0
    Comment actions Permalink
  • cjf

    以下是登录界面

    0
    Comment actions Permalink
  • cjf

    以下是pilot-index.vue文件内容截图

    0
    Comment actions Permalink
  • cjf

    “你打印一下api模块的参数看看”--这个参数在哪里打印?

    0
    Comment actions Permalink
  • DJI Developer Support
    你现在点击登录按钮,再截图看看network,怀疑是后端服务都没有启动。 你这之前的network截图没有显示请求啊。 ![](https://sdk-forum.dji.net/hc/user_images/9-Qd2lTbvQraltntVgtaFg.jpeg)
    0
    Comment actions Permalink
  • cjf

    0
    Comment actions Permalink
  • cjf

    我只开了遥控器,无人机没开,不影响吧

    0
    Comment actions Permalink
  • DJI Developer Support
    没影响,看截图这个接口确实没有响应数据。你检查下后端启动成功了没有。
    0
    Comment actions Permalink
  • cjf

    怎么看后端启动成功没有?另外,我发现登录的时候有日志提示错误。

    0
    Comment actions Permalink
  • DJI Developer Support
    进到服务器,执行sudo docker ps -a 打印一下,看后端服务的容器是在运行状态还是已经退出了,退出了就得看看启动日志,重启启动这个容器。
    0
    Comment actions Permalink
  • cjf

    这是sudo docker ps -a后的截图,好像是退出了,重新启动还这样。

    我的执行步骤是这样:

    1:sudo docker load < cloud_api_sample_docker_v1.0.0.tar

    2:./update_front.sh

    3: ./update_backend.sh

    4: sudo docker-compose up -d

    我怀疑第三步“./update_backend.sh”有问题,每次运行第三步都提示我下载东西,而且得好几分钟,以下是运行状态的截图和执行第三步的截图

    0
    Comment actions Permalink
  • joshua

    您好,我跟您遇到了同样的错误,但是不知道是不是相同的原因,我看到应该一共要启动4个镜像,但是成功启动的只有emqx和nginx。cloud_api_sample和mysql都启动失败了,其中mysql通过看log提示是:find: 'mysql' is not the name of a known user

    0
    Comment actions Permalink
  • DJI Developer Support
    应该都是由于mysql没有启动成功,导致后端无法连接上数据库,因此服务也启动失败。你们如果是用docker包,建议在Ubuntu系统下,不要在windows或者mac,因为会存在路径问题。https://sdk-forum.dji.net/hc/zh-cn/articles/5266563554201?source=search&auth_token=eyJhbGciOiJIUzI1NiJ9.eyJhY2NvdW50X2lkIjo5Nzg4MTcsInVzZXJfaWQiOjM2NTI3NTk5MjczNCwidGlja2V0X2lkIjo2NDk2NywiY2hhbm5lbF9pZCI6NjMsInR5cGUiOiJTRUFSQ0giLCJleHAiOjE2NTYyMTI1NzB9.wLQXAUqMIHRCts70pQwY0nwyoEn7PEJ0HBCPnd2GU0U mysql报错:'mysql' is not the name of a known user。 尝试下修改docker-compose.yml 文件,注释掉下图中红框的部分再重新执行这个文件。 ![](https://djisdksupport.zendesk.com/attachments/token/VnZfyBuLANH5Cx0b5xz5CyYtA/?name=image.png)
    1
    Comment actions Permalink
  • htttt

    请问怎么进的浏览器控制台

    0
    Comment actions Permalink
  • Phillweston

    遇到同样的问题,根据DJI官方最新的回复解决了mysql容器启动的问题,但是cloud_api_sample仍然无法正常启动

    0
    Comment actions Permalink
  • Phillweston

    Caused by: java.net.ConnectException: Connection refused (Connection refused)

    at java.base/java.net.PlainSocketImpl.socketConnect(Native Method) ~[na:na]

    at java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:412) ~[na:na]

    at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:255) ~[na:na]

    at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:237) ~[na:na]

    at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) ~[na:na]

    at java.base/java.net.Socket.connect(Socket.java:609) ~[na:na]

    at com.mysql.cj.protocol.StandardSocketFactory.connect(StandardSocketFactory.java:156) ~[mysql-connector-java-8.0.26.jar!/:8.0.26]

    at com.mysql.cj.protocol.a.NativeSocketConnection.connect(NativeSocketConnection.java:63) ~[mysql-connector-java-8.0.26.jar!/:8.0.26]

    0
    Comment actions Permalink
  • Phillweston

    2022-06-18 19:20:01.532 ERROR 7 --- [           main] c.d.s.s.controller.StorageController     : storageService is null.
    2022-06-18 19:20:01.609  INFO 7 --- [           main] c.a.d.s.b.a.DruidDataSourceAutoConfigure : Init DruidDataSource
    2022-06-18 19:20:02.062 ERROR 7 --- [           main] com.alibaba.druid.pool.DruidDataSource   : init datasource error, url: jdbc:mysql://localhost:3306/cloud_sample?useSSL=false&allowPublicKeyRetrieval=true

    com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure

    The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.

     

    0
    Comment actions Permalink
  • Phillweston

    我自己在Windows和Ubuntu两个环境都测试了一下,Windows下是用WSL2的Docker,Linux下用的是docker-ce,都是一样的报错,感觉不像是环境的问题,很可能是原本的配置文件就有点毛病。

    0
    Comment actions Permalink
  • DJI Developer Support
    ![](https://djisdksupport.zendesk.com/attachments/token/sDwiVnqU0jmIykTnYEFJjTVQc/?name=image.png) 后端报错是mysql 连接不上,你得改连接参数。
    0
    Comment actions Permalink
  • Phillweston

    您好,我这边的docker镜像mysql数据库和cloud api后端都是部署在本地的,IP地址按理来说应该都是localhost也就是本机地址。请问一下需要怎么修改连接参数呢?谢谢

    0
    Comment actions Permalink
  • Phillweston

    我把我的配置文件发一下,您帮忙我看看哪里配置的不对:

    spring:
      application:
        name: cloud-api-sample
      datasource:
        druid:
          type: com.alibaba.druid.pool.DruidDataSource
          driver-class-name: com.mysql.cj.jdbc.Driver
          url: jdbc:mysql://localhost:3306/cloud_sample?useSSL=false&allowPublicKeyRetrieval=true
          username: root
          password: root
          initial-size: 10
          min-idle: 10
          max-active: 20
          max-wait: 60000
    0
    Comment actions Permalink
  • DJI Developer Support
    使用容器部署,容器之间默认是隔离的,容器间通信需要配置网络,不能直接用localhost,所以需要改成本机ip或者mysql容器的主机名。
    0
    Comment actions Permalink
  • Phillweston

    我把url地址改成容器主机名就可以了,谢谢了

    0
    Comment actions Permalink
  • Phillweston

    我注意到在docker.compose.yml配置中有关于network的设置,如下所示:

    networks:
      cloud_service_bridge:
        driver: bridge
        ipam:
          config:
            - subnet: 192.168.6.0/24
    可否用这个bridge给mysql container分配的IP地址代替原本url中的localhost地址呢?谢谢
    0
    Comment actions Permalink
  • DJI Developer Support
    docker 的网络通信可以自己研究的哦。
    0
    Comment actions Permalink

Please sign in to leave a comment.