浏览器不能访问部署于服务器的dashboard

  • nebula 版本:V2.0.1
  • 部署方式(分布式 / 单机 / Docker / DBaaS):单机

背景信息:

1、nebula graph三大进程部署在服务器,(正常运行)
2、node-exporter、nebula-stats-exporter、prometheus、nebula-http-gateway部署于服务器(正常运行,浏览器可通过9100、9200、9090、8090端口访问)
3、nebula-graph-dashboard部署于服务器

问题描述:

1、在服务器上,通过 npm run start启动dashboard,在本地浏览器(非服务器)访问 IP:7001,如下结果
image

2、通过npm run dev启动dashboard,有图标显示,但未出现登录界面

  • 针对该问题,查看了浏览器的访问情况,应该是 7003服务器默认转发到本地的7777端口(webpack)
    image

  • 据此进行了相关尝试:尝试修改 dashboard包中的:./config/webpack.dev.ts./config/config.default.ts,并 执行 npm install,之后通过npm run dev启动dashboard,通过本地浏览器访问,还是上图的错误。

请问下是什么原因,以及如何修改?

其他相关信息见问题:浏览器连接dashboard,提示『Failed:dial tcp:0: connect: can't assign requested address』 - #22,来自 oliver

部署服务器上的项目执行npm run start的之前有没有执行npm run tsc?

没看到执行该命令的说明,之前没执行

以下是执行后再启动
image

之后,在本地通过浏览器 IP:7003的方式访问,得到下面的结果

有改动过文件吗?

只有下面的改动

  • 修改文件static/custom.json,配置Graph服务的IP地址和端口

能提供下你当前的dashboard部署的环境嘛? 它安装的依赖默认的liunx-amd64的

需要哪些信息,以下是部分系统信息

LSB Version:	:base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch
Distributor ID:	CentOS
Description:	CentOS release 6.6 (Final)
Release:	6.6
Codename:	Final

Linux 2.6.32-642.6.2.el6.x86_64 #1 SMP Wed Oct 26 06:52:09 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

重新安装依赖试试,npm install, npm run tsc,npm run build,npm run start这样一套走下试试

通过新安装包,执行 npm run build有如下报错

> nebula-graph-dashboard@1.0.0 build ~/nebula-dashboard-1.0.0
> webpack --config config/webpack.prod.ts

Hash: 5424fd3055cf0584006f
Version: webpack 4.46.0
Time: 16959ms
Built at: 08/27/2021 10:06:39 AM
 4 assets
Entrypoint app = manifest.c2876db6185cc78b37b7.js vendors.5c4b3c98728a51f4613f.js app.cd4868f1bb65543b5f2e.js
[0] multi ./node_modules/antd-dayjs-webpack-plugin/src/init-dayjs-webpack-plugin-entry.js ./app/assets/index.tsx 40 bytes {app} [built]
[1] ./locale-data/complete.js (ignored) 15 bytes {app} [built]
[/MKj] ./node_modules/react-redux/es/index.js + 23 modules 76.1 KiB {vendors} [built]
    |    24 modules
[55Ip] ./node_modules/react-router-dom/esm/react-router-dom.js + 5 modules 66 KiB {vendors} [built]
    |    6 modules
[6QKu] ./node_modules/intl-messageformat/lib/index.js + 8 modules 129 KiB {vendors} [built]
    |    9 modules
[8XRh] ./node_modules/rc-motion/es/index.js + 12 modules 29.1 KiB {vendors} [built]
    |    13 modules
[Gf7F] ./app/assets/index.tsx + 13 modules 40.3 KiB {app} [built]
    | ./app/assets/index.tsx 385 bytes [built]
    | ./app/assets/store/index.ts 395 bytes [built]
    | ./app/assets/store/models/index.ts 129 bytes [built]
    | ./app/assets/store/models/app.ts 1.98 KiB [built]
    | ./app/assets/store/models/machine.ts 6.66 KiB [built]
    | ./app/assets/store/models/nebula.ts 2.78 KiB [built]
    | ./app/assets/store/models/service.ts 3.08 KiB [built]
    | ./app/assets/store/models/setting.ts 429 bytes [built]
    | ./app/assets/config/service.ts 537 bytes [built]
    | ./app/assets/utils/promQL.ts 12.3 KiB [built]
    | ./app/assets/utils/dashboard.ts 5.68 KiB [built]
    | ./app/assets/utils/service.ts 2.05 KiB [built]
    | ./app/assets/utils/http.ts 2.38 KiB [built]
    | ./app/assets/utils/stat.ts 1.46 KiB [built]
[KQm4] ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js + 2 modules 787 bytes {vendors} [built]
    |    3 modules
[LK+K] ./node_modules/@babel/runtime/helpers/esm/createSuper.js + 2 modules 1.35 KiB {vendors} [built]
    |    3 modules
[ODXe] ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 1 modules 1.01 KiB {vendors} [built]
    |    2 modules
[Ob6w] ./app/assets/App.tsx 355 bytes {app} [built] [failed] [1 error]
[YuTi] (webpack)/buildin/module.js 497 bytes {vendors} [built]
[tsqr] ./node_modules/antd/es/message/index.js + 72 modules 187 KiB {vendors} [built]
    |    73 modules
[yLpj] (webpack)/buildin/global.js 472 bytes {vendors} [built]
    + 863 hidden modules

ERROR in ./app/assets/App.tsx 17:15
Module parse failed: Unexpected token (17:15)
File was processed with these loaders:
 * ./node_modules/babel-loader/lib/index.js
 * ./node_modules/ts-loader/index.js
You may need an additional loader to handle the result of these loaders.
|
| class App extends React.Component {
>   currentLocale;
|
|   constructor(props) {
 @ ./app/assets/index.tsx 5:0-24 9:57-60
 @ multi ./node_modules/antd-dayjs-webpack-plugin/src/init-dayjs-webpack-plugin-entry.js ./app/assets/index.tsx
Child HtmlWebpackCompiler:
     1 asset
    Entrypoint HtmlWebpackPlugin_0 = __child-HtmlWebpackPlugin_0
    [LKO8] ./node_modules/html-webpack-plugin/lib/loader.js!./app/assets/index.html 2.79 KiB {HtmlWebpackPlugin_0} [built]
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! nebula-graph-dashboard@1.0.0 build: `webpack --config config/webpack.prod.ts`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the nebula-graph-dashboard@1.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/apps/.npm/_logs/2021-08-27T02_06_39_179Z-debug.log

日志中涉及的2021-08-27T02_06_39_179Z-debug.log文件 错误内容为:

16 verbose Linux 2.6.32-642.6.2.el6.x86_64
17 verbose argv "/usr/local/lib/nodejs/bin/node" "/usr/local/lib/nodejs/bin/npm" "run" "build"
18 verbose node v14.17.5
19 verbose npm  v6.14.14
20 error code ELIFECYCLE
21 error errno 2
22 error nebula-graph-dashboard@1.0.0 build: `webpack --config config/webpack.prod.ts`
22 error Exit status 2
23 error Failed at the nebula-graph-dashboard@1.0.0 build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 2, true ]

当前环境的node版本是多少?

node v14.17.5
npm v6.14.14

看起来版本没问题呀,是不是安装依赖时候有缓存先 rm -rf node_modules/ , rm -rf package-lock.json,然后再执行一遍上面的流程看看

build时,还是一样的错误

启动后,连接还是一样的提示

该问题在你们环境上可以重现吗:joy:

我知道了 你是下载的安装tar包是吧 那可能是依赖机器不一样,你要直接下载 https://github.com/vesoft-inc/nebula-dashboard.git ,自己安装依赖然后build start

之前下载的github的release包。

通过刚才的连接下载了 1.0.1版本,运行后,登录提示信息如下

(第一次能进入,点击退出,再输入账号、密码是这样的提示)

有没有配置那个啊 老哥

格式别错了

image

配置了
image

当前部署dashboard的环境能访问你所配置的那个ip吗?可以测试下

浙ICP备20010487号