This is thanks to the blog of a great God on the website:
http://blog.csdn.net/forezp/article/details/70148833
Highly Recommended study:
1, Springcloud is what, this everyone Baidu bar, I will also say do not understand, but more powerful than Dubbo, contains the Dubbo content, also contains more than Dubbo content.
2. What is Eurake? About this I think if you know zookeeper understand the advantages of eurake.
Springcloud integrates the Eurake, so the governance registration of the service is more convenient and concise, and does not need to install, so it is better than zookeeper.
3. Integration of Springboot and Springcloud:
Springcloud is based on the development of springboot, so we must be springboot;
How to integrate I just said that I made a wrong step, other people learn from the great God can be;
The first step: wrong, hey, because of INTELLJ idea is not familiar with, so the first step is wrong.
Create an empty MAVEN project: project in idea is equivalent to a workspace,modle equivalent to a project project.
So let's start by creating a Father Maven Project: Note that the modle in the back is in the workspace of the parent project.
Such an empty MAVEN project is created so that SRC can be deleted. anyone. I deleted it by looking at the trouble.
Step Two: Create the server side:
The configuration of the server side is added:
@EnableEurekaServer @springbootapplicationpublic class Eurekaserverapplication {public static void Main (string[] args) { springapplication.run (eurekaserverapplication.class, args);} }
As for why use APPLICATION.YML, everyone own Baidu Bar, I think is for convenience. Written in a more hierarchical sense.
Such a server side is complete:
Start:
The following is the creation of the client, I would like to register the service to the server side, this people imitate the creation of the server can be, but the configuration is not the same.
Note: Also created under the MAVEN parent project:
Qid
After startup, this will register the service in Eurake, and we'll look at:
Later, we call the service to find this:
So this has achieved the role of zookeeper, use it.
MicroServices Learning Three: the use of springboot and Springcloud integration Eurake (server side, client side)