Spring Boot Admin Server, Client config 설정하기

이미지
 Spring Boot로 많은 프로젝트를 진행하게 됩니다. 많은 모니터링 도구가 있지만, Spring Boot 어플리케이션을 쉽게 모니터링 할 수 있는 방법을 소개하려고 합니다.   코드 중심으로 살펴보겠습니다. 1. 어드민 서버 구축 1-1. 디펜던시 추가 dependencies { // https://mvnrepository.com/artifact/de.codecentric/spring-boot-admin-starter-server implementation 'de.codecentric:spring-boot-admin-starter-server:2.5.4' } 1-2. 어드민 서버 설정 활성화 @SpringBootApplication @EnableAdminServer public class ServerApplication { public static void main (String[] args) { SpringApplication. run (ServerApplication. class, args) ; } } EnableAdminServer를 하면 됩니다. 2. 클라이언트 서버 설정  예제는 book-client, member-client 2가지 클라이언트, member-client가 2개의 인스턴스 실행으로 작성했습니다.  2-1 디펜던시 추가 dependencies { // https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-web implementation 'org.springframework.boot:spring-boot-starter-web:2.5.4' // https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-actuator implementation 'org.spring...

git push 취소

git push를 실수로 했을 경우 취소 하고 싶을 때가 많습니다. push를 보기 전에 commit 취소부터 보겠습니다.


commit 취소 예제

로컬에 commit 된 상황


실수로 commit을 한 상태입니다. 취소 명령어는 다음과 같습니다.
$ git reset HEAD^
$ git reset HEAD~1

1번은 최종커밋 취소, 2번은 N개만큼 취소 입니다.

git rest 명령어

commit 취소된 상황

push 취소 예제

푸시까지 된 상황을 보겠습니다.

git push 된 상황

1. 로컬에 커밋을 취소해야 합니다.

1단계로 git reset 진행
리셋 명령어는 앞의 내용 참고 부탁드립니다.

git reset 후 결과
2. 현재 로컬의 상태를 remote 저장소에 강제 푸시 해야합니다.
$ git push origin -f
$ git push --force
위의 명령어를 응용해서 사용하시면 됩니다. 
push 취소 명령어

push 취소 결과

origin은 remote 저장소 입니다. remote 확인하는 방법은 아래 부분을 참고해주세요.
-f 옵션은 --force의 약자 입니다.


remote 확인

git에 다양한 remote 저장소를 연결하여 사용할 수 있습니다. 기본은 origin 으로 사용을 합니다.
$ git remote
git remote 확인
자세히 보고 싶으면 -v 옵션을 사용하면됩니다.


정리

$ git reset HEAD^ # commit 취소
$ git push origin -f # 현재 상태 강제 푸시







댓글

이 블로그의 인기 게시물

Spring boot redis cache config

Spring boot redis RedisTemplate

MySQL PK 중복 (duplicate key ) 해결 방법