Spring Cloud를 활용한 MSA 설치 및 구성-1
spring cloud
https://spring.io/projects/spring-cloud
spring cloud vs kubernetes
-> jdk-11.0.15.1_windows-x64_bin.exe
-> spring-tool-suite-4-4.15.1.RELEASE-e4.24.0-win32.win32.x86_64.self-extracting.jar
-> apache-maven-3.8.6-bin.zip
jdk 11 설치
maven 압축해제
JAVA_HOME C:\Program Files\Java\jdk-11.0.15.1
Path %JAVA_HOME%\bin
MAVEN_HOME C:\apache-maven-3.8.6
Path %MAVEN_HOME%\bin
명령창 테스트
java -version
javac -version
mvn
캐시경로
C:\Users\HPE\.m2\repository
https://projectlombok.org/download
java -jar lombok.jar을 STS에 설치
http://localhost:8080/v1/organization/optimaGrowth/license/2313202
eureka server
spring.application.name=MyServer
eureka.client.register-with-eureka=false
eureka.client.fetch-registry=false
server.port=8761
spring.application.name=MyClient1
server.port=8081
eureka.instance.prefer-ip-address=true
eureka.client.service-url.defaultZone=http://localhost:8761/eureka
eureka.client.fetch-registry=true
eureka.client.register-with-eureka=true
package com.test.myclient1;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@SpringBootApplication
@EnableEurekaClient
@RestController
public class MyClient1Application {
public static void main(String[] args) {
SpringApplication.run(MyClient1Application.class, args);
}
@RequestMapping(value="/")
public String hello() {
return "Eureka Client Application";
}
}
spring.application.name=MyClient2
server.port=8082
eureka.instance.prefer-ip-address=true
eureka.client.service-url.defaultZone=http://localhost:8761/eureka
eureka.client.fetch-registry=true
eureka.client.register-with-eureka=true
spring.application.name=MyClient3
server.port=8083
eureka.instance.prefer-ip-address=true
eureka.client.service-url.defaultZone=http://localhost:8761/eureka
eureka.client.fetch-registry=true
eureka.client.register-with-eureka=true
package com.test.myclient3;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.test.myclient3.MyClient3Application;
@SpringBootApplication
@EnableEurekaClient
@RestController
public class MyClient3Application {
public static void main(String[] args) {
SpringApplication.run(MyClient3Application.class, args);
}
@RequestMapping(value="/")
public String hello() {
return "Eureka Client Application #3";
}
}
'푸닥거리' 카테고리의 다른 글
.NET TLS versioncompilation targetFramework httpRuntime targetFramework (0) | 2022.08.02 |
---|---|
Spring Cloud를 활용한 MSA 설치 및 구성-2 (0) | 2022.07.24 |
교육훈련기관 과정운영 점검을 위한 모니터링 (0) | 2022.07.21 |
OOP(Object-Oriented Programming) 의 SOLID 원칙 (0) | 2022.07.10 |
아키텍처 패턴(Architecture Patterns), 디자인 패턴(Design Pattern) (0) | 2022.07.09 |
댓글