Setting up Redis

What am I doing wrong?
My Redis server
1:C 03 Jun 2023 17:14:32.011 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
1:C 03 Jun 2023 17:14:32.011 # Redis version=6.2.12, bits=64, commit=00000000, modified=0, pid=1, just started
1:C 03 Jun 2023 17:14:32.011 # Configuration loaded
1:M 03 Jun 2023 17:14:32.012 * monotonic clock: POSIX clock_gettime
1:M 03 Jun 2023 17:14:32.013 * Running mode=standalone, port=6379.
1:M 03 Jun 2023 17:14:32.013 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
1:M 03 Jun 2023 17:14:32.013 # Server initialized
1:M 03 Jun 2023 17:14:32.013 # WARNING Memory overcommit must be enabled! Without it, a background save or replication may fail under low memory condition. Being disabled, it can can also cause failures without low memory condition, see https://github.com/jemalloc/jemalloc/issues/1328. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
1:M 03 Jun 2023 17:14:32.014 * DB loaded from append only file: 0.000 seconds
1:M 03 Jun 2023 17:14:32.014 * Ready to accept connections
My Redis server
1:C 03 Jun 2023 17:14:32.011 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
1:C 03 Jun 2023 17:14:32.011 # Redis version=6.2.12, bits=64, commit=00000000, modified=0, pid=1, just started
1:C 03 Jun 2023 17:14:32.011 # Configuration loaded
1:M 03 Jun 2023 17:14:32.012 * monotonic clock: POSIX clock_gettime
1:M 03 Jun 2023 17:14:32.013 * Running mode=standalone, port=6379.
1:M 03 Jun 2023 17:14:32.013 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
1:M 03 Jun 2023 17:14:32.013 # Server initialized
1:M 03 Jun 2023 17:14:32.013 # WARNING Memory overcommit must be enabled! Without it, a background save or replication may fail under low memory condition. Being disabled, it can can also cause failures without low memory condition, see https://github.com/jemalloc/jemalloc/issues/1328. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
1:M 03 Jun 2023 17:14:32.014 * DB loaded from append only file: 0.000 seconds
1:M 03 Jun 2023 17:14:32.014 * Ready to accept connections
And on my Backend server
[ioredis] Unhandled error event: Error: connect ECONNREFUSED 127.0.0.1:6379
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1278:16)
[ioredis] Unhandled error event: Error: connect ECONNREFUSED 127.0.0.1:6379
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1278:16)
26 Replies
Percy
Percy2y ago
Project ID: 388adc7a-71d5-4f5d-80e2-eae18821712f
Brody
Brody2y ago
show me your service variables please? dont do that!! please go and regenerate the credentials right now
Sickde
Sickde2y ago
yeah sure thought maybe with the support guy will be okay lol
Brody
Brody2y ago
im not gonna do anything, but this is still a public thread let me know when you have re-gen'ed
Sickde
Sickde2y ago
done
Brody
Brody2y ago
show me a screenshot of your service variables with the values kept hidden!
Sickde
Sickde2y ago
Brody
Brody2y ago
a screenshot of your service variables thats the plugin
Sickde
Sickde2y ago
Brody
Brody2y ago
thats your code a screenshot of your service variables
Sickde
Sickde2y ago
um so I think I know what im doing wrong lol
Brody
Brody2y ago
can i have the screenshot please
Sickde
Sickde2y ago
Sickde
Sickde2y ago
Obviously have to add them here too sorry ty really apreciate
Brody
Brody2y ago
well hold on
Sickde
Sickde2y ago
ok
Brody
Brody2y ago
you only need to add a reference to REDIS_URL then instead of all those enviroment variables you can just use process.env.REDIS_URL please show me another screenshot after you do this
Sickde
Sickde2y ago
Sickde
Sickde2y ago
its deploying and it seems to work
Brody
Brody2y ago
show me a screenshot of the service variables please
Sickde
Sickde2y ago
Brody
Brody2y ago
nope delete the REDIS_URL and add it back as a variable reference please https://docs.railway.app/develop/variables#reference-variables
Sickde
Sickde2y ago
Brody
Brody2y ago
yay
Sickde
Sickde2y ago
ah makes sense so when I regen my variables in redis I dont have to change anything here again ty @Brody really apreciate it man!
Brody
Brody2y ago
exactly!! no problem 🙂
Want results from more Discord servers?
Add your server