Could not connect to Redis at 10.XX.XX.28:6379: Unknown error - while accessing from Spring Batch or windows machine

佐手、 提交于 2019-12-01 12:49:39

I was able to solve this issue like below: "Accessing redis from remote system"

By default, redis is accessible from localhost but if you wish to access redis server from a remote location then we need to make some changes in the configuration file. Open the configuration file for the instance, i.e. /etc/6379.conf

$ vi /etc/redis/6379.conf

& look for ‘bind 127.0.0.1’. We can either replace 127.0.0.1 with 0.0.0.0 or add IP address of our server to it. It should look like

bind 0.0.0.0

or

bind 127.0.0.1 192.168.1.100

Now exit the file after saving the changes & restart the service for changes to take effect.

$ service redis_6379 restart

Remember if using multiple or different port numbers, changes are to made to all the configuration files for respective port numbers.

Now to check if we can login to redis from a remote system, login to remote system first & enter the following command from terminal,

$ redis-cli -h 192.168.1.100 -p 6379

where, 192.168.1.100 is the IP address of the redis server with 6379 as the redis instance port number.

Done :)

Perform if any issues: yum install make gcc gcc-c++ kernel-devel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!