How in Spring cloud can the request be directed to the specified microservice based on the visitor's ip?

in the process of development, because of the relationship between the calls of various micro-services, several micro-services need to be enabled locally, resulting in a computer memory utilization rate of more than 80%. Is there any way to share several micro-services (for example, service registration discovery Eureka, gateway apigateway, basic module base, etc.), deploy the shared services to 192.168.1.11 server, others (192.168.1.22, 192.168.1.33) when developing locally, only one OA module needs to be started to join the shared server, and then the two people visit the eureka server on 192.168.1.11. The gateway looks up the eureka according to the visitor"s ip,. If there is a micro-service corresponding to the visitor"s ip, it directs the request to the service, otherwise it points to the shared service?

11 servers deploy Eureka and apigateway
22 and 33 developers develop OA modules locally, registering him with 11 servers
when 22 and 33 developers visit the gateway of 11, they can forward their requests for access to the OA module to services on their own computers. To achieve the sharing of basic services, developers do not need to start eureka and apigateway, locally to reduce memory utilization and burden on developers" computers

after consulting some materials, I think this should be regarded as a load balancing problem. I use Ribbon to achieve request distribution, and then see how to distribute it to a specified microservice through ip.

Jan.26,2022

as long as services are registered with the same registry, feignclient calls can be used between services. I don't know what you mean.


one is called through zuul, the other is called through feign.
the former is to directly expose the controller, which is generally used to modify the instance name

when developing


as a service call (similar to dubbo).

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e497cf-44d33.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e497cf-44d33.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?