1.Nacos
2.1Nacos Server启动
#进入bin文件夹
bash -f ./startup.sh
#关闭
./shutdown.sh
访问链接:http://127.0.0.1:8848/nacos/index.html
1.2Nacos client配置
settings->Build,Execution,Deployment->Build Tools->Maven->Ignored Files
OrderApplication.java
package order;
import javafx.beans.property.adapter.JavaBeanBooleanPropertyBuilder;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;
@SpringBootApplication
//@EnableDiscoveryClient
public class OrderApplication {
public static void main(String[] args){
SpringApplication.run(OrderApplication.class,args);
}
@Bean
@LoadBalanced
public RestTemplate restTemplate(){
return new RestTemplate();
}
}
OrderController.java
package order.controllor;
import

最低0.47元/天 解锁文章
5173

被折叠的 条评论
为什么被折叠?



