I'm using docker swarm. I have two services.
Spring boot app
PostgreSQL database
every things is ok. suppose :
all of my tasks be kill for any reason (for example restart the server) swarm try to run my services.
my problem is there if first run spring boot then run database. in this status my spring boot can not connect to database. and my app not working.
I know that I can resolve this problem in spring with connection pool but I want handle it in docker swarm.
can you help me?
is there any way ????
Related
When starting/relaunching a Spring Boot App and the app runs on a port which was already in use before I got an error:
Web server failed to start. Port 8092 was already in use.
So, everytime I am starting a Spring Boot App I have to switch server.port in application.properties.
Note: Because I do not have the Run as "Spring Boot App" I use the work around mentioned here to start it:
First Answer, How to run Spring Boot web application in Eclipse itself?
Is there a solution to avoid switching ports every time?
Thanks a lot!
I have an application which is running on multiple AWS hosts behind a load balancer. All of these instances load the configuration from a spring config server. I can use spring boot admin server to identify the the URL's so that I can execute the POST at hostname:port/actuator/refresh command for individual host using POSTMAN. As the number of hosts increase, it becomes difficult to run a command for each one of the hosts. Is there a way I can do the same with a single command?
We use something similar for our application
i.e Spring applications fetching properties from config server and a spring boot admin server to which all these application registers.
We have exposed an post api in bootadmin which calls refresh endpoint on all instances of specified app.
Since bootadmin has all information about registered apps, we are using it to 'publish' message to all 'subscribed' apps.
We are working on spring boot application (backend) and angular6 (frontend)
To deploy our application, we used compute engine of google cloud platform.
We install Java 8, spring boot cli, and postgreSQL, our database.
When we run the application locally to the Virtual machine, everything is ok.
To deploy the application, we follow these steps for configuration:
But at least, we cannot get the application running,
here the screenshot:
Your help is more than welcome!
I use spring boot and undertow in eureka server. After I kill the process, it tells me the port is in use when I restart the applicaiton.
I searched and finded that the server application won't release the port immediately after stopping . It will wait about 50s.
Someone suggested to add REUSE option:
setsockopt(listenfd,SOL_SOCKET,SO_REUSEADDR,&opt,sizeof(&opt));
I am wondering if there is a way to to this in spring boot embedded containers.
Thanks.
I'm new to Spring and built a simple Springboot app that has a couple of endpoints and stores data in a mysql database. It is now time for me to deploy it to AWS. I setup a beanstalk instance, uploaded my war file, and also setup a rds db instance with mysql. When I try to visit one of my endpoints using my environment url/(the endpoint), I'm getting a 404 error. I know the endpoints work because when I ran the project locally, I tested them.
I suspect the issue is the Spring datasource url I have configured in my project. When I was running locally, I had the url set to the following: jdbc:mysql://127.0.0.1/exampleDb
I tried changing the url to the following: jdbc:mysql://(my aws environment url):3306/ebdb but I still get the same error.
What should I change the datasource url to? Any ideas? I'm new to Spring and AWS, so this has really been a roadblock.
Any help is appreciated.