Questions tagged with Amazon EC2

Content language: English

Sort by most recent

Browse through the questions and answers listed below or filter and sort to narrow down your results.

Hi, I'm using the [SQS-Consumer](https://github.com/bbc/sqs-consumer) for getting messages from an AWS SQS (on an EC2 instance I'm running a simple app using `pm2`). Once the message is received, I'm grabbing relevant data and call an external function called `messageHandler` which does some operations on the message (scrape the URL from message using Puppeteer) and then update DB accordingly: ``` const app = Consumer.create({ ... handleMessage: async (message) => { const { id, protocol, hostname, pathname } = JSON.parse(message.Body) as QueueMessageBody; const res = await puppeteerSinglePageCrawl(id, url.protocol, url.hostname, url.pathname, logStreamName); return Promise.resolve(); } ``` My problem is that when a message is read from the queue, sometimes I get Timeout Errors on opening the page with Puppeteer: ``` await this.page.goto(`${protocol}//${hostname}${pathname}`, { waitUntil: 'networkidle2', referer: 'https://www.google.com/', timeout: 20000, }); ``` However, when I connect to my EC2 instance via SSH and call the same function manually `ts-node messageHandler.ts` I'm not getting the timeout error. My initial thought was that the issue might be with the `waitUntil` but clearly when called manually I don't get this error and the page is opening correctly. My second thought was that somehow the network might be overloaded on the EC2 instance when the consumer is running, but I've been testing the manual calls while the consumer was running separately and I still got different (successful) results on manual execution. What might be the reason for this?
0
answers
0
votes
20
views
asked 15 days ago
Hello, when I connect with FileZilla to EC2 and when I try to edit and save a file, I get this error: templates/user_memebership_profile.php: open for write: permission denied Error: File transfer failed What do I need to do to be able to edit and save files with FileZilla (or if you know a more convenient tool)? Thanks!
0
answers
0
votes
17
views
asked 15 days ago
Hello, I've created an EC2 instance and used Bitnami image. My setup looks like this: - 1 EC2 instance T - 1 VPC - 1 route table (public hosting zone) - 1 network ACL - 1 elastic IP - 4 security groups all connected to that 1 VPC (3/4 groups are bitnami, 1 is default) - 1 internet gateway - 1 DHCP option set I am experiencing issues which could be connected with caching. I thought that by rebooting and even stopping and re-starting the instance would clear the cache, but that doesn't seem to be the case. My question is: how can I check if there are any cache systems like CDN and how exactly I can clear the cache from the server/instance/VPC. Admittedly, I am not an infra expert. For this reason, I'd appreciate very much precise (if possible step-by-step) instructions on how to clear the cache. Thank you!
1
answers
0
votes
13
views
asked 15 days ago
The documentation (https://docs.aws.amazon.com/aws-sdk-php/v3/api/api-ec2-2016-11-15.html#runinstances) claims that I can either specify ImageId directly or via a launch template. But if I specify it in a launch template, the request fails validation. The SDK doesn't even make an outbound connection, just errors out immediately. How can I make EC2 use the ImageId specified in my launch template? I'm using the following code to launch an EC2 instance using a launch template: ```php $result = $ec2->runInstances([ 'DryRun' => false, 'LaunchTemplate' => [ 'LaunchTemplateName' => 'test-template', 'Version' => 1 ], 'MinCount' => 1, 'MaxCount' => 1 ]); ``` The template ("test-template" Version 1) has an AMI specified (ami-086b3de06dafe36c5 - Amazon Linux 2). When I run the code above, I immediatelly get the following: ``` Found 1 error while validating the input provided for the RunInstances operation: [ImageId] is missing and is a required parameter ```
1
answers
0
votes
27
views
asked 15 days ago
Hi, I have an SQS-consumer ([https://github.com/bbc/sqs-consumer](lib)) running on an EC2 machine (t2.medium). There is only one instance of this process running at the time. However, when I open my SQS dashboard I see more than 30 messages in flight. It's a FIFO queue, with deduplication based on MessageGroupId. I'm not using any batching the library offers, just simple consumer one message at a time as the library tutorial shows. What am I missing here? The reason for concern is that I'm getting A LOT of timeout errors when processing messages (I'm using Puppeteer to open websites and check for links on them) - and I'm trying to narrow down the cause for this - and overloading the t2 machine network bandwidth might be one of them (I think).
1
answers
0
votes
41
views
asked 15 days ago
will using any of the services e.g EC2 expose my own IP address ? if my accounts gets hacked ( root user ) can someone get my own IP address from the services ?
1
answers
0
votes
17
views
asked 16 days ago
I have just received free tier limit email. 2 questions - does my app in the elastic beanstalk env. get aborted shut down when i exceed it or do i get carged automatically when i exceed the usage -how do i extend the power/capacity, etc. of the existing ec2 instance on which my app is running.
1
answers
0
votes
20
views
asked 16 days ago
i made an ec2 instance, put an inbound rule for 3306, made a remote user with peivilages, when i try to connect the user in another computer it works but only on the teminal, when i try to connect fron the workbench it gives me the "could not connect to ssh tunnel : authuntecation failed" popup screen. i assured that the keypair is right, the username and pass are right. could really use some assestance.
1
answers
0
votes
18
views
ayman
asked 16 days ago
I am new to starting up an ec2 server. I set up the AMI and then started up the server. But shortly after, I see a second server starting up that calls itself a DockerReact-env server. What is DockerReact-env and why is it starting up?
1
answers
0
votes
11
views
asked 17 days ago
Hello Team, I have migrated CEDR to DRS. Launched Test Server successfully. Now want to perform Reverse Data Replication from Recovery Instance which is failing with below mentioned error: ![Enter image description here](/media/postImages/original/IM4hvA3jI4RGKuTG3j7WNBDg) I have checked whether DRS Agent is running on the Recovery Agent and the output is: ![Enter image description here](/media/postImages/original/IM3kpUP0JRQHWFHmDd-hw8kA) And I am able to reach internet. I have configured my Target Region DRS Replication Settings for the same. Please guide me to fix this issue. Do I need to install DRS Agent on the Recovery Instance for Reverse Replication? I appreciate you help. Thank you.
0
answers
0
votes
17
views
asked 17 days ago
We have made a new RDS Database and we have a public DNS record of it to connect. How can I find its private IP to connect from within the AWS network in same zone.
2
answers
0
votes
33
views
asked 17 days ago
Hello, We have 2 app servers in us-east-1b AZ. As part of DR plan, app team wants a redundancy based on availability zone. Hence, they want to move one of the app server from one AZ to another AZ (from us-east-1b to us-east-1c) in same region. As per my understanding I will performing below actions 1. Shutdown existing app server 2. Take AMI backup of the server 3. Use the above AMI and launch new server in different AZ by selecting subnet from another AZ 4. complete the movement my query is, while I perform above steps, does AWS copies entire AMI to another AZ ? by doing this will new server (compute and ebs volumes both ) will run in new AZ ? so that as per requirement 1 server will run in us-east -1b and another server in us-east-1c Note: App team do not want region level redundancy.
2
answers
0
votes
38
views
asked 17 days ago