Skip to content

没有阿里云怎么部署? #153

@JakeWoki

Description

@JakeWoki

Deploy

// {app_root}/config/config.prod.js

exports.mini_assets = true;

exports.alinode = {
  // 从 `Node.js 性能平台` 获取对应的接入参数
  appid: process.env.EGG_ALINODE_APPID || '',
  secret: process.env.EGG_ALINODE_SECRET || '',
};
$ npm i --production
$ npm run assets
$ npm start
$ npm stop

没有的话怎么部署?第一次部署完全不懂

> cnode@1.0.0 start /usr/local/src/egg-cnode
> egg-scripts start --daemon --title=egg-server-cnode

[egg-scripts] Starting egg application at /usr/local/src/egg-cnode
[egg-scripts] Run node /usr/local/src/egg-cnode/node_modules/egg-scripts/lib/start-cluster {"title":"egg-server-cnode","baseDir":"/usr/local/src/egg-cnode","framework":"/usr/local/src/egg-cnode/node_modules/egg"} --title=egg-server-cnode
[egg-scripts] Save log file to /root/logs
[egg-scripts] Wait Start: 1...
[egg-scripts] tail -n 100 /root/logs/master-stderr.log
[egg-scripts] Got error when startup: 
[egg-scripts] assert.js:350
[egg-scripts]     throw err;
[egg-scripts]     ^
[egg-scripts] 
[egg-scripts] AssertionError [ERR_ASSERTION]: config.alinode.appid required
[egg-scripts]     at module.exports.agent (/usr/local/src/egg-cnode/node_modules/egg-alinode/agent.js:15:3)
[egg-scripts]     at Hook.configDidLoad (/usr/local/src/egg-cnode/node_modules/egg-core/lib/lifecycle.js:92:9)
[egg-scripts]     at Lifecycle.triggerConfigDidLoad (/usr/local/src/egg-cnode/node_modules/egg-core/lib/lifecycle.js:143:14)
[egg-scripts]     at Lifecycle.triggerConfigWillLoad (/usr/local/src/egg-cnode/node_modules/egg-core/lib/lifecycle.js:137:10)
[egg-scripts]     at AgentWorkerLoader.loadCustomAgent (/usr/local/src/egg-cnode/node_modules/egg-core/lib/loader/mixin/custom.js:45:20)
[egg-scripts]     at AgentWorkerLoader.load (/usr/local/src/egg-cnode/node_modules/egg/lib/loader/agent_worker_loader.js:21:10)
[egg-scripts]     at new Agent (/usr/local/src/egg-cnode/node_modules/egg/lib/agent.js:26:17)
[egg-scripts]     at Object.<anonymous> (/usr/local/src/egg-cnode/node_modules/egg-cluster/lib/agent_worker.js:28:15)
[egg-scripts]     at Module._compile (internal/modules/cjs/loader.js:689:30)
[egg-scripts]     at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
[egg-scripts] 2019-02-20 17:23:57,955 ERROR 1880 nodejs.AgentWorkerDiedError: [master] agent_worker#1:1887 died (code: 1, signal: null)
[egg-scripts]     at Master.onAgentExit (/usr/local/src/egg-cnode/node_modules/egg-cluster/lib/master.js:328:17)
[egg-scripts]     at Master.emit (events.js:189:13)
[egg-scripts]     at Messenger.sendToMaster (/usr/local/src/egg-cnode/node_modules/egg-cluster/lib/utils/messenger.js:137:17)
[egg-scripts]     at Messenger.send (/usr/local/src/egg-cnode/node_modules/egg-cluster/lib/utils/messenger.js:102:12)
[egg-scripts]     at ChildProcess.agentWorker.once (/usr/local/src/egg-cnode/node_modules/egg-cluster/lib/master.js:219:22)
[egg-scripts]     at Object.onceWrapper (events.js:277:13)
[egg-scripts]     at ChildProcess.emit (events.js:189:13)
[egg-scripts]     at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
[egg-scripts] name: "AgentWorkerDiedError"
[egg-scripts] pid: 1880
[egg-scripts] hostname: owp-ecs
[egg-scripts] 
[egg-scripts] 2019-02-20 17:23:57,956 ERROR 1880 [master] agent_worker#1:1887 start fail, exiting with code:1
[egg-scripts] 2019-02-20 17:23:57,956 ERROR 1880 [master] exit with code:1
[egg-scripts] 
[egg-scripts] Start got error, see /root/logs/master-stderr.log
[egg-scripts] Or use `--ignore-stderr` to ignore stderr at startup.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! cnode@1.0.0 start: `egg-scripts start --daemon --title=egg-server-cnode`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the cnode@1.0.0 start 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!     /root/.npm/_logs/2019-02-20T09_23_58_988Z-debug.log

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions