2018.04.13 10:56

Spring Boot 앱 systemctl 등록

Centos 7 기준 (7 미만에서는 다른 방법으로 등록)

/etc/systemd/system 으로 이동 [앱이름].service 파일 생성 (예. bboks.service)


service 파일 내용

[Unit]

Description=서비스 명


[Service]

User=centos

WorkingDirectory=/home/centos/앱 디렉터리

ExecStart=/usr/bin/java -Djsse.enableSNIExtension=false -Dspring.profiles.active=production -jar /home/centos/앱 디렉터리/앱.jar

SuccessExitStatus=143

TimeoutStopSec=10

Restart=on-failure

RestartSec=5


[Install]

WantedBy=multi-user.target


-Dspring.profiles.active 는 spring profile active를 사용할 경우

-Djsse.enableSNIExtension 는 hand shake 오류가 발생할 경우

Trackback 0 Comment 0
2017.06.07 14:54

톰캣 버전 확인

1. 톰캣 설치 경로/lib 로 이동

예) /java/tomcat7/lib


2. 다음 명령어 입력

java -cp catalina.jar org.apache.catalina.util.ServerInfo



Trackback 0 Comment 0
2017.03.16 13:15

Spring security isAuthenticated VS isFullyAuthenticated

isAuthenticated()

 Returns true if the user is not anonymous

isFullyAuthenticated()

 Returns true if the user is not an anonymous or a remember-me use



[출처] Difference between isAuthenticated and isFullyAuthenticated

Trackback 0 Comment 0
2017.02.22 17:15

postgres 스키마 크기 출력

query
SELECT schema_name,
    pg_size_pretty(sum(table_size)::bigint) as "disk space",
    (sum(table_size) / pg_database_size(current_database())) * 100
        as "percent"
FROM (
     SELECT pg_catalog.pg_namespace.nspname as schema_name,
         pg_relation_size(pg_catalog.pg_class.oid) as table_size
     FROM   pg_catalog.pg_class
         JOIN pg_catalog.pg_namespace 
             ON relnamespace = pg_catalog.pg_namespace.oid
) t
GROUP BY schema_name
ORDER BY schema_name;

출력 결과



Trackback 0 Comment 0
2016.12.21 15:23

IntelliJ Process finished with exit code 0 when spring-boot run

Deleting provided scope of spring-boot-starter-tomcat dependency helps me.

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-tomcat</artifactId>
</dependency>


[출처] IntelliJ Process finished with exit code 0 when spring-boot run

Trackback 0 Comment 0