What is the method to connect to Redis node in an Elasticache from an Elastic BeanStalk instance?
Would just the host-name (redis node endpoint) and port enough?
Or is there any other authentication I have to complete? I get this error when I try to connect to the node.
org.springframework.data.redis.RedisConnectionFailureException: Cannot get Jedis connection; nested exception is redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool
For our rails application we have in our configuration environment variables:
REDIS_URL=redis://ourname.use1.cache.amazonaws.com:6379
REDIS_PROVIDER=REDIS_URL
and it works fine. Not sure specifically for your application, but this should resolve that.
Also, make sure that your redis node has the appropriate security group permissions. For example, if it is in sg-a and your Beanstalk nodes are in sg-b, make sure that sg-a has a tcp rule for 6379 for sg-b
Related
I have created gcp redis memory store in an vpc network with
Security
AUTH Enabled
TLS Enabled
I followed https://cloud.google.com/memorystore/docs/redis/connecting-redis-instance#connecting_to_a_redis_instance_that_uses_auth this article and i am able to connect to the memory store from compute engine.
But when i try to connect from the GKE
Cluster Information
Version 1.16.15-gke.7800
VPC-native traffic routing Enabled
i am getting the following Error
read tcp X.X.X.X:59408->X.X.X.X:6378: read: connection reset by peer
ultimatly i want to be able to use redis memory store from the GKE pods.
Any help is appreciated.
I'm currently using connect-redis in my Sails.js project to leverage a locally-installed redis instance. In the future, I'd like to use a common redis instance for multiple server instances (behind a load balancer), so I've been looking at AWS Elasticache. I'm having trouble with the configuration, though.
sails-project\config\session.js:
adapter: 'connect-redis',
host: 'primary-endpoint.xxxxxx.ng.0001.apse1.cache.amazonaws.com',
port: 6379,
ttl: <redis session TTL in seconds>,
db: 0,
pass: <redis auth password>,
prefix: 'sess:',
What should the TTL value be? Should the pass attribute point to IAM somehow?
I tried creating a user in IAM with AmazonElastiCacheFullAccess permissions and putting its access key ID in the pass attribute, but I got this error in my server console (testing on my Windows box):
C:\repos\sails-project\node_modules\connect-redis\lib\connect-redis.js:83
throw err;
^
AbortError: Redis connection lost and command aborted. It might have been processed.
at RedisClient.flush_and_error (C:\repos\sails-project\node_modules\redis\index.js:362:23)
...
Any ideas on what to change?
I'm going to assume your "windows box" is outside of AWS.
For Elasticache you can't access it from outside AWS. See the Security Section here : https://aws.amazon.com/elasticache/faqs/#Can_I_access_Amazon_ElastiCache_from_outside_AWS
The most common use case is to have EC2 instances within a VPC access and consume the Elasticache service. Along with this the Elasticache Redis service doesn't employ authentication and only allows lock down via security groups.
If you need something that differentiates from this configuration then you should look at putting Redis on EC2 so that you have full control.
I am trying to setup redis cluster on Kubernetes. One of my requirements is that my redis cluster should be resilient in case of kubernetes cluster restart(due to issues like power failure).
I have tried Kubernetes statefulset and deployment.
In case of statefulset, on reboot a new set of IP addresses are assigned to Pods and since redis cluster works on IP addresses, it is not able to connect to other redis instance and form cluster again.
In case of services with static IP over individual redis instance deployment, again redis stores IP of Pod even when I created cluster using static service IP addresses, so on reboot it is not able to connect to other redis instance and form cluster again.
My redis-cluster statefulset config
My redis-cluster deployment config
Redis-4.0.0 has solved this problem by adding support for cluster announce node IP and Port
Set cluster-announce-ip as static IP of service over redis instance kubernetes deployment.
Link to setup instructions: https://github.com/zuxqoj/kubernetes-redis-cluster/blob/master/README-using-statefulset.md
Are you able to use DNS names instead of IP addresses? I think that is the preferred way to route your traffic to individual nodes in a statefulset:
https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#stable-network-id
I am trying to setup ElastiCache to use with a Java Application. I have based my setup based on this documentation:
https://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/BestPractices.html
The EC2 instance where the Java (8) App runs is in a VPC.
I have tried an ElastiCache instance both in VPC and no VPC. However, I always got,
redis.clients.jedis.exceptions.JedisConnectionException: java.net.ConnectException: Connection refused
If I install Redis myself on an EC2 instance and connect to it, the app is able to connect to the Redis Cache!
I have setup proper authorization with Security-group from EC2 to Cache-Security but no luck. I just can't make the 'connection'. Any sample connection snippet would be really helpful.
Redis is setup this way in the APP Config:
#Bean
public JedisConnectionFactory redisConnectionFactory() {
JedisConnectionFactory redisConnectionFactory = new JedisConnectionFactory();
redisConnectionFactory.setHostName(<cache-node>);
redisConnectionFactory.setPort(6397);
redisConnectionFactory.setUsePool(true);
redisConnectionFactory.setTimeout(3600);
return redisConnectionFactory;
}
The various versions:
Jedis- 2.6.2, Spring- 4.1.6, Spring-data-> 1.5.0
telnet redis-ip 6397
Determine if redis can be connected
redisConnectionFactory.setPort(6397);
should probably be
redisConnectionFactory.setPort(6379); //default redis port
Glassfish 3.1.2
Ubuntu 12.04
I've created a cluster of two nodes and have a JMS queue.
I'm having issues trying to connect to this JMS queue using a remote standalone client.
The cluster JMS listener is on port 27676 and the queue is deployed to the cluster.
mq://Glassfish2:27676/,mq://Glassfish3:27676
When I connect using the code I'd use to connect to a stand alone instance the message is not received by the cluster.
I believe it is using the default 7676 port. When the IIOP port is changed to use port 23700 which is the one the cluster (DAS) is using I get a connection refused exception as it is trying to connect to localhost:27676. At least it's the right port.
WARNING: [C4003]: Error occurred on connection creation [localhost:27676]. - cause: java.net.ConnectException: Connection refused: connect
I've also updated the following values in node config file (domain.xml) to remove references to localhost. jms-host and node-host values.
I had this issue before with a stand alone instance and it was resolved by adding entries to the /etc/hosts file. However, this does not seem to resolve the issue.
I also have all server instance IPs in the hosts file.
Am I missing something very basic here?
Any help would be greatly appreciated.
Thanks
If you look log files under
${glassfish_home}/glassfish/nodes/cluster-name/instance-name/imq/instances/instance-name/log
folder, you will see that
master brockers does not match
Every your node has different master brockers, probably every node know its own brocker as master brocker..
I had the same error and after a few days find this..