You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "WarkeeperY (GitHub)" <gi...@apache.org> on 2018/12/29 09:43:33 UTC

[GitHub] [incubator-dubbo-ops] WarkeeperY opened issue #209: dubbo-admin 是否能够分开部署?

我看到dubbo-admin是前后端分离的,但是在部署时,似乎是将frontend打包成静态文件,放到backend中进行打包部署。
因此前端访问接口中与后端交互时,访问地址只需要相对路径如“/service”(因为前端静态资源和后端都在同一个容器里)。
但是,如果前端的静态资源部署在与后端不同的ip地址上的server(如nginx)时,似乎是只有大规模的更改前端代码中访问后端的地址时才能够做到。
请问是否的确如此?如果是,未来是否有对此相关的更新计划?

[ Full content available at: https://github.com/apache/incubator-dubbo-ops/issues/209 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo-ops] nzomkxia commented on issue #209: dubbo-admin 是否能够分开部署?

Posted by "nzomkxia (GitHub)" <gi...@apache.org>.
你需要的前后端分离的部署形式是什么样的?最好可以给一个参考的案例

[ Full content available at: https://github.com/apache/incubator-dubbo-ops/issues/209 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo-ops] nzomkxia commented on issue #209: dubbo-admin 是否能够分开部署?

Posted by "nzomkxia (GitHub)" <gi...@apache.org>.
你好,可以分开部署,配置文件在[这里](https://github.com/apache/incubator-dubbo-ops/blob/develop/dubbo-admin-frontend/config/index.js#L15), 可以修改这里的`target`为实际后端服务暴露的地址,已经做了跨域处理

[ Full content available at: https://github.com/apache/incubator-dubbo-ops/issues/209 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo-ops] nzomkxia closed issue #209: dubbo-admin 是否能够分开部署?

Posted by "nzomkxia (GitHub)" <gi...@apache.org>.
[ issue closed by nzomkxia ]

[ Full content available at: https://github.com/apache/incubator-dubbo-ops/issues/209 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org


[GitHub] [incubator-dubbo-ops] WarkeeperY commented on issue #209: dubbo-admin 是否能够分开部署?

Posted by "WarkeeperY (GitHub)" <gi...@apache.org>.
那个我理解只能对开发环境生效

[ Full content available at: https://github.com/apache/incubator-dubbo-ops/issues/209 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo-ops] nzomkxia commented on issue #209: dubbo-admin 是否能够分开部署?

Posted by "nzomkxia (GitHub)" <gi...@apache.org>.
* base url确实是一种用法,不过不需要每个里面都加上,可以在`http-common.js`里面统一修改  
* `config/index.js`中,dev模式已经加了跨域和proxy转发,你可以尝试在build模式下也加上类似的配置
* 如果前后端的访问不在一个域名,那类似的配置和跨域不可避免,框架本身已经提供了多种配置方式,这部分目前不会做其他的支持和改动

[ Full content available at: https://github.com/apache/incubator-dubbo-ops/issues/209 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo-ops] WarkeeperY commented on issue #209: dubbo-admin 是否能够分开部署?

Posted by "WarkeeperY (GitHub)" <gi...@apache.org>.
> > 那个我理解只能对开发环境生效
> 
> 是的,在当前的npm里面是`dev`模式,是否可以满足你的需求?或者你需要的前后端分离的部署形式是什么样的?最好可以给一个参考的案例

是这样的,我们内网有一台专门用于部署前端项目的机器(只给了node环境),而后端则需要部署在其他机器上,所以如果直接npm run build,并分离部署dubbo-admin时,我猜测会因为前端只会尝试访问10.xxx.xxx.1:8080/service(假设该地址是前端机器的内网ip),而实际后端部署ip是10.xxx.xxx.2:8083。

目前我用了一种比较笨拙的方法(我前端技术掌握的比较少):将dubbo-admin的前端所有发ajax时请求的url前加了个全局静态变量baseUrl  比如:  
```
 this.$axios.get('/service', {
        params: {
          pattern: 'serviceName',
          filter: '*'
        }
      })
```
 ——>
```
this.$axios.get(baseUrl+'/service', {
        params: {
          pattern: 'serviceName',
          filter: '*'
        }
      })
```  
,并将baseUrl设定为10.xxx.xxx.2:8083(后端服务需要允许跨域)

希望以后dubbo-admin部署方式能够更加灵活一些吧

[ Full content available at: https://github.com/apache/incubator-dubbo-ops/issues/209 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo-ops] nzomkxia commented on issue #209: dubbo-admin 是否能够分开部署?

Posted by "nzomkxia (GitHub)" <gi...@apache.org>.
> 那个我理解只能对开发环境生效

是的,在当前的npm里面是`dev`模式,不过应该可以满足的你的需求

[ Full content available at: https://github.com/apache/incubator-dubbo-ops/issues/209 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo-ops] nzomkxia commented on issue #209: dubbo-admin 是否能够分开部署?

Posted by "nzomkxia (GitHub)" <gi...@apache.org>.
> 那个我理解只能对开发环境生效

是的,在当前的npm里面是`dev`模式,是否可以满足你的需求?或者你需要的前后端分离的部署形式是什么样的?最好可以给一个参考的案例

[ Full content available at: https://github.com/apache/incubator-dubbo-ops/issues/209 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org