colyseus / proxy

🔀⚔ Proxy and Service Discovery for Colyseus 0.10 ~ 0.14 (Not recommended on 0.15+)
https://docs.colyseus.io/scalability/
MIT License
37 stars 25 forks source link

proxy scale not work #9

Closed 6wukong6 closed 3 years ago

6wukong6 commented 3 years ago

nodejs version is : v14.15.3 my config is :

module.exports = {
    apps: [
        /**
         * Colyseus processes
         */
        {
            name: 'colyseus-app',
            script: 'index.ts',
            exec_interpreter: "ts-node",
            watch: false,
            instances: 3,
            exec_mode: 'fork',
            port: 8080,
            env: {
                NODE_ENV: 'development',
                DEBUG: 'colyseus:errors,colyseus:matchmaking'
            },
        },

        /**
         * Proxy process
         */
        {
            name: 'proxy',
            script: './node_modules/@colyseus/proxy/bin/proxy',
            instances: 3, // os.cpus().length,
            exec_mode: 'fork', //fork is from pm2-example, but in readme it's cluster, cluster not work too
            env: {
                // Required options:
                REDIS_URL: 'redis://:183a19e6b1e6e025@127.0.0.1:9030/0',

                // // SSL (optional)
                // SSL_KEY: "/Users/endel/.localhost-ssl/localhost.key",
                // SSL_CERT: "/Users/endel/.localhost-ssl/localhost.crt",
            }
        }],

};

then run npm start

pm2 output is : image

what should I do?thanks.

6wukong6 commented 3 years ago

I found the problem. use pm2 delete all first. by the way proxy scale use cluster not fork.the demo code is wrong.