How to use Redis with AWS ECS? - amazon-web-services

I want to use Redis with my nodejs app running in docker on AWS ECS. I'd either want a solution to run Redis in ECS or solution on how to connect ECS with AWS Elasticache

Run Redis in ECS:
Container definitions:
Image:redis:6.0.13
Port mapping:6379
Environment-Command:redis-server,--requirepass redis123456
Login to the Redis Server with password redis123456.It works normally.
Image&Port mapping
Environment-Command

Related

Deploying specific docker services locally when running docker-compose with ECS

I have a docker-compose.yml file that deploys several services to AWS ECS. This works fine. However, there are some services that I don't want deployed to ECS. I would like for these docker containers to run locally instead WHILE the other services are deployed on AWS ECS.
I can't find any documentation on this. What settings would I have to set in my docker-compose.yml file so that a specific service is built and run locally instead of being deployed to AWS ECS?
It sounds like you need to create two separate docker-compose.yaml files. One could be called local-only-compose.yaml or something. When running locally you can pass multiple compose YAML files to docker-compose. When deploying to AWS you could pass only the file with the services you want to deploy to ECS.

How to install/use AWS:ElastiCache Redis session for Yii2

The question is simple,
How to install/use AWS:ElastiCache Redis session for Yii2?
Self answered. Please read below
Steps to Install and Enable Redis
[Self Managed] Install Redis-Server in your webserver, using digitalocean link or for AWS EC2
[AWS ElastiCache] AWS ElastiCache for Redis: How to Use the AWS Redis Service
Install PHP Redis extension. AWS Guide
Apply session.save_path = Endpoint ElastiCache & session.save_handler = redis in php.ini
Restart the services
Confirm the change in php.ini by phpinfo();
Apply Redis session in Yii2 Component as said here
Make sure you follow this.
Use the same security group for EC2 and ElastiCache
Add Redis Port 6379 in AWS Security Group as 0.0.0.0
While configuration In Yii2, main.php add ElastiCache endpoint as host
These steps for the session only, so modify Yii2 main component if you want to use Redis as active data or to cache

How to upgrade the redash that running on ECS of AWS?

Hi,I don't know how to upgrade redash ,my redash is running by ECS on AWS and it depends on redis and rds that run on AWS too.
I pulled redash from docker hub and run it by ECS on AWS,I look into this website https://redash.io/help/open-source/admin-guide/how-to-upgrade ,and get confused.Can the redash image that i pulled from docker hub can be upgraded this way just like the website says, if it can’t, so how can I upgrade it.

Recommendation: Deploy Docker application to AWS

I got a local Docker stack running Node.js, MongoDB and Nginx.
It runs perfectly using docker-compose up --build.
Now it's time to deploy my application to a production environment.
I have considered EC2 Container Service and EC2, but can you recommend an easier approach? The learning curve is steep!
For MongoDB -
Use AWS quick start MongoDB
http://docs.aws.amazon.com/quickstart/latest/mongodb/overview.html
http://docs.aws.amazon.com/quickstart/latest/mongodb/architecture.html
For rest of the docker stack i.e NodeJS & Nginx -
Use the AWS ElasticBeanstalk Multi Container Deployment
http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_docker_ecs.html
http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_docker_v2config.html
Elastic Beanstalk supports Docker, as documented here. Elastic Beanstalk would manage the EC2 resources for you so that you, which should make things a bit easier on you.
You can install Kontena to AWS and use that to deploy your application to production environment (of course other cloud providers are also supported). Transition from Docker Compose is very smooth since kontena.yml uses similar syntax and keys as docker-compose.yml.
With Kontena you will have private image registry, load balancer and secret management built-in that are very useful when running containers in production.

aws elasticache redis set and get

I am new to AWS-SDK and I am running an node.js application on an EC2 instance.
I am trying to use ElastiCache-Redis in the node.js application. However, I can not find the API of ElastiCache to make basic Redis calls. The url below did not provide anything of Redis commands.
http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/ElastiCache.html#addTagsToResource-property
What should I do to issue Redis command to ElastiCache(Redis) in aws-sdk?
The ElastiCache API is used to start, stop & configure Redis and Memcached instances. It is not used for communicating with those instances.
In order to send commands to Redis or Memcached you need to use normal clients, here is the list of Node.js clients for Redis: http://redis.io/clients#nodejs