dimanche 13 avril 2014

Java - débutant-jJava-Amazon Elastic Beanstalk-incapable de préciser correctement santé vérifier l'url-aussi, quelle est l'url de base - Stack Overflow


I have created a sample web application in Java. It has no errors, and I was able to create a WAR archive successfully. I also tested this successfully in local Tomcat 7 server.


Now, this sample web app has 2 servlets- "home" and "runsinglecrawljob". The name of the war archive is "sparkcrawler0.12.war".


So, in local Tomcat, I access the web app at


 http://localhost:8080/SparkCrawler0.12/runsinglecrawljob

And the other servlet is


 http://localhost:8080/SparkCrawler0.12/home

Now, when I created an Elastic Beanstalk environment, I specified health check url="/home"


But I am getting error that health check url is not responsive, and because of this the application is not running in Elastic Beanstalk- it is showing a 503 error- as per Google Chrome this is the exact message --


"HTTP Error 503 (Service Unavailable): The server is currently unable to handle the request. This code indicates this is a temporary condition, and the server will be up again after a delay."


Now, what is the correct value of health check URL?


Also, if my URL is


 http://spark.elasticbeanstalk.com

as defined in Elastic Beanstalk, then do I access the web app at


 http://spark.elasticbeanstalk.com/SparkCrawler0.12/runsinglecrawljob

Or do I access the web app at


 http://spark.elasticbeanstalk.com/runsinglecrawljob ?



I don't know if this is related or not, but I have a very similar issue but with a PHP codeigniter application.


I uploaded the application, and 'index.php' is the normal starting point of the application. I also have a simple "phpinfo.php" that sits parallel to the index.php.


So, the URL is myApp.elasticbeanstalk.com which hits index.php and it is fine.


However, for my health check, I set it to /phpinfo.php because I want myApp.elasticbeanstalk.com/phpinfo.php to be used as the health check.


If I do this, the health check always fails, and so my application does not run and I see the glaring red box of doom.


This has been driving me crazy.


(Why do I want to do this? -- it's because I wanted to add an .htaccess file to the application root that requires a password for everything except the phpinfo.php file, and I tested this locally and it works. I did not add the .htaccess file yet -- I just wanted to see if I could point the health check to something besides "/" and have it work.


UPDATE -- I sorted out my issue. It turns out that when I launch one of these elastic beanstalk environments, I have to set up the healthcheck url right then and there to be /phpinfo.php and then upload my application. When I was fussing with this earlier, I would try to edit the configuration later to change the health check url and that never worked and the instance would never come alive again.



I have created a sample web application in Java. It has no errors, and I was able to create a WAR archive successfully. I also tested this successfully in local Tomcat 7 server.


Now, this sample web app has 2 servlets- "home" and "runsinglecrawljob". The name of the war archive is "sparkcrawler0.12.war".


So, in local Tomcat, I access the web app at


 http://localhost:8080/SparkCrawler0.12/runsinglecrawljob

And the other servlet is


 http://localhost:8080/SparkCrawler0.12/home

Now, when I created an Elastic Beanstalk environment, I specified health check url="/home"


But I am getting error that health check url is not responsive, and because of this the application is not running in Elastic Beanstalk- it is showing a 503 error- as per Google Chrome this is the exact message --


"HTTP Error 503 (Service Unavailable): The server is currently unable to handle the request. This code indicates this is a temporary condition, and the server will be up again after a delay."


Now, what is the correct value of health check URL?


Also, if my URL is


 http://spark.elasticbeanstalk.com

as defined in Elastic Beanstalk, then do I access the web app at


 http://spark.elasticbeanstalk.com/SparkCrawler0.12/runsinglecrawljob

Or do I access the web app at


 http://spark.elasticbeanstalk.com/runsinglecrawljob ?


I don't know if this is related or not, but I have a very similar issue but with a PHP codeigniter application.


I uploaded the application, and 'index.php' is the normal starting point of the application. I also have a simple "phpinfo.php" that sits parallel to the index.php.


So, the URL is myApp.elasticbeanstalk.com which hits index.php and it is fine.


However, for my health check, I set it to /phpinfo.php because I want myApp.elasticbeanstalk.com/phpinfo.php to be used as the health check.


If I do this, the health check always fails, and so my application does not run and I see the glaring red box of doom.


This has been driving me crazy.


(Why do I want to do this? -- it's because I wanted to add an .htaccess file to the application root that requires a password for everything except the phpinfo.php file, and I tested this locally and it works. I did not add the .htaccess file yet -- I just wanted to see if I could point the health check to something besides "/" and have it work.


UPDATE -- I sorted out my issue. It turns out that when I launch one of these elastic beanstalk environments, I have to set up the healthcheck url right then and there to be /phpinfo.php and then upload my application. When I was fussing with this earlier, I would try to edit the configuration later to change the health check url and that never worked and the instance would never come alive again.


Related Posts:

0 commentaires:

Enregistrer un commentaire