I have an ec2 instance running a sample web service on http 8080 port. I am unable to access it from my mac(outside ec2).
I have done the following after going through many stackoverflow questions.
i have deployed my spring boot application on ec2 and is running successfully. I was also able to hit that service from localhost:8080 and got the expected response.
[ec2-user#ip-172-31-34-45 ~]$
[ec2-user#ip-172-31-34-45 ~]$
[ec2-user#ip-172-31-34-45 ~]$
[ec2-user#ip-172-31-34-45 ~]$ cd samplespringboot/
[ec2-user#ip-172-31-34-45 samplespringboot]$ java -jar spring-boot-hello-1.0.jar &
[1] 438
[ec2-user#ip-172-31-34-45 samplespringboot]$
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.7.6)
2022-12-02 06:59:11.948 INFO 438 --- [ main] com.example.demo.DemoApplication : Starting DemoApplication v1.0 using Java 1.8.0_342 on ip-172-31-34-45.ap-south-1.compute.internal with PID 438 (/home/ec2-user/samplespringboot/spring-boot-hello-1.0.jar started by ec2-user in /home/ec2-user/samplespringboot)
2022-12-02 06:59:11.960 INFO 438 --- [ main] com.example.demo.DemoApplication : No active profile set, falling back to 1 default profile: "default"
2022-12-02 06:59:14.739 INFO 438 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2022-12-02 06:59:14.766 INFO 438 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2022-12-02 06:59:14.766 INFO 438 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.69]
2022-12-02 06:59:14.931 INFO 438 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2022-12-02 06:59:14.932 INFO 438 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 2825 ms
2022-12-02 06:59:16.405 INFO 438 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ''
2022-12-02 06:59:16.433 INFO 438 --- [ main] com.example.demo.DemoApplication : Started DemoApplication in 5.574 seconds (JVM running for 6.602)
[ec2-user#ip-172-31-34-45 samplespringboot]$
[ec2-user#ip-172-31-34-45 samplespringboot]$
[ec2-user#ip-172-31-34-45 samplespringboot]$ curl localhost:8080
2022-12-02 06:59:41.048 INFO 438 --- [nio-8080-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet'
2022-12-02 06:59:41.053 INFO 438 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet'
2022-12-02 06:59:41.055 INFO 438 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 2 ms
Hello World!
Hello World, Spring Boot![ec2-user#ip-172-31-34-45 samplespringboot]$
when i try to hit the same from local mac, i am getting connection timed out..
vinays#Vinays-MacBook-Pro target % curl ec2-x-y-z-133.ap-south-1.compute.amazonaws.com:8080
curl: (28) Failed to connect to ec2-x-yz-133.ap-south-1.compute.amazonaws.com port 8080 after 75008 ms: Operation timed out
so i have the following outbound and inbound rules of my ec2 instance
And i have also added NACLs entries like this..
I am not sure what i am doing wrong. Any help is appreciated. Thanks.
[UPDATE]:
I cannot specify port 8080 in edit inbound rules. by default it is 80.
In the inbound rule, you have to add 8080 port as allowed. Otherwise, any host cannot reach to your EC2 node from outside world.
Allow 8080 port from your real IP address would do the trick as well. If you want to enable more secure way, then allow only your real IP for 8080 port, and it will be reachable.
I've created a simple Spring Boot application in IntelliJ and tested the connection with the AWS database, which gives me no error. After creating a mvn clean install, I test the jar in the command-prompt, which also gives me no error. Great, I can upload my JAR file to my AWS Environment. I go to Environment > Configuration > Edit Database, and select my database in the snapshot drop down. But my Environment wound connect to the database. I don't get why it would work. I've been trying to run my app on AWS for days now and I feel I'm close, but don't know how to solve this problem. Plz check out my log:
----------------------------------------
/var/log/web.stdout.log
----------------------------------------
Apr 20 06:15:19 ip-172-31-35-71 web: 2022-04-20 06:15:19.048:INFO::main: Logging initialized #367ms
Apr 20 06:15:19 ip-172-31-35-71 web: 2022-04-20 06:15:19.122:INFO:oejs.Server:main: jetty-9.2.z-SNAPSHOT
Apr 20 06:15:19 ip-172-31-35-71 web: 2022-04-20 06:15:19.201:INFO:oejs.ServerConnector:main: Started ServerConnector#2fcb66eb{HTTP/1.1}{0.0.0.0:5000}
Apr 20 08:34:45 ip-172-31-35-71 web: :: Spring Boot :: (v2.6.6)
Apr 20 08:34:45 ip-172-31-35-71 web: 2022-04-20 08:34:45.466 INFO 11107 --- [ main] c.e.S.SpringBootCrudExampleApplication : Starting SpringBootCrudExampleApplication v0.0.1-SNAPSHOT using Java 11.0.14.1 on ip-172-31-35-71.ec2.internal with PID 11107 (/var/app/current/application.jar started by webapp in /var/app/current)
Apr 20 08:34:45 ip-172-31-35-71 web: 2022-04-20 08:34:45.477 INFO 11107 --- [ main] c.e.S.SpringBootCrudExampleApplication : No active profile set, falling back to 1 default profile: "default"
Apr 20 08:34:47 ip-172-31-35-71 web: 2022-04-20 08:34:47.473 INFO 11107 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
Apr 20 08:34:47 ip-172-31-35-71 web: 2022-04-20 08:34:47.963 INFO 11107 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 472 ms. Found 1 JPA repository interfaces.
Apr 20 08:34:49 ip-172-31-35-71 web: 2022-04-20 08:34:49.554 INFO 11107 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 5000 (http)
Apr 20 08:34:49 ip-172-31-35-71 web: 2022-04-20 08:34:49.582 INFO 11107 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
Apr 20 08:34:49 ip-172-31-35-71 web: 2022-04-20 08:34:49.583 INFO 11107 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.60]
Apr 20 08:34:49 ip-172-31-35-71 web: 2022-04-20 08:34:49.769 INFO 11107 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
Apr 20 08:34:49 ip-172-31-35-71 web: 2022-04-20 08:34:49.769 INFO 11107 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 4143 ms
Apr 20 08:34:50 ip-172-31-35-71 web: 2022-04-20 08:34:50.856 INFO 11107 --- [ main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [name: default]
Apr 20 08:34:50 ip-172-31-35-71 web: 2022-04-20 08:34:50.987 INFO 11107 --- [ main] org.hibernate.Version : HHH000412: Hibernate ORM core version 5.6.7.Final
Apr 20 08:34:51 ip-172-31-35-71 web: 2022-04-20 08:34:51.362 INFO 11107 --- [ main] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.1.2.Final}
Apr 20 08:34:51 ip-172-31-35-71 web: 2022-04-20 08:34:51.585 INFO 11107 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
Apr 20 08:34:51 ip-172-31-35-71 web: 2022-04-20 08:34:51.957 INFO 11107 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed.
Apr 20 08:34:51 ip-172-31-35-71 web: 2022-04-20 08:34:51.979 INFO 11107 --- [ main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.MySQL8Dialect
Apr 20 08:34:53 ip-172-31-35-71 web: 2022-04-20 08:34:53.137 INFO 11107 --- [ main] o.h.e.t.j.p.i.JtaPlatformInitiator : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
Apr 20 08:34:53 ip-172-31-35-71 web: 2022-04-20 08:34:53.148 INFO 11107 --- [ main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
Apr 20 08:34:54 ip-172-31-35-71 web: 2022-04-20 08:34:54.000 WARN 11107 --- [ main] JpaBaseConfiguration$JpaWebConfiguration : spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
Apr 20 08:34:54 ip-172-31-35-71 web: 2022-04-20 08:34:54.946 INFO 11107 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 5000 (http) with context path ''
Apr 20 08:34:54 ip-172-31-35-71 web: 2022-04-20 08:34:54.965 INFO 11107 --- [ main] c.e.S.SpringBootCrudExampleApplication : Started SpringBootCrudExampleApplication in 11.253 seconds (JVM running for 12.875)
Apr 20 08:36:29 ip-172-31-35-71 web: 2022-04-20 08:36:29.654 INFO 11107 --- [ionShutdownHook] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
Apr 20 08:36:29 ip-172-31-35-71 web: 2022-04-20 08:36:29.658 INFO 11107 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated...
Apr 20 08:36:29 ip-172-31-35-71 web: 2022-04-20 08:36:29.690 INFO 11107 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed.
Events
INFO Environment health has transitioned from Warning to Ok.
WARN Environment health has transitioned from Warning to Ok.
INFO The environment was reverted to the previous configuration setting.
INFO Environment health has transitioned from Info to Warning. Configuration update failed 18 seconds ago and took 67 seconds.
The environment was reverted to the previous configuration setting.
Environment health has transitioned from Ok to Info. Configuration update in progress (running for 15 seconds).
ERROR Failed to deploy configuration.
ERROR Creating RDS database failed Reason: DB Instance class db.t2.micro does not support encryption at rest
ERROR Service:AmazonCloudFormation, Message:Stack named 'awseb-e-3a2mk3bca7-stack' aborted operation. Current state: 'UPDATE_ROLLBACK_IN_PROGRESS' Reason: The following resource(s) failed to create: [AWSEBRDSDatabase].
INFO Updating environment Invoice-env's configuration settings.
INFO Environment update is starting.
I am using AWS FARGATE ECS to host Report Portal. We have hosted Postgres in AWS RDS. Out of 11 services, we able to deploy 10 services in ECS. Last remaining service is API . To deploy these, we have created Cluster, Task Definitions with containers. The, we create Tasks and start them.
Getting error as unable to start embedded tomcat.
API Service: 5.1.0
Built with ♡ by EPAM Systems
Spring Boot (v2.2.5.RELEASE)
2020-05-02 02:22:16.755 INFO 11 --- [ main] c.e.t.r.core.configs.ReportPortalApp : Starting ReportPortalApp on ip-10-0-1-59.ap-south-1.compute.internal with PID 11 (/service-api-5.1.0-exec.jar started by root in /)
2020-05-02 02:22:16.836 INFO 11 --- [ main] c.e.t.r.core.configs.ReportPortalApp : The following profiles are active: default
2020-05-02 02:22:25.338 INFO 11 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
2020-05-02 02:22:26.647 INFO 11 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 1299ms. Found 30 JPA repository interfaces.
2020-05-02 02:22:37.056 INFO 11 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.security.config.annotation.configuration.ObjectPostProcessorConfiguration' of type [org.springframework.security.config.annotation.configuration.ObjectPostProcessorConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-05-02 02:22:37.145 INFO 11 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'objectPostProcessor' of type [org.springframework.security.config.annotation.configuration.AutowireBeanFactoryObjectPostProcessor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-05-02 02:22:37.150 INFO 11 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler#1cc9cfb2' of type [org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-05-02 02:22:37.157 INFO 11 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'userRoleHierarchy' of type [com.epam.ta.reportportal.auth.UserRoleHierarchy] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-05-02 02:22:37.160 INFO 11 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'securityConfiguration' of type [com.epam.ta.reportportal.core.configs.SecurityConfiguration$$EnhancerBySpringCGLIB$$2bca0c92] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-05-02 02:22:37.238 INFO 11 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'permissionEvaluator' of type [com.epam.ta.reportportal.auth.permissions.PermissionEvaluatorFactoryBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-05-02 02:22:37.340 INFO 11 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'projectManagerPermission' of type [com.epam.ta.reportportal.auth.permissions.ProjectManagerPermission] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-05-02 02:22:37.450 INFO 11 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'dataSourceConfig' of type [com.epam.ta.reportportal.config.DataSourceConfig$$EnhancerBySpringCGLIB$$7b53bf4d] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-05-02 02:22:37.654 INFO 11 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
2020-05-02 02:22:39.056 INFO 11 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed.
2020-05-02 02:22:39.058 INFO 11 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'dataSource' of type [com.zaxxer.hikari.HikariDataSource] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-05-02 02:22:39.260 INFO 11 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'spring.datasource-org.springframework.boot.autoconfigure.jdbc.DataSourceProperties' of type [org.springframework.boot.autoconfigure.jdbc.DataSourceProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-05-02 02:22:39.452 INFO 11 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.boot.autoconfigure.jdbc.DataSourceInitializerInvoker' of type [org.springframework.boot.autoconfigure.jdbc.DataSourceInitializerInvoker] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-05-02 02:22:39.535 INFO 11 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'ACLContext' of type [com.epam.ta.reportportal.core.configs.ACLContext$$EnhancerBySpringCGLIB$$6e333ceb] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-05-02 02:22:39.852 INFO 11 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'coffeinCache' of type [org.springframework.cache.caffeine.CaffeineCache] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-05-02 02:22:39.948 INFO 11 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'permissionGrantingStrategy' of type [org.springframework.security.acls.domain.DefaultPermissionGrantingStrategy] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-05-02 02:22:39.955 INFO 11 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'aclAuthorizationStrategy' of type [com.epam.ta.reportportal.auth.acl.ReportPortalAclAuthorizationStrategyImpl] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-05-02 02:22:39.957 INFO 11 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'aclCache' of type [org.springframework.security.acls.domain.SpringCacheBasedAclCache] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-05-02 02:22:40.046 INFO 11 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'lookupStrategy' of type [org.springframework.security.acls.jdbc.BasicLookupStrategy] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-05-02 02:22:40.059 INFO 11 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'aclService' of type [com.epam.ta.reportportal.auth.acl.ReportPortalAclService] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-05-02 02:22:40.147 INFO 11 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'aclPermissionEvaluator' of type [org.springframework.security.acls.AclPermissionEvaluator] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-05-02 02:22:40.151 INFO 11 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'aclFullPermission' of type [com.epam.ta.reportportal.auth.permissions.AclFullPermission] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-05-02 02:22:40.236 INFO 11 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'aclReadPermission' of type [com.epam.ta.reportportal.auth.permissions.AclReadPermission] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-05-02 02:22:40.243 INFO 11 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'assignedToProjectPermission' of type [com.epam.ta.reportportal.auth.permissions.AssignedToProjectPermission] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-05-02 02:22:40.250 INFO 11 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'notCustomerPermission' of type [com.epam.ta.reportportal.auth.permissions.NotCustomerPermission] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-05-02 02:22:40.252 INFO 11 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'reporterPermission' of type [com.epam.ta.reportportal.auth.permissions.ReporterPermission] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-05-02 02:22:40.255 INFO 11 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'permissionEvaluator' of type [com.epam.ta.reportportal.auth.permissions.ReportPortalPermissionEvaluator] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-05-02 02:22:40.256 INFO 11 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'securityConfiguration.MethodSecurityConfig' of type [com.epam.ta.reportportal.core.configs.SecurityConfiguration$MethodSecurityConfig$$EnhancerBySpringCGLIB$$998bc8f7] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-05-02 02:22:40.437 INFO 11 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'methodSecurityMetadataSource' of type [org.springframework.security.access.method.DelegatingMethodSecurityMetadataSource] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-05-02 02:22:40.560 INFO 11 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'jacksonConfiguration' of type [com.epam.ta.reportportal.core.configs.JacksonConfiguration$$EnhancerBySpringCGLIB$$3275d909] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-05-02 02:22:42.437 INFO 11 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'objectMapper' of type [com.fasterxml.jackson.databind.ObjectMapper] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-05-02 02:22:43.139 INFO 11 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'jsonConverter' of type [org.springframework.http.converter.json.MappingJackson2HttpMessageConverter] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-05-02 02:22:43.158 INFO 11 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'stringConverter' of type [org.springframework.http.converter.StringHttpMessageConverter] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-05-02 02:22:43.242 INFO 11 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'mvcConfig' of type [com.epam.ta.reportportal.core.configs.MvcConfig$$EnhancerBySpringCGLIB$$fe4171f8] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-05-02 02:22:47.353 INFO 11 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8585 (http)
2020-05-02 02:22:47.448 INFO 11 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2020-05-02 02:22:47.448 INFO 11 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.31]
2020-05-02 02:22:47.849 INFO 11 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2020-05-02 02:22:47.849 INFO 11 --- [ main] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 30799 ms
2020-05-02 02:22:52.435 INFO 11 --- [ main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [name: default]
2020-05-02 02:22:53.036 INFO 11 --- [ main] org.hibernate.Version : HHH000412: Hibernate ORM core version 5.4.12.Final
2020-05-02 02:22:54.335 INFO 11 --- [ main] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.1.0.Final}
2020-05-02 02:22:58.444 INFO 11 --- [ main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: com.epam.ta.reportportal.commons.JsonbAwarePostgresDialect
2020-05-02 02:23:09.639 INFO 11 --- [ main] o.h.e.t.j.p.i.JtaPlatformInitiator : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
2020-05-02 02:23:09.650 INFO 11 --- [ main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2020-05-02 02:23:10.151 INFO 11 --- [ main] org.quartz.impl.StdSchedulerFactory : Using default implementation for ThreadExecutor
2020-05-02 02:23:10.243 INFO 11 --- [ main] org.quartz.core.SchedulerSignalerImpl : Initialized Scheduler Signaller of type: class org.quartz.core.SchedulerSignalerImpl
2020-05-02 02:23:10.244 INFO 11 --- [ main] org.quartz.core.QuartzScheduler : Quartz Scheduler v.2.3.2 created.
2020-05-02 02:23:10.256 INFO 11 --- [ main] o.s.s.quartz.LocalDataSourceJobStore : Using db table-based data access locking (synchronization).
2020-05-02 02:23:10.258 INFO 11 --- [ main] o.s.s.quartz.LocalDataSourceJobStore : JobStoreCMT initialized.
2020-05-02 02:23:10.258 INFO 11 --- [ main] org.quartz.core.QuartzScheduler : Scheduler meta-data: Quartz Scheduler (v2.3.2) 'reportportal' with instanceId 'api:3d399a8ccb9a8c7800a1c62f702319d1'
Scheduler class: 'org.quartz.core.QuartzScheduler' - running locally.
NOT STARTED.
Currently in standby mode.
Number of jobs executed: 0
Using thread pool 'org.quartz.simpl.SimpleThreadPool' - with 1 threads.
Using job-store 'org.springframework.scheduling.quartz.LocalDataSourceJobStore' - which supports persistence. and is clustered.
2020-05-02 02:23:10.258 INFO 11 --- [ main] org.quartz.impl.StdSchedulerFactory : Quartz scheduler 'reportportal' initialized from an externally provided properties instance.
2020-05-02 02:23:10.258 INFO 11 --- [ main] org.quartz.impl.StdSchedulerFactory : Quartz scheduler version: 2.3.2
2020-05-02 02:23:10.258 INFO 11 --- [ main] org.quartz.core.QuartzScheduler : JobFactory set to: com.epam.ta.reportportal.core.configs.SchedulerConfiguration$1#3c20e9d6
2020-05-02 02:25:22.440 ERROR 11 --- [ main] o.s.b.web.embedded.tomcat.TomcatStarter : Error starting Tomcat context. Exception: org.springframework.beans.factory.BeanCreationException. Message: Error creating bean with name 'servletEndpointRegistrar' defined in class path resource [org/springframework/boot/actuate/autoconfigure/endpoint/web/ServletEndpointManagementContextConfiguration$WebMvcServletEndpointManagementContextConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.actuate.endpoint.web.ServletEndpointRegistrar]: Factory method 'servletEndpointRegistrar' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'infoEndpoint' defined in class path resource [org/springframework/boot/actuate/autoconfigure/info/InfoEndpointAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.actuate.info.InfoEndpoint]: Factory method 'infoEndpoint' threw exception; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'infoContributorComposite' defined in URL [jar:file:/service-api-5.1.0-exec.jar!/BOOT-INF/classes!/com/epam/ta/reportportal/info/InfoContributorComposite.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'analyzerInfoContributor' defined in URL [jar:file:/service-api-5.1.0-exec.jar!/BOOT-INF/classes!/com/epam/ta/reportportal/info/AnalyzerInfoContributor.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'managementTemplate' defined in class path resource [com/epam/ta/reportportal/core/configs/rabbit/AnalyzerRabbitMqConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.epam.ta.reportportal.core.analyzer.auto.client.RabbitMqManagementClient]: Factory method 'managementTemplate' threw exception; nested exception is org.springframework.web.client.ResourceAccessException: I/O error on PUT request for "http://15.206.28.47:15672/api/vhosts/analyzer": Connect to 15.206.28.47:15672 [/15.206.28.47] failed: Connection timed out (Connection timed out); nested exception is org.apache.http.conn.HttpHostConnectException: Connect to 15.206.28.47:15672 [/15.206.28.47] failed: Connection timed out (Connection timed out)
2020-05-02 02:25:22.548 INFO 11 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
2020-05-02 02:25:22.635 WARN 11 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
2020-05-02 02:25:22.635 INFO 11 --- [ main] o.s.s.quartz.SchedulerFactoryBean : Shutting down Quartz Scheduler
2020-05-02 02:25:22.635 INFO 11 --- [ main] org.quartz.core.QuartzScheduler : Scheduler reportportal_$_api:3d399a8ccb9a8c7800a1c62f702319d1 shutting down.
2020-05-02 02:25:22.635 INFO 11 --- [ main] org.quartz.core.QuartzScheduler : Scheduler reportportal_$_api:3d399a8ccb9a8c7800a1c62f702319d1 paused.
2020-05-02 02:25:22.753 INFO 11 --- [ main] org.quartz.core.QuartzScheduler : Scheduler reportportal_$_api:3d399a8ccb9a8c7800a1c62f702319d1 shutdown complete.
2020-05-02 02:25:22.762 INFO 11 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated...
2020-05-02 02:25:22.834 INFO 11 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed.
2020-05-02 02:25:22.943 INFO 11 --- [ main] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2020-05-02 02:25:22.950 ERROR 11 --- [ main] o.s.boot.SpringApplication : Application run failed
org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:156)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:544)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215)
at com.epam.ta.reportportal.core.configs.ReportPortalApp.main(ReportPortalApp.java:37)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:51)
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:52)
Caused by: org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
Based on the error:
Exception: I/O error on PUT request for
"http://15.206.28.47:15672/api/vhosts/analyzer":
Connect to 15.206.28.47:15672 [/15.206.28.47] failed: Connection timed out
(Connection timed out);
your RabbitMQ instance is not accessible or VHOST analyzer is not created.
It looks like the problem is that it can't connect to 15.206.28.47 during startup.
I am migrating my spring cloud eureka application to AWS ECS and currently having some trouble doing so.
I have an ECS cluster on AWS in which an EC2 service of eureka-server
is running on it. in this service, there is a task running
My problem is that:
For my Eureka-server task, it suppose to run on External Link 18.136.147.71:8761 , but it isn't.This 18.136.147.71 is an auto assigned IP by AWS. the only setting i made was allocating an Elastic IP via EC2 Panel.
Although from CloudWatch log i can see that the service is running normal, i am unable to access the link as it always gives this error
This site can’t be reached. 18.136.147.71:8761 took too long to respond.
what are some possible errors that might have lead to this problem?
there is no problem with the docker image because i am able to run it locally on my computer.
below are my CloudWatch Log. This log is exactly the same as my local terminal output when i run the docker image locally:
2018-11-21 04:10:13.567 INFO 1 --- [ main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext#1376c05c: startup date [Wed Nov 21 04:10:13 GMT 2018]; root of context hierarchy
2018-11-21 04:10:15.178 INFO 1 --- [ main] f.a.AutowiredAnnotationBeanPostProcessor : JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
2018-11-21 04:10:15.366 INFO 1 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'configurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$7e4594e4] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v1.5.2.RELEASE)
2018-11-21 04:10:18.870 INFO 1 --- [ main] eureka.server.ServerApplication : No active profile set, falling back to default profiles: default
2018-11-21 04:10:18.972 INFO 1 --- [ main] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext#735b5592: startup date [Wed Nov 21 04:10:18 GMT 2018]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext#1376c05c
2018-11-21 04:10:24.655 INFO 1 --- [ main] o.s.cloud.context.scope.GenericScope : BeanFactory id=1ce1cdc0-5c4b-3c0c-ae18-58ba57b52bb6
2018-11-21 04:10:24.681 INFO 1 --- [ main] f.a.AutowiredAnnotationBeanPostProcessor : JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
2018-11-21 04:10:25.164 INFO 1 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.netflix.metrics.MetricsInterceptorConfiguration$MetricsRestTemplateConfiguration' of type [org.springframework.cloud.netflix.metrics.MetricsInterceptorConfiguration$MetricsRestTemplateConfiguration$$EnhancerBySpringCGLIB$$94583828] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2018-11-21 04:10:25.179 INFO 1 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$7e4594e4] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2018-11-21 04:10:26.276 INFO 1 --- [ main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat initialized with port(s): 8761 (http)
2018-11-21 04:10:26.370 INFO 1 --- [ main] o.apache.catalina.core.StandardService : Starting service Tomcat
2018-11-21 04:10:26.371 INFO 1 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/8.5.11
2018-11-21 04:10:26.775 INFO 1 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2018-11-21 04:10:26.775 INFO 1 --- [ost-startStop-1] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 7803 ms
2018-11-21 04:10:29.661 INFO 1 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'metricsFilter' to: [/*]
2018-11-21 04:10:29.662 INFO 1 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'characterEncodingFilter' to: [/*]
2018-11-21 04:10:29.662 INFO 1 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2018-11-21 04:10:29.662 INFO 1 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'httpPutFormContentFilter' to: [/*]
2018-11-21 04:10:29.662 INFO 1 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'requestContextFilter' to: [/*]
2018-11-21 04:10:29.664 INFO 1 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'webRequestTraceFilter' to: [/*]
2018-11-21 04:10:29.664 INFO 1 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'servletContainer' to urls: [/eureka/*]
2018-11-21 04:10:29.664 INFO 1 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'applicationContextIdFilter' to: [/*]
2018-11-21 04:10:29.665 INFO 1 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean : Mapping servlet: 'dispatcherServlet' to [/]
2018-11-21 04:10:30.190 INFO 1 --- [ost-startStop-1] c.s.j.s.i.a.WebApplicationImpl : Initiating Jersey application, version 'Jersey: 1.19.1 03/11/2016 02:08 PM'
2018-11-21 04:10:30.676 INFO 1 --- [ost-startStop-1] c.n.d.provider.DiscoveryJerseyProvider : Using JSON encoding codec LegacyJacksonJson
2018-11-21 04:10:30.677 INFO 1 --- [ost-startStop-1] c.n.d.provider.DiscoveryJerseyProvider : Using JSON decoding codec LegacyJacksonJson
2018-11-21 04:10:31.261 INFO 1 --- [ost-startStop-1] c.n.d.provider.DiscoveryJerseyProvider : Using XML encoding codec XStreamXml
2018-11-21 04:10:31.262 INFO 1 --- [ost-startStop-1] c.n.d.provider.DiscoveryJerseyProvider : Using XML decoding codec XStreamXml
2018-11-21 04:10:34.871 INFO 1 --- [ main] s.w.s.m.m.a.RequestMappingHandlerAdapter : Looking for #ControllerAdvice: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext#735b5592: startup date [Wed Nov 21 04:10:18 GMT 2018]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext#1376c05c
2018-11-21 04:10:35.375 INFO 1 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
2018-11-21 04:10:35.376 INFO 1 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
2018-11-21 04:10:35.380 INFO 1 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/lastn],methods=[GET]}" onto public java.lang.String org.springframework.cloud.netflix.eureka.server.EurekaController.lastn(javax.servlet.http.HttpServletRequest,java.util.Map<java.lang.String, java.lang.Object>)
2018-11-21 04:10:35.380 INFO 1 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/],methods=[GET]}" onto public java.lang.String org.springframework.cloud.netflix.eureka.server.EurekaController.status(javax.servlet.http.HttpServletRequest,java.util.Map<java.lang.String, java.lang.Object>)
2018-11-21 04:10:35.482 INFO 1 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-11-21 04:10:35.482 INFO 1 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-11-21 04:10:35.758 INFO 1 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-11-21 04:10:38.472 INFO 1 --- [ main] o.s.b.a.e.mvc.EndpointHandlerMapping : Mapped "{[/autoconfig || /autoconfig.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2018-11-21 04:10:38.473 INFO 1 --- [ main] o.s.b.a.e.mvc.EndpointHandlerMapping : Mapped "{[/mappings || /mappings.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2018-11-21 04:10:38.474 INFO 1 --- [ main] o.s.b.a.e.mvc.EndpointHandlerMapping : Mapped "{[/configprops || /configprops.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2018-11-21 04:10:38.475 INFO 1 --- [ main] o.s.b.a.e.mvc.EndpointHandlerMapping : Mapped "{[/restart || /restart.json],methods=[POST]}" onto public java.lang.Object org.springframework.cloud.context.restart.RestartMvcEndpoint.invoke()
2018-11-21 04:10:38.475 INFO 1 --- [ main] o.s.b.a.e.mvc.EndpointHandlerMapping : Mapped "{[/archaius || /archaius.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2018-11-21 04:10:38.476 INFO 1 --- [ main] o.s.b.a.e.mvc.EndpointHandlerMapping : Mapped "{[/dump || /dump.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2018-11-21 04:10:38.479 INFO 1 --- [ main] o.s.b.a.e.mvc.EndpointHandlerMapping : Mapped "{[/loggers/{name:.*}],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.LoggersMvcEndpoint.get(java.lang.String)
2018-11-21 04:10:38.556 INFO 1 --- [ main] o.s.b.a.e.mvc.EndpointHandlerMapping : Mapped "{[/loggers/{name:.*}],methods=[POST],consumes=[application/vnd.spring-boot.actuator.v1+json || application/json],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.LoggersMvcEndpoint.set(java.lang.String,java.util.Map<java.lang.String, java.lang.String>)
2018-11-21 04:10:38.556 INFO 1 --- [ main] o.s.b.a.e.mvc.EndpointHandlerMapping : Mapped "{[/loggers || /loggers.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2018-11-21 04:10:38.557 INFO 1 --- [ main] o.s.b.a.e.mvc.EndpointHandlerMapping : Mapped "{[/refresh || /refresh.json],methods=[POST]}" onto public java.lang.Object org.springframework.cloud.endpoint.GenericPostableMvcEndpoint.invoke()
2018-11-21 04:10:38.557 INFO 1 --- [ main] o.s.b.a.e.mvc.EndpointHandlerMapping : Mapped "{[/resume || /resume.json],methods=[POST]}" onto public java.lang.Object org.springframework.cloud.endpoint.GenericPostableMvcEndpoint.invoke()
2018-11-21 04:10:38.558 INFO 1 --- [ main] o.s.b.a.e.mvc.EndpointHandlerMapping : Mapped "{[/auditevents || /auditevents.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public org.springframework.http.ResponseEntity<?> org.springframework.boot.actuate.endpoint.mvc.AuditEventsMvcEndpoint.findByPrincipalAndAfterAndType(java.lang.String,java.util.Date,java.lang.String)
2018-11-21 04:10:38.559 INFO 1 --- [ main] o.s.b.a.e.mvc.EndpointHandlerMapping : Mapped "{[/info || /info.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2018-11-21 04:10:38.559 INFO 1 --- [ main] o.s.b.a.e.mvc.EndpointHandlerMapping : Mapped "{[/env],methods=[POST]}" onto public java.lang.Object org.springframework.cloud.context.environment.EnvironmentManagerMvcEndpoint.value(java.util.Map<java.lang.String, java.lang.String>)
2018-11-21 04:10:38.560 INFO 1 --- [ main] o.s.b.a.e.mvc.EndpointHandlerMapping : Mapped "{[/env/reset],methods=[POST]}" onto public java.util.Map<java.lang.String, java.lang.Object> org.springframework.cloud.context.environment.EnvironmentManagerMvcEndpoint.reset()
2018-11-21 04:10:38.560 INFO 1 --- [ main] o.s.b.a.e.mvc.EndpointHandlerMapping : Mapped "{[/health || /health.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.HealthMvcEndpoint.invoke(javax.servlet.http.HttpServletRequest,java.security.Principal)
2018-11-21 04:10:38.565 INFO 1 --- [ main] o.s.b.a.e.mvc.EndpointHandlerMapping : Mapped "{[/heapdump || /heapdump.json],methods=[GET],produces=[application/octet-stream]}" onto public void org.springframework.boot.actuate.endpoint.mvc.HeapdumpMvcEndpoint.invoke(boolean,javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse) throws java.io.IOException,javax.servlet.ServletException
2018-11-21 04:10:38.565 INFO 1 --- [ main] o.s.b.a.e.mvc.EndpointHandlerMapping : Mapped "{[/beans || /beans.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2018-11-21 04:10:38.568 INFO 1 --- [ main] o.s.b.a.e.mvc.EndpointHandlerMapping : Mapped "{[/metrics/{name:.*}],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.MetricsMvcEndpoint.value(java.lang.String)
2018-11-21 04:10:38.568 INFO 1 --- [ main] o.s.b.a.e.mvc.EndpointHandlerMapping : Mapped "{[/metrics || /metrics.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2018-11-21 04:10:38.568 INFO 1 --- [ main] o.s.b.a.e.mvc.EndpointHandlerMapping : Mapped "{[/features || /features.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2018-11-21 04:10:38.569 INFO 1 --- [ main] o.s.b.a.e.mvc.EndpointHandlerMapping : Mapped "{[/env/{name:.*}],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EnvironmentMvcEndpoint.value(java.lang.String)
2018-11-21 04:10:38.569 INFO 1 --- [ main] o.s.b.a.e.mvc.EndpointHandlerMapping : Mapped "{[/env || /env.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2018-11-21 04:10:38.570 INFO 1 --- [ main] o.s.b.a.e.mvc.EndpointHandlerMapping : Mapped "{[/trace || /trace.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2018-11-21 04:10:38.570 INFO 1 --- [ main] o.s.b.a.e.mvc.EndpointHandlerMapping : Mapped "{[/pause || /pause.json],methods=[POST]}" onto public java.lang.Object org.springframework.cloud.endpoint.GenericPostableMvcEndpoint.invoke()
2018-11-21 04:10:38.570 INFO 1 --- [ main] o.s.b.a.e.mvc.EndpointHandlerMapping : Mapped "{[/service-registry/instance-status],methods=[GET]}" onto public org.springframework.http.ResponseEntity org.springframework.cloud.client.serviceregistry.endpoint.ServiceRegistryEndpoint.getStatus()
2018-11-21 04:10:38.570 INFO 1 --- [ main] o.s.b.a.e.mvc.EndpointHandlerMapping : Mapped "{[/service-registry/instance-status],methods=[POST]}" onto public org.springframework.http.ResponseEntity<?> org.springframework.cloud.client.serviceregistry.endpoint.ServiceRegistryEndpoint.setStatus(java.lang.String)
2018-11-21 04:10:38.989 INFO 1 --- [ main] o.s.ui.freemarker.SpringTemplateLoader : SpringTemplateLoader for FreeMarker: using resource loader [org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext#735b5592: startup date [Wed Nov 21 04:10:18 GMT 2018]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext#1376c05c] and template loader path [classpath:/templates/]
2018-11-21 04:10:38.990 INFO 1 --- [ main] o.s.w.s.v.f.FreeMarkerConfigurer : ClassTemplateLoader for Spring macros added to FreeMarker configuration
2018-11-21 04:10:39.462 WARN 1 --- [ main] o.s.c.n.a.ArchaiusAutoConfiguration : No spring.application.name found, defaulting to 'application'
2018-11-21 04:10:39.470 WARN 1 --- [ main] c.n.c.sources.URLConfigurationSource : No URLs will be polled as dynamic configuration sources.
2018-11-21 04:10:39.471 INFO 1 --- [ main] c.n.c.sources.URLConfigurationSource : To enable URLs as dynamic configuration sources, define System property archaius.configurationSource.additionalUrls or make config.properties available on classpath.
2018-11-21 04:10:39.486 WARN 1 --- [ main] c.n.c.sources.URLConfigurationSource : No URLs will be polled as dynamic configuration sources.
2018-11-21 04:10:39.555 INFO 1 --- [ main] c.n.c.sources.URLConfigurationSource : To enable URLs as dynamic configuration sources, define System property archaius.configurationSource.additionalUrls or make config.properties available on classpath.
2018-11-21 04:10:39.760 INFO 1 --- [ main] o.s.c.n.eureka.InstanceInfoFactory : Setting initial instance status as: STARTING
2018-11-21 04:10:39.979 INFO 1 --- [ main] com.netflix.discovery.DiscoveryClient : Initializing Eureka in region us-east-1
2018-11-21 04:10:39.980 INFO 1 --- [ main] com.netflix.discovery.DiscoveryClient : Client configured to neither register nor query for data.
2018-11-21 04:10:40.073 INFO 1 --- [ main] com.netflix.discovery.DiscoveryClient : Discovery Client initialized at timestamp 1542773440073 with initial instances count: 0
2018-11-21 04:10:40.557 INFO 1 --- [ main] c.n.eureka.DefaultEurekaServerContext : Initializing ...
2018-11-21 04:10:40.562 INFO 1 --- [ main] c.n.eureka.cluster.PeerEurekaNodes : Adding new peer nodes [http://localhost:8761/eureka/]
2018-11-21 04:10:41.886 INFO 1 --- [ main] c.n.d.provider.DiscoveryJerseyProvider : Using JSON encoding codec LegacyJacksonJson
2018-11-21 04:10:41.887 INFO 1 --- [ main] c.n.d.provider.DiscoveryJerseyProvider : Using JSON decoding codec LegacyJacksonJson
2018-11-21 04:10:41.887 INFO 1 --- [ main] c.n.d.provider.DiscoveryJerseyProvider : Using XML encoding codec XStreamXml
2018-11-21 04:10:41.887 INFO 1 --- [ main] c.n.d.provider.DiscoveryJerseyProvider : Using XML decoding codec XStreamXml
2018-11-21 04:10:42.568 INFO 1 --- [ main] c.n.eureka.cluster.PeerEurekaNodes : Replica node URL: http://localhost:8761/eureka/
2018-11-21 04:10:42.577 INFO 1 --- [ main] c.n.e.registry.AbstractInstanceRegistry : Finished initializing remote region registries. All known remote regions: []
2018-11-21 04:10:42.577 INFO 1 --- [ main] c.n.eureka.DefaultEurekaServerContext : Initialized
2018-11-21 04:10:42.859 INFO 1 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup
2018-11-21 04:10:42.868 INFO 1 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Bean with name 'environmentManager' has been autodetected for JMX exposure
2018-11-21 04:10:42.869 INFO 1 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Bean with name 'configurationPropertiesRebinder' has been autodetected for JMX exposure
2018-11-21 04:10:42.870 INFO 1 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Bean with name 'refreshEndpoint' has been autodetected for JMX exposure
2018-11-21 04:10:42.870 INFO 1 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Bean with name 'restartEndpoint' has been autodetected for JMX exposure
2018-11-21 04:10:42.871 INFO 1 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Bean with name 'serviceRegistryEndpoint' has been autodetected for JMX exposure
2018-11-21 04:10:42.872 INFO 1 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Bean with name 'refreshScope' has been autodetected for JMX exposure
2018-11-21 04:10:42.874 INFO 1 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Located managed bean 'environmentManager': registering with JMX server as MBean [org.springframework.cloud.context.environment:name=environmentManager,type=EnvironmentManager]
2018-11-21 04:10:42.964 INFO 1 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Located managed bean 'restartEndpoint': registering with JMX server as MBean [org.springframework.cloud.context.restart:name=restartEndpoint,type=RestartEndpoint]
2018-11-21 04:10:42.974 INFO 1 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Located managed bean 'serviceRegistryEndpoint': registering with JMX server as MBean [org.springframework.cloud.client.serviceregistry.endpoint:name=serviceRegistryEndpoint,type=ServiceRegistryEndpoint]
2018-11-21 04:10:42.980 INFO 1 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Located managed bean 'refreshScope': registering with JMX server as MBean [org.springframework.cloud.context.scope.refresh:name=refreshScope,type=RefreshScope]
2018-11-21 04:10:43.068 INFO 1 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Located managed bean 'configurationPropertiesRebinder': registering with JMX server as MBean [org.springframework.cloud.context.properties:name=configurationPropertiesRebinder,context=735b5592,type=ConfigurationPropertiesRebinder]
2018-11-21 04:10:43.072 INFO 1 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Located managed bean 'refreshEndpoint': registering with JMX server as MBean [org.springframework.cloud.endpoint:name=refreshEndpoint,type=RefreshEndpoint]
2018-11-21 04:10:43.773 INFO 1 --- [ main] o.s.c.support.DefaultLifecycleProcessor : Starting beans in phase 0
2018-11-21 04:10:43.774 INFO 1 --- [ main] o.s.c.n.e.s.EurekaServiceRegistry : Registering application unknown with eureka with status UP
2018-11-21 04:10:43.973 INFO 1 --- [ Thread-11] o.s.c.n.e.server.EurekaServerBootstrap : Setting the eureka configuration..
2018-11-21 04:10:43.974 INFO 1 --- [ Thread-11] o.s.c.n.e.server.EurekaServerBootstrap : Eureka data center value eureka.datacenter is not set, defaulting to default
2018-11-21 04:10:43.974 INFO 1 --- [ Thread-11] o.s.c.n.e.server.EurekaServerBootstrap : Eureka environment value eureka.environment is not set, defaulting to test
2018-11-21 04:10:44.071 INFO 1 --- [ Thread-11] o.s.c.n.e.server.EurekaServerBootstrap : isAws returned false
2018-11-21 04:10:44.071 INFO 1 --- [ Thread-11] o.s.c.n.e.server.EurekaServerBootstrap : Initialized server context
2018-11-21 04:10:44.072 INFO 1 --- [ Thread-11] c.n.e.r.PeerAwareInstanceRegistryImpl : Got 1 instances from neighboring DS node
2018-11-21 04:10:44.072 INFO 1 --- [ Thread-11] c.n.e.r.PeerAwareInstanceRegistryImpl : Renew threshold is: 1
2018-11-21 04:10:44.072 INFO 1 --- [ Thread-11] c.n.e.r.PeerAwareInstanceRegistryImpl : Changing status to UP
2018-11-21 04:10:44.165 INFO 1 --- [ Thread-11] e.s.EurekaServerInitializerConfiguration : Started Eureka Server
2018-11-21 04:10:44.367 INFO 1 --- [ main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 8761 (http)
2018-11-21 04:10:44.369 INFO 1 --- [ main] .s.c.n.e.s.EurekaAutoServiceRegistration : Updating port to 8761
2018-11-21 04:10:44.372 INFO 1 --- [ main] eureka.server.ServerApplication : Started ServerApplication in 33.505 seconds (JVM running for 36.231)
2018-11-21 04:11:44.159 INFO 1 --- [a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry : Running the evict task with compensationTime 0ms
2018-11-21 04:12:44.159 INFO 1 --- [a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry : Running the evict task with compensationTime 0ms
answering my own question. The reason was because the inbound rule for my Security group was not set.
Steps to set
EC2->Security Groups-> Choose your security group --> Inbound tab --> Edit --> set the port
I am using AWS ECS to deploy Eureka in my Cluster to zones inside us-east-1 region. ECS dynamically deploys to any region and I cannot predetermine the IP or domain the EC2 instance will be, hence I use DNS.
I am using DNS as illustrated here https://github.com/Netflix/eureka/wiki/Deploying-Eureka-Servers-in-EC2. Below are my configurations:
eureka:
instance:
healthCheckUrlPath: /manage/health
client:
region: us-east-1
availabilityZones:
us-east-1: us-east-1a,us-east-1c
eurekaServerPort: 8761
useDnsForFetchingServiceUrls: true
eurekaServerDNSName: eureka.mydomain.com
eurekaServerURLContext: eureka
registerWithEureka: true
fetchRegistry: true
cloud:
aws:
credentials:
accessKey: AWS_KEY
secretKey: AWS_KEY_SECRET
region:
static: us-east-1
The user with AWS_KEY has this policy attached:
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"ec2:AllocateAddress",
"ec2:AssociateAddress",
"ec2:DescribeAddresses",
"ec2:DisassociateAddress"
],
"Sid": "Stmt1375723773000",
"Resource": [
"*"
],
"Effect": "Allow"
}
]
}
and configured the EurekaInstanceConfigBean configured as:
#Bean
#Profile("!default")
public EurekaInstanceConfigBean eurekaInstanceConfig(InetUtils inetUtils) {
EurekaInstanceConfigBean config = new EurekaInstanceConfigBean(inetUtils);
AmazonInfo info = AmazonInfo.Builder.newBuilder().autoBuild("eureka");
info.getMetadata().put(AmazonInfo.MetaDataKey.publicHostname.getName(), info.get(AmazonInfo.MetaDataKey.publicIpv4));
config.setHostname(info.get(AmazonInfo.MetaDataKey.publicHostname));
config.setIpAddress(info.get(AmazonInfo.MetaDataKey.publicIpv4));
config.setNonSecurePort(port);
config.setDataCenterInfo(info);
return config;
}
GOOD THING: Eureka recognise my Route 53 configured eureka.mydomain.com DNS EIPs and it tries to bind, the (available and unassigned) EIP in zone us-east-1c, to the instance where my eureka server is deployed
PROBLEM: I get the following logs and Unauthorized error as below when booting my app:
...................................
.................................
2017-04-10 16:07:42.141 DEBUG 5 --- [ main] c.n.d.s.r.a.DnsTxtRecordClusterResolver : Resolved txt.us-east-1.eureka.mydomain.com to [AwsEndpoint{ serviceUrl=
'http://ec2-34.200.47.82.compute-1.amazonaws.com:8761/eureka', region='us-east-1', zone='us-east-1c'}]
2017-04-10 16:07:42.141 DEBUG 5 --- [ main] c.n.d.s.r.a.ZoneAffinityClusterResolver : Local zone=us-east-1c; resolved to: [AwsEndpoint{ serviceUrl='http://ec2-3
4.200.47.82.compute-1.amazonaws.com:8761/eureka', region='us-east-1', zone='us-east-1c'}]
2017-04-10 16:07:42.204 INFO 5 --- [ main] com.netflix.discovery.DiscoveryClient : Disable delta property : false
2017-04-10 16:07:42.209 INFO 5 --- [ main] com.netflix.discovery.DiscoveryClient : Single vip registry refresh property : null
2017-04-10 16:07:42.209 INFO 5 --- [ main] com.netflix.discovery.DiscoveryClient : Force full registry fetch : false
2017-04-10 16:07:42.209 INFO 5 --- [ main] com.netflix.discovery.DiscoveryClient : Application is null : false
2017-04-10 16:07:42.209 INFO 5 --- [ main] com.netflix.discovery.DiscoveryClient : Registered Applications size is zero : true
2017-04-10 16:07:42.209 INFO 5 --- [ main] com.netflix.discovery.DiscoveryClient : Application version is -1: true
2017-04-10 16:07:42.211 INFO 5 --- [ main] com.netflix.discovery.DiscoveryClient : Getting all instance registry info from the eureka server
2017-04-10 16:07:42.213 DEBUG 5 --- [ main] c.n.d.s.t.d.SessionedEurekaHttpClient : Ending a session and starting anew
2017-04-10 16:07:42.222 DEBUG 5 --- [ main] n.d.s.t.j.AbstractJerseyEurekaHttpClient : Created client for url: http://ec2-34.200.47.82.compute-1.amazonaws.com:87
61/eureka
2017-04-10 16:07:42.313 DEBUG 5 --- [ main] c.n.d.shared.MonitoredConnectionManager : Get connection: {}->http://ec2-34.200.47.82.compute-1.amazonaws.com:8761,
timeout = 5000
2017-04-10 16:07:42.314 DEBUG 5 --- [ main] c.n.d.shared.NamedConnectionPool : [{}->http://ec2-34.200.47.82.compute-1.amazonaws.com:8761] total kept aliv
e: 0, total issued: 0, total allocated: 0 out of 200
2017-04-10 16:07:42.314 DEBUG 5 --- [ main] c.n.d.shared.NamedConnectionPool : No free connections [{}->http://ec2-34.200.47.82.compute-1.amazonaws.com:8
761][null]
2017-04-10 16:07:42.314 DEBUG 5 --- [ main] c.n.d.shared.NamedConnectionPool : Available capacity: 50 out of 50 [{}->http://ec2-34.200.47.82.compute-1.am
azonaws.com:8761][null]
2017-04-10 16:07:42.314 DEBUG 5 --- [ main] c.n.d.shared.NamedConnectionPool : Creating new connection [{}->http://ec2-34.200.47.82.compute-1.amazonaws.c
om:8761]
2017-04-10 16:07:42.330 DEBUG 5 --- [ main] c.n.d.shared.MonitoredConnectionManager : Released connection is not reusable.
2017-04-10 16:07:42.331 DEBUG 5 --- [ main] c.n.d.shared.NamedConnectionPool : Releasing connection [{}->http://ec2-34.200.47.82.compute-1.amazonaws.com:
8761][null]
2017-04-10 16:07:42.331 DEBUG 5 --- [ main] c.n.d.shared.NamedConnectionPool : Notifying no-one, there are no waiting threads
2017-04-10 16:07:42.331 DEBUG 5 --- [ main] n.d.s.t.j.AbstractJerseyEurekaHttpClient : Jersey HTTP GET http://ec2-34.200.47.82.compute-1.amazonaws.com:8761/eurek
a/apps/?; statusCode=N/A
2017-04-10 16:07:42.345 ERROR 5 --- [ main] c.n.d.s.t.d.RedirectingEurekaHttpClient : Request execution
....................
....................
2017-04-10 16:07:49.455 DEBUG 5 --- [ Thread-11] c.n.discovery.endpoint.EndpointUtils : This client will talk to the following serviceUrls in order : [http://ec2-
34.206.31.211.compute-1.amazonaws.com:8761/eureka/]
2017-04-10 16:07:49.455 DEBUG 5 --- [ Thread-11] c.n.discovery.endpoint.EndpointUtils : The region url to be looked up is txt.us-east-1.eureka.mydomain.com :
2017-04-10 16:07:49.456 DEBUG 5 --- [ Thread-11] c.n.discovery.endpoint.EndpointUtils : The zoneName mapped to region us-east-1 is us-east-1c
2017-04-10 16:07:49.456 DEBUG 5 --- [ Thread-11] c.n.discovery.endpoint.EndpointUtils : Checking if the instance zone us-east-1c is the same as the zone from DNS
us-east-1c
2017-04-10 16:07:49.456 DEBUG 5 --- [ Thread-11] c.n.discovery.endpoint.EndpointUtils : The zone index from the list [us-east-1c] that matches the instance zone u
s-east-1c is 0
2017-04-10 16:07:49.456 DEBUG 5 --- [ Thread-11] c.n.discovery.endpoint.EndpointUtils : The zone url to be looked up is txt.us-east-1c.eureka.mydomain.com :
2017-04-10 16:07:49.457 DEBUG 5 --- [ Thread-11] c.n.discovery.endpoint.EndpointUtils : The eureka url for the dns name txt.us-east-1c.eureka.mydomain.com is e
c2-34.200.47.82.compute-1.amazonaws.com
2017-04-10 16:07:49.457 DEBUG 5 --- [ Thread-11] c.n.discovery.endpoint.EndpointUtils : The EC2 url is http://ec2-34.200.47.82.compute-1.amazonaws.com:8761/eureka
/
2017-04-10 16:07:49.457 DEBUG 5 --- [ Thread-11] c.n.discovery.endpoint.EndpointUtils : This client will talk to the following serviceUrls in order : [http://ec2-
34.200.47.82.compute-1.amazonaws.com:8761/eureka/]
**2017-04-10 16:07:49.527 ERROR 5 --- [ Thread-11] com.netflix.eureka.aws.EIPManager : Failed to bind elastic IP: 34.200.47.82 to i-0bc1018ccdcc69148
com.amazonaws.AmazonServiceException: You are not authorized to perform this operation. (Service: AmazonEC2; Status Code: 403; Error Code: UnauthorizedOperation; Request I
D: f9b2dec4-6d79-4da2-bbac-061416bde000)**
at com.amazonaws.http.AmazonHttpClient.handleErrorResponse(AmazonHttpClient.java:1378) ~[aws-java-sdk-core-1.11.18.jar!/:na]
at com.amazonaws.http.AmazonHttpClient.executeOneRequest(AmazonHttpClient.java:924) ~[aws-java-sdk-core-1.11.18.jar!/:na]
at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:702) ~[aws-java-sdk-core-1.11.18.jar!/:na]
at com.amazonaws.http.AmazonHttpClient.doExecute(AmazonHttpClient.java:454) ~[aws-java-sdk-core-1.11.18.jar!/:na]
at com.amazonaws.http.AmazonHttpClient.executeWithTimer(AmazonHttpClient.java:416) ~[aws-java-sdk-core-1.11.18.jar!/:na]
at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:365) ~[aws-java-sdk-core-1.11.18.jar!/:na]
at com.amazonaws.services.ec2.AmazonEC2Client.doInvoke(AmazonEC2Client.java:12003) ~[aws-java-sdk-ec2-1.11.18.jar!/:na]
at com.amazonaws.services.ec2.AmazonEC2Client.invoke(AmazonEC2Client.java:11973) ~[aws-java-sdk-ec2-1.11.18.jar!/:na]
at com.amazonaws.services.ec2.AmazonEC2Client.describeAddresses(AmazonEC2Client.java:4716) ~[aws-java-sdk-ec2-1.11.18.jar!/:na]
at com.netflix.eureka.aws.EIPManager.bindEIP(EIPManager.java:202) [eureka-core-1.4.12.jar!/:1.4.12]
at com.netflix.eureka.aws.EIPManager.handleEIPBinding(EIPManager.java:136) [eureka-core-1.4.12.jar!/:1.4.12]
at com.netflix.eureka.aws.EIPManager.start(EIPManager.java:105) [eureka-core-1.4.12.jar!/:1.4.12]
at com.netflix.eureka.aws.AwsBinderDelegate.start(AwsBinderDelegate.java:42) [eureka-core-1.4.12.jar!/:1.4.12]
at org.springframework.cloud.netflix.eureka.server.EurekaServerBootstrap.initEurekaServerContext(EurekaServerBootstrap.java:145) [spring-cloud-netflix-eureka-serve
r-1.2.6.RELEASE.jar!/:1.2.6.RELEASE]
at org.springframework.cloud.netflix.eureka.server.EurekaServerBootstrap.contextInitialized(EurekaServerBootstrap.java:81) [spring-cloud-netflix-eureka-server-1.2.
6.RELEASE.jar!/:1.2.6.RELEASE]
at org.springframework.cloud.netflix.eureka.server.EurekaServerInitializerConfiguration$1.run(EurekaServerInitializerConfiguration.java:70) [spring-cloud-netflix-e
ureka-server-1.2.6.RELEASE.jar!/:1.2.6.RELEASE]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_121]
2017-04-10 16:07:49.527 INFO 5 --- [ Thread-11] com.netflix.eureka.aws.EIPManager : No EIP is free to be associated with this instance. Candidate EIPs are: [3
4.200.47.82]
......................................
........................................
........................................
QUESTION: I have attached the policy to allow Eureka to bind the Elastic IP to the instance where it is deployed but WHY am I getting a You are not authorized to perform this operation. (Service: AmazonEC2; Status Code: 403; Error Code: UnauthorizedOperation and how can I fix this? As it stands, I have spend more than a day Googling and still the same error :(
I tried the netflix way of configuring eureka like below but to no avail :(:
eureka:
awsAccessId: AWS_KEY
awsSecretKey:AWS_KEY_SECRET
asgName: EIPAccessPolicyGroup
So I finally got a solution and had help from #DirkLachowski and #spencergibb on this post. Thanks a lot guys. So I only had to change this:
eureka:
awsAccessId: AWS_KEY
awsSecretKey:AWS_KEY_SECRET
asgName: EIPAccessPolicyGroup
To this:
eureka:
server:
aWSAccessId: AWS_KEY
aWSSecretKey: AWS_SECRET_KEY
asgName: EC2ContainerService_AUTO_SCALING_GROUP_CREATED_BY_ECS_FOR_MY_CLUSTER
So each eureka server bind an unused/free EIP that I put on my TXT DNS records to the EC2 instance where my eureka server is running :)