Configuring an IP address in Spring Boot admin client - spring-boot-admin

I am using Spring Boot admin version 2.6.9 and using
spring.boot.admin.client.instance.prefer-ip=true
to register to admin server via an IP address. Now since I am running my apps inside Docker containers, the admin server receives Docker IP addresses and not the public IP addresses
of the applications.
I have tried changing management.address, but that does not work.
I can not use the Docker network to connect to these machines and I can not change the server.address property. I have tried the below properties as well, but they don’t show anything on the admin server apart from online status.
spring.boot.admin.client.instance.service-url=http://11.0.134.202:9999
spring.boot.admin.client.instance.management-url=http://11.212.134.202:9999

I got it working using
spring.boot.admin.client.instance.prefer-ip=true
spring.boot.admin.client.instance.service-url=http://127.0.0.1:9999
spring.boot.admin.client.instance.management-url=http://127.0.0.1:9999/actuator

Related

Timeout expired: Connecting Azure Postgres using local pdAmin

I am using psql on Azure. While I am successfully able to connect it on CLI and using Python psycopg2 or other modules and library, I am facing issue connecting it to the pgadmin Web UI.
The process to connect to the Azure POSTGRES in pgadmin is as follows:
Click on Add New Server.
Provide Name under General tab.
Provide Host, Port, DB Name, Username, Password.
After clicking on Save, it always pops connection timeout error.
While with the above config I can connect to it in the python, create cursor and commit a query. Do we require additional settings to be done for connecting it to the pgadmin. I am new to cloud and not sure if there is some additional security checks like token access to be provided or something.
Please have a check that have you enabled your local public IP address in Postgres DB Firewall rules?
After I created the new DB and added my local public IP to Firewall rules, I can connect to DB by local pgAdmin successfully:
Configs:
Allow your IP address in Azure postgresDB Networking section. You can configure your VNET or firewall rules as needed.
Check if your organization allows your IP to be visible to Azure. In my case, I was able to connect only when I was not connected to organization VPN.
"Some network environments may not report the actual public-facing IP address needed to access your server. Contact your network administrator if adding your IP address does not allow access to your server."
Under settings. Click on Networking. you will find a link like '+ Add current client IP address ( 119.160.103.152 ) + Add 0.0.0.0 - 255.255.255.255' click on it and use 0.0.0.0 to allow all public ip addresses. Now try to connect.
enter image description here
Above answer is correct but look at he above link now option for public ip is under Network option.
Connected success fully after doing this.

How to access my desktop MongoDB from EC2 Linux?

I have MongoDB installed on my desktop, using which I have developed a web application. I want to now deploy this webapp on an EC2 linux instance and test it. I don't want to setup another mongoDB on the EC2 separately, rather use the one on my desktop. I understand that it is not that simple to put my ip and mongo port and just connect.
I have added port-forwarding settings on my router like this -
Also I have opened my firewall for this port by adding an inbound rule.
Yet I'm not able to connect. What am I missing here?
Thanks in advance

Unable to access web app deployed on remote JBoss

We have purchased a Virtual Private Server(VPS) and installed JBoss EAP 7.0.0 on it. We have deployed our application on this VPS JBoss. I am able to access our application on the VPS using "https://localhost:port-number/Our-Application".
However, when I try to access the app from my laptop using the VPS IP address I get "This site can’t be reached "VPS IP address" took too long to respond ERR_CONNECTION_TIMED_OUT". I get the same problem if I try to access http://VPS-IP-Address:8080.
Address wild card for the public interface is set to "Any Address". I tried setting public interface Inet Address to ${jboss.bind.address.management:VPS IP address}/${jboss.bind.address.management:0.0.0.0} it didn't work. I tried starting the JBoss using standalone.bat -b 0.0.0.0 and standalone.bat -b "VPS IP address" it didn't work.
Setting public interface Inet Address to ${jboss.bind.address.public:VPS IP address}/${jboss.bind.address.public:0.0.0.0} also didn't work
I am however able to access JBoss console from my laptop using the VPS IP address(http://VPS-IP-Address:9990/console/App.html#home).
Kindly help.
Regards
Ziauddin Syed
The ports 8080 and 8443 were not open on the VPS. Opened them I was able to access my application

How to access mongodb on GCE with GAE

I´ve deploy my demo app on GAE and works fine with mLab , but when I try to deploy mongodb on GCE (MongoDB (Google Click to Deploy) )the deploy is success but I don´t know how to get te URI to set on my app running on GAE.
I try with internal and external IP but it seems dont work !
Thanks
GAE Standard deployments are sand-boxed. Therefore you can not connect to GCE instances' internal IPs. You can imagine it as two different devices on two different private networks that are not capable to communicate with one another using their internal IPs. However, they can always communicate if one of the devices (GCE instance in this case) has a public IP, and it's private network (firewall) allowed traffic through the port required by the device.
On the other hand, if the GAE deployment is in flex environment, you should be able to connect to the db using the API through internal IPs.
I have tried and succeeded with this flex environment example for both internal and external IP addresses. Like you, I used Cloud Launcher to deploy Mongodb which created GCE instances with public IPs and network tags mongodb and mongodb-db. Then I created a db, username and a password by connecting to the primary db instance through SSH.
To use the internal IP, I just created/modified keys.json file per the example, as follows:
{
"mongoHost": "internal IP address",
"mongoPort": "27017",
"mongoDatabase": "db",
"mongoUser": "username",
"mongoPass": "password"
}
So I didn't have to worry about the URI as the code in server.js took care of it through passing this string:
mongodb://${user}:${pass}#${host}:${port}
But for your demo app, you may have to check the MongoDB official documentation for the standard connection string format URI.
As for using public IPs, I had to create a network firewall rule that allows tcp ingress on port 27017 with target tags identical to the network tags in order to limit access through the port to the MongoDB instances only. Next, I modified the keys.json file as above by replacing the internal IP with the public one.

Can I force Eureka registrations to use an ip address instead of a hostname?

I have a standalone, embedded Eureka server powered by Spring Boot 1.2.0.RELEASE and Spring Cloud 1.0.0.RC1. I see services properly registering themselves in the dashboard, which is great. The status links are using the host name of the box they are running on. Unfortunately, we are using virtual machines and they don't register themselves in DNS, which means that the links are unresolvable. I started looking through the code but was unable to find a way to force the links to use the host's ip address instead. Having a broken dashboard is not the end of the world but I am afraid that once we start using Ribbon or Feign to contact services, those URLs will also use the host name and be unresolvable. Maybe what I am really asking is there a way to force the clients to register with an ip address instead of a host name? Any help is appreciated.
set eureka.instance.preferIpAddress=true as documented here