Mohammed Sardar.

Ranch Hand
+ Follow
since Jun 22, 2014
Mohammed likes ...
jQuery Spring Java
Cows and Likes
Cows
Total received
1
In last 30 days
0
Total given
0
Likes
Total received
22
Received in last 30 days
0
Total given
18
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt Green check

Recent posts by Mohammed Sardar.

Tim Holloway wrote:You are confusing the Amazon Control Panel server with your Amazon instance. They are two different servers with 2 different IP addresses.

The Control panel app belongs to Amazon and doesn't run on the same VM as your AWS instance does or even the same subnet. The firewall to their server is open, since otherwise you wouldn't be able to talk to the control panel app. But the Amazon firewall to your server is not open and you need to use the Amazon Control Panel app to change that.



Good to know that I'm confused about amazon's control panel and amazon instances, and I believe that will get clarity by exploring them. I'm trying to access the control panel (ACP) after reading the document below. https://coffeecupjava.ec2.instance.my.connect.aws/ccp-v2/ - when I try to access this as per the URL signature specified in the document and am unable to access in return getting We can’t connect to the server at coffeecupjava.ec2.instance.my.connect.aws..

And still looking at why I don't have access to amazon CCP but ensured the instance name specified here is the correct one. am I on right track? Is this what you mean? Thanks for your great time.
3 weeks ago
Created new inbound rules for the HTTP:80 port and relaunched the ec2 instance and still in the same situation ...

I'm unable to add more attachments to this post since getting "The total size of the attachments should not be greater than 1,024 kb. The uploaded files have a total of 1,039 kb.".

3 weeks ago

Tim Holloway wrote:Yes, you absolutely must open up Amazon's firewall. As I said, your browser probably already was set up that way because outbound traffic is rarely firewalled. But traffic inbound to Amazon's public IP address does have to be enabled via the Amazon control panel app. The default is to forbid it.

Again, I cannot see any ports on 34.218.234.4 and that includes the SSH port, so I have to question if your screenshot is current because I'm virtually certain that either the machine is down or you're not even able to connect to it via SSH, much less the web port.



But traffic inbound to Amazon's public IP address does have to be enabled via the Amazon control panel app. The default is to forbid it. - You mean the firewall to be switched off on the AWS EC2 instance? Am I correct?

This screenshot was taken just now when I posted the screenshot and the instance is still up.
3 weeks ago

Tim Holloway wrote:I'm afraid I don't have much use for videos myself. I prefer text that I can jump around in and hold onto.

But regardless, when you say you have opened the firewall on "your machine", do you mean your machine or the Amazon EC2 machine? Because your machine probably has the ability to make outbound requests by default, but unless you open up the Amazon firewall, that won't help.

Beyond that, a quick check of IP 34.218.234.4 indicates that no ports are open, including the SSH access, so that machine is evidently down at the moment.

Bear in mind that Amazon dynamically assigns IP addresses and routes through internal networking, and that you may no longer be talking to the proper host.



Yes, I referred my system's browser from where I'm trying to access ec2-34-218-234-4.us-west-2.compute.amazonaws.com:8080/. Do I need to ensure the firewall is put off in the EC2 instance too? Just reconfirming 34.218.234.4 is up and running and default port 8080 is open. Attaching a referencing screenshot. Please let me know if my understanding is not correct.
3 weeks ago
Adding here the log after starting up the Spring boot application inside EC2 instance.

[root@ip-172-31-22-84 ~]# java -jar spring-boot-aws.jar

 .   ____          _            __ _ _
/\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/  ___)| |_)| | | | | || (_| |  ) ) ) )
 '  |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot ::                (v2.5.5)

2021-10-30 14:47:59.881  INFO 6251 --- [           main] j.e.api.SpringBootToDeployApplication    : Starting SpringBootToDeployApplication v0.0.1-SNAPSHOT using Java 1.8.0_302 on ip-172-31-22-84.us-west-2.compute.internal with PID 6251 (/root/spring-boot-aws.jar started by root in /root)
2021-10-30 14:47:59.893  INFO 6251 --- [           main] j.e.api.SpringBootToDeployApplication    : No active profile set, falling back to default profiles: default
2021-10-30 14:48:02.598  INFO 6251 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8080 (http)
2021-10-30 14:48:02.634  INFO 6251 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2021-10-30 14:48:02.635  INFO 6251 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.53]
2021-10-30 14:48:02.778  INFO 6251 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2021-10-30 14:48:02.779  INFO 6251 --- [           main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 2718 ms
2021-10-30 14:48:04.201  INFO 6251 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8080 (http) with context path ''
2021-10-30 14:48:04.219  INFO 6251 --- [           main] j.e.api.SpringBootToDeployApplication    : Started SpringBootToDeployApplication in 5.444 seconds (JVM running for 6.442)
3 weeks ago

Tim Holloway wrote:OK. Bear with me. I tend to get S3 (object storage) and EC2 (Elastic Cloud Computing) confused. Acronyms can be more trouble than they're worth sometimes.

EC2 provides VM instances. Now actually, for this app, I'd look at Elastic Beanstalk rather than an entire personal VM, but it's a matter of preference.

To run a Spring Boot app in EC2, you need to do the following:

1.  Create an EC2 instance and launch it.
2. Upload your Spring Boot Jar and launch it.
3. Ensure that the Amazon Firewall to that EC2 instance has the proper ports open. In other words, if you're blocking port 8080 (which Amazon will do by default), then external clients won't be able to talk to the app.

Here I'd like to note that 8080 is not the default port for HTTP. That's port 80, so you have to include an explicit override in your URLs. And since port 80 is a protected port, the only ways that you can make a Spring Boot app visible on port 80 are to A) override its default setting and run as a privileged user (NOT recommended) or B) proxy from a server that can service port 80 to the Spring Boot app using a proxy server such as Apache or Nginx. This is actually the better approach when hosting multiple Spring Boot apps on the same server instance.



I follow this YouTube video for initial learning (https://www.youtube.com/watch?v=LJkkFx7zJJQ&t=1s) and ensured follow all the steps described in the videos.

While ensuring the 1,2,3 steps mentioned by you above, created an EC2 and launched it. SB app is uploaded and executed on EC2 instance and confirmed the APP is up. Step 3, I ensured the firewall is off in my system. I'm running the app on 8080 port inside the EC2 instance, so do you think is it now not available for other clients is unable to talk?If so, how does that relate to the message what I'm getting here(ec2-54-245-162-219.us-west-2.compute.amazonaws.com took too long to respond)., This is just clarification. But the YTuber uses the same port, I don't hesitate to use another port but the app has been launched on the 8080 port, so I think, I've difficulty in understanding the point 3. Do you think so? Do I've to use a different port to make sure this is port problem?  Any comments from you may help. Thanks.
3 weeks ago

Tim Holloway wrote:I haven't the faintest idea of what any of that is supposed to mean.

The first URL times out because it's addressing a specific AWS instance that you created which isn't running any more. The other URLs appear to simply access the JAR as an object stored in EC2, but I have no clue as to what that's supposed to be doing for you.



Simply, A normal hello world spring boot application is running on EC2 instance and it's running(sure). I kick-started with the java *.jar command( java -jar spring-boot-aws.jar.). Logged in as EC2 user using SSH into EC2 instance to deploy and start the application. Application is deployed to EC2 instance and running. But when I try to access the application using public DNS http://ec2-34-218-234-4.us-west-2.compute.amazonaws.com:8080/ getting the attached message.

I simply access the application through the ec2 instance public DNS. In return I'm expecting "Let's learn together". The code snippet is below.

3 weeks ago

Tim Holloway wrote:Why are you storing an executable application in S3 storage? Aren't you deploying it to the Amazon cloud?



Yeah deployed to EC2 instance using wget as below. when trying to access through the public DNS http://ec2-34-218-234-4.us-west-2.compute.amazonaws.com:8080/ getting the site can't be reached and ERR_CONNECTION_TIMED_OUT.

wget https://coffeecupjava-bucket.s3.us-west-2.amazonaws.com/spring-boot-aws.jar

--2021-10-30 09:34:38--  https://coffeecupjava-bucket.s3.us-west-2.amazonaws.com/spring-boot-aws.jar
Resolving coffeecupjava-bucket.s3.us-west-2.amazonaws.com (coffeecupjava-bucket.s3.us-west-2.amazonaws.com)... 52.218.176.105
Connecting to coffeecupjava-bucket.s3.us-west-2.amazonaws.com (coffeecupjava-bucket.s3.us-west-2.amazonaws.com)|52.218.176.105|:443... connected.
HTTP request sent, awaiting response... 200 OK
3 weeks ago

Al Hobbs wrote:Where are you running that command exactly?



I executed that command from the Terminal after signing into the EC2 instance, to start the spring boot application. Then try to access the public URL through the browser!

Let me know if any other info. Thanks.
1 month ago
Hi All,

Created a spring boot jar and added it to the S3 bucket and the bucket is also public. Application started with no issues in the terminal with the below command java -jar spring-boot-aws.jar. When trying to access the URL (java -jar spring-boot-aws.jar) from the browser, continue you to get, This site can’t be reachedec2-34-218-234-4.us-west-2.compute.amazonaws.com took too long to respond.  How can I trace the error logs? I ensured the application is running and the instance has public access.

How can I trace the logs? Any help will be highly helpful.  Thanks.
1 month ago
Hi All,

Created a spring boot jar and added it to the S3 bucket and the bucket is also public. Application started with no issues in the terminal with the below command java -jar spring-boot-aws.jar. When trying to access the URL (java -jar spring-boot-aws.jar) from the browser, continue you to get, This site can’t be reachedec2-34-218-234-4.us-west-2.compute.amazonaws.com took too long to respond.  How can I trace the error logs? I ensured the application is running and the instance has public access.

How can I trace the logs? Any help will be highly helpful.  Thanks.
1 month ago
Thanks, Tim It makes little sense to my mind than before this post.
1 month ago

Tim Holloway wrote:Oracle's JDK is not "open", it's just that they have relaxed license terms. Even Sun's JDK was not open-source. Oracle contributed to the development of OpenJDK, but their binaries are built from their proprietary source code, not the OpenJDK source code.

OpenJDK, on the other hand, is 100% open-source. You can download the source code, compile it, even customize it - though redistributing the modifications may be licence-restricted.

Azul has taken OpenJDK, built their own binaries and sells them with paid support. Much like you can obtain paid support for the PostgreSQL database even though it is free with many Linux distros.

Speaking of Linux distros, most of them include OpenJDK and some even appear to install it as part of basic OS installation. The distro builders simply wrap their own distro build processes around the basic OpenJDK source to create an OpenJDK OS package. The difference between them and Azul is that they only provide support for the package, and little or no support for problems internal to OpenJDK.



Tim, I like to add a little more clarity to my thoughts from your clarification, So OpenJDK is different from Oracle Licensed Java?  When saying so, the entrepreneur Azul takes the OpenJDK to modify and resell the product but not the Oracle Licensed one? Or it's up to them? I'm a bit confused about this. When Oracle has their own, how do they allow others to take a copy and restructure it and resell? Basically, the circling thought is will the other who redistributing the JDK will modify according to the enterprise need?
1 month ago
Hi Alex,



How does functional design impact the microservices architecture of an application when the functional aspect of any service changes? Can microservices adopt complete functional programming?

Glad to hear from you.


Thanks,
Congratulations to All. Special wishes and thanks go to Marcello.
1 month ago