简体   繁体   中英

PM2 with Meteor giving error while deploying

I am using the " pm2-meteor " module for using PM2 in my Meteor Application.

[Using PM2 First time]

I go through with doc given in pm2-meteor ie:-

https://www.npmjs.com/package/pm2-meteor

and follow the steps written there.

I also created json file as well for the configuration purpose and the file looks like:-

{
  "appName": "test",
  "appLocation": {
    "local": "/home/test"
  },
  "meteorSettingsLocation": "/home/test/SETTINGS-DEVELOPMENT.JSON",
  "meteorSettingsInRepo": false,
  "prebuildScript": "",
  "meteorBuildFlags": "--architecture os.linux.x86_64",
  "env": {
    "ROOT_URL": "localhost:3000",
    "PORT": 3000,
    "MONGO_URL": ""
  },
  "server": {
    "host": "localhost",
    "username": "parveen",
    "password": "",
    "deploymentDir": "/opt/meteor-apps",
    "loadProfile": "",
    "interpreter": "",
    "exec_mode": "cluster_mode",
    "instances": 1
  }
} 

After this i run the command ie

pm2-meteor deploy

Now this command returning me with the below error:-

events.js:165
      throw er; // Unhandled 'error' event
      ^

Error: connect ECONNREFUSED 127.0.0.1:22
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1174:14)
Emitted 'error' event at:
    at Socket.<anonymous> (/usr/local/lib/node_modules/pm2-meteor/node_modules/ssh2/lib/client.js:218:10)
    at Socket.emit (events.js:185:15)
    at emitErrorNT (internal/streams/destroy.js:64:8)
    at process._tickCallback (internal/process/next_tick.js:178:19)

As I understand this error may be due to any other PM2 running on my local machine. But I check there is no any other process of PM2 running on my machine.

So please help me with this what wrong I am doing here. Is there any mistake in the JSON file I have created or PM2 not worked with the local machine.

Any help would be much be appreciated!

Thanks

The error message:

Error: connect ECONNREFUSED 127.0.0.1:22

Tells you that it is failing to connect to port 22 on your localhost. That means you are either not running sshd on your local, or it is not configured to accept connections.

Deploying to your local machine, while it might seem like a convenient idea, doesn't work that well. You are better to either use a bare machine or something like an EC2 instance for deployment

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM