What Redis variables are necessary in a Spring Boot app?
Normally in a Spring Boot app I would just define the Redis port and host, but my health check is failing because the log says that Redis is listening on localhost. Why is this happening? Do I need need to set the Redis password, URL, and user? Can you please show me an example of the application.properties file?
19 Replies
Project ID:
59529c94-83a4-4029-89c7-3ac4d98ea51b
59529c94-83a4-4029-89c7-3ac4d98ea51b
could you setup a variable reference for
REDIS_URL
and then use that in your app?Yes, I can set all of the variables. My question is, which ones do I need?
As I mentioned, I've only ever had to set the port and host to use Redis locally. Do I need all of these variables set?
the simplest way would be to just use
REDIS_URL
since the URL also contains every other credentialThanks. Is the property just spring.redis.url?
i wouldn't know, thats something you would need to read the spring documentation for, reading documentation goes a very long way
Thanks. I checked the documentation and found conflicting answers. That's why I asked. No worries. I'll test it.
I'm sorry I'm not a java developer
I deployed the update and I'm still getting the same error. Somehow the Redis information is not set right.
Caused by: io.lettuce.core.RedisConnectionException: Unable to connect to localhost/<unresolved>:6379
It seems like somehow the variables for Redis are not being brought, which is confusing because I have the Redis variales set up in the same way I have the MySQL variables set up and those are working fine.can you show me a screenshot of your service variables?
Sure. Here's Redis.
And the service.
And my deployment properties file.
You can see that I tried URL and then switched to trying host and port.
you'd need to use more variables than just host and port
https://docs.railway.app/databases/redis#connect
Thanks. The main problem I’m having now is that none of the variables seem to referenced. The app crashes on deployment because redis is still trying to listen on localhost.
I think you should familiarize yourself with the technologys you are trying to use