fiware - 启动 Cosmos-GUI

标签 fiware fiware-cosmos

我想安装 Cosmos。 我已经在单个节点上安装了 Apache-Hadoop 2.6,下一步是安装 cosmos-gui。

所以我按照官方安装指南 - https://github.com/telefonicaid/fiware-cosmos/blob/develop/cosmos-gui/README.md#installation 但是 npm start 命令不起作用。

错误:

fs.js:432
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^
Error: ENOENT, no such file or directory ''
    at Object.fs.openSync (fs.js:432:18)
    at Object.fs.readFileSync (fs.js:289:15)
    at Object.<anonymous> (/home/cosmos-gui/fiware-cosmos/cosmos-gui/src/app.js:55:13)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:906:3

npm ERR! cosmos-gui@0.1.0 start: `node ./src/app.js`
npm ERR! Exit status 8
npm ERR! 
npm ERR! Failed at the cosmos-gui@0.1.0 start script.
npm ERR! This is most likely a problem with the cosmos-gui package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node ./src/app.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls cosmos-gui
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.10.0-229.7.2.el7.x86_64
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "start"
npm ERR! cwd /home/cosmos-gui/fiware-cosmos/cosmos-gui
npm ERR! node -v v0.10.30
npm ERR! npm -v 1.4.21
npm ERR! code ELIFECYCLE
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/cosmos-gui/fiware-cosmos/cosmos-gui/npm-debug.log
npm ERR! not ok code 0

我的conf/cosmos-gui.json

{
  "gui": {
    "port": 443,
    "private_key_file": "",
    "certificate_file": ""
  },
  "clusters": {
    "storage": {
      "endpoint": "127.0.0.1",
      "user": "hadoop",
      "private_key": "12345"
    },
    "computing": {
      "endpoint": "127.0.0.1",
      "user": "hadoop",
      "private_key": "12345"
    }
  },
  "hdfs": {
    "quota": 5,
    "superuser": "hdfs"
  },
  "oauth2": {
    "idmURL": "https://account.lab.fiware.org",
    "client_id": "fromFiLab",
    "client_secret": "fromFiLab",
    "callbackURL": "http://cosmos.lab.fi-ware.org/auth",
    "response_type": "code"
  },
  "mysql": {
    "host": "127.0.0.1",
    "port": 3306,
    "user": "root",
    "password": "12345",
    "database": "cosmos"
  },
  "users_blacklist": [
    "root", "admin", "sysadmin", "localadmin"
  ],
  "log": {
    "file_name": "/var/log/cosmos/cosmos-gui/cosmos-gui.log",
    "date_pattern": ".dd-MM-yyyy"
  }
}

最佳答案

正如安装指南所说:

  • private_key_file: File name containing the private key used to encrypt the communications with the clients.
  • certificate_file: File name containing the self-signed X509 certificate used by the server to send the clients the public counterpart of the above private key (see Annex B].

因此,您必须配置 private_key_filecertificate_file配置参数。可以关注这个link以便了解如何创建 key 和自签名证书。

编辑 1

配置上述文件后,用户将遇到与非 root 用户绑定(bind) 1024 以下端口相关的错误。

当然,这可以通过配置超过 1024 的端口来解决;或设置此功能:setcap 'cap_net_bind_service=+ep' /path/to/program ;或进行 IP 转发(首选方法)。

在超过 1024 的端口启动 GUI,例如9090 ,并运行此命令以配置 IP 转发:

$ iptables -A PREROUTING -t nat -p tcp --dport 443 -j REDIRECT --to-port 9090

然后,您可以输入 https://<host_running_the_gui>在您的浏览器中,流量将自动转发到真实的监听端口(在示例中为 9090 )。

关于fiware - 启动 Cosmos-GUI,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32912733/

相关文章:

python - Python 中的 FIWARE OAuth2 身份验证

fiware - Cosmos 全局实例的 HDFS 访问错误

python - 将 Twitter 推文从 MongoDB 转储到 COSMOS

fiware - Cosmos HttpFS 文件格式

python - 通知 python orion/quantumleap 订阅更改

mysql - 我的 Cygnus 代理没有创建 MySQL 数据库

fiware-orion - Fiware - Cygnus 到 Cosmos,我无法上传数据到 HDFS

fiware - 如何扩展 Orion GE?

hadoop - 固件 Cosmos Hive 授权问题