Open fauzanmh opened 5 years ago
I also got this error
make sure redis server is running
If you don't want to use redis set "redis": false
in laravel-echo-server.json. The init wizard does not does this automatically if you choose sqlite for persistant storage
I have the same issue. Is there any solution.
Seems like Redis is not installed or the Redis server is not running. Install a copy from https://redis.io/ And then run the service with "redis-server". After that you can smoothly run "laravel-echo-server start"
@waqas83 issue resolved actually the redis was not properly installed on windows 10
run the command
sudo apt install redis-server
Great...
you just have to download the Redis server from the website below and execute redis-server.exe to start redis server.
https://riptutorial.com/redis/example/29962/installing-and-running-redis-server-on-windows
install redis-server
run the command
sudo apt install redis-server
This is the final solution. thanks
run the command
sudo apt install redis-server
It was solved. thanks
As @j0hnys said, you need to add the following config to your laravel-echo-server.json
file:
"subscribers": {
"http": true,
"redis": false
}
This document is for those who use laravel echo server & nginx & socket.io & redis-server with separated server between client project and redis-server.
1) Edit /etc/redis/redis.conf
bind 127.0.0.1
supervised no
To
bind 0.0.0.0
supervised systemd
2) Update /etc/systemd/system/redis.service
under [Service]
Type=notify
ExecStart=/usr/bin/redis-server /etc/redis/redis.conf --supervised systemd
3) Nginx /etc/nginx/sites-enabled/reverse-proxy.conf
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name mysitecom;
error_log /var/log/nginx/proxy-error.log error;
# Start the SSL configurations
ssl on;
ssl_certificate /etc/nginx/certs/mysitecom.pem;
ssl_certificate_key /etc/nginx/certs/mysitecom.key;
ssl_session_timeout 3m;
ssl_session_cache shared:SSL:50m;
ssl_protocols TLSv1.1 TLSv1.2;
# Diffie Hellmann performance improvements
ssl_ecdh_curve secp384r1;
location /socket.io {
proxy_pass http://mysitecom:2096;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_buffers 16 4k;
proxy_buffer_size 2k;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-VerifiedViaNginx yes;
proxy_read_timeout 2h;
proxy_connect_timeout 2h;
proxy_redirect off;
}
}
4) laravel-echo-server.json
{
"authHost": "https://mysitecom",
"authEndpoint": "/broadcasting/auth",
"clients": [
{
"appId": "e45c056ec8ca8bd7",
"key": "88d316b5cccafbc5e905aa9ee13e63f7"
}
],
"database": "redis",
"databaseConfig": {
"redis": {
"host": "0.0.0.0",
"port": "6379"
},
"sqlite": {
"databasePath": "/database/laravel-echo-server.sqlite"
}
},
"devMode": true,
"host": null,
"port": "2096",
"protocol": "https",
"socketio": {},
"secureOptions": 67108864,
"sslCertPath": "/etc/nginx/certs/mysitecom.pem",
"sslKeyPath": "/etc/nginx/certs/mysitecom.key",
"sslCertChainPath": "",
"sslPassphrase": "",
"subscribers": {
"http": true,
"redis": true
},
"apiOriginAllow": {
"allowCors": true,
"allowOrigin": "*",
"allowMethods": "GET, POST",
"allowHeaders": "Origin, Content-Type, X-Auth-Token, X-Requested-With, Accept, Authorization, X-CSRF-TOKEN, X-Socket-Id"
}
}
Note: for someone who connects DNS with cloudflare
please change default socket.io port 6001 to the following here.
Do this sudo service redis-server start
Or you can use docker:
docker pull redis
docker run -p 6379:6379 --name redis -d redis
What about if redis dies? How can we handle that case?
There should be a fallback possibility for that case.
I was running docker, So terminating and starting docker fixed my issue
const redis = new Redis({
host: "localhost",
port: 6900
})
this code runs on my local mechine with redis docker image. But when I dockerize my nodejs code and try to run the code it shows this error [ioredis] Unhandled error event: Error: connect ECONNREFUSED 127.0.0.1:6900 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1159:16) [ioredis] Unhandled error event: Error: connect ECONNREFUSED 127.0.0.1:6900 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1159:16) [ioredis] Unhandled error event: Error: connect ECONNREFUSED 127.0.0.1:6900 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1159:16) [ioredis] Unhandled error event: Error: connect ECONNREFUSED 127.0.0.1:6900 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1159:16) [ioredis] Unhandled error event: Error: connect ECONNREFUSED 127.0.0.1:6900 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1159:16) [ioredis] Unhandled error event: Error: connect ECONNREFUSED 127.0.0.1:6900 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1159:16) [ioredis] Unhandled error event: Error: connect ECONNREFUSED 127.0.0.1:6900 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1159:16)
Redis container is running fine in Port 6900
i try run laravel-echo-server start but i have error like this
L A R A V E L E C H O S E R V E R
version 1.5.0
⚠ Starting server in DEV mode...
✔ Running at localhost on port 6001 ✔ Channels are ready. ✔ Listening for http events... [ioredis] Unhandled error event: Error: connect ECONNREFUSED 127.0.0.1:6379 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1113:14) [ioredis] Unhandled error event: Error: connect ECONNREFUSED 127.0.0.1:6379 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1113:14)
solution for me?
sorryForMyEnglish