1) ์คํ๋ง ๋ถํธ ์๋ฒ์ ๋ฐฐํฌํ๊ธฐ
(1) ๊ฐ์
- ๋ก์ปฌ ํ๊ฒฝ์์ ์ฌ์ฉํ๋ ์คํ๋ง ๋ถํธ ์๋ฒ๋ฅผ ์ค์ ์๋ฒ ํ๊ฒฝ์ ๋ฐฐํฌํด๋ณด์!
- ์ค๋ฌด ํ๊ฒฝ์์๋ ๋๋ถ๋ถ ์๋์ฐ ์๋ฒ๊ฐ ์๋๋ผ Linux ์๋ฒ๋ฅผ ์ฌ์ฉํ๊ณ ์์ผ๋ฏ๋ก RedHat ๊ณ์ด์ Linux์ ๋ฐฐํฌํ ์์ ์ด๋ค!
- ๊ทธ๋ฆฌ๊ณ 2021๋ ๋์ RedHat ๊ณ์ด์ CentOS๊ฐ EOL ๋๊ณ CentOS Stream์ผ๋ก ๋ฐ๋๊ฒ ๋๋ฉด์ RHEL์ Forkํ์ฌ ๋ง๋ Rocky Linux, Alma Linux, Oracle Linux ์ค์์ Oracle Linux๋ฅผ ์ฌ์ฉํ ๊ฒ์ด๋ค!
- ์ถ๊ฐ์ ์ผ๋ก ํผ๋ธ๋ฆญ ํด๋ผ์ฐ๋์์ Oracle Cloud๊ฐ ๊ฐ์ฅ ํ๋ฆฌํฐ์ด ํํ์ด ์ข๊ธฐ ๋๋ฌธ์ Oracle Cloud ํ๊ฒฝ์ ์ด์ฉํ๋ค!
(2) ๊ธฐ๋ณธ ํ๊ฒฝ
- Oracle Linux 8.6
- x86 System
(3) JDK ์ค์น ๋ฐ ํ์ธ
dnf install -y epel-release
dnf install -y jdk-11.0.12.x86_64
[root@SRV3 ~]# javac -version
javac 11.0.12
(4) jar ์ค๋น ๋ฐ ์คํ
- ์คํ๋ง ๋ถํธ ํ๋ก์ ํธ๋ฅผ Build ํ์ฌ ์์ฑ๋ jar ํ์ผ์ Linux ์๋ฒ๋ก ๋ฏธ๋ฆฌ ๋ณด๋ด๋๋ค!
- ์ ๋ชจ๋ฅด๊ฒ ๋ค๋ฉด ๊ตฌ๊ธ์ ํ์ผ์ง๋ผ์ SFTP ํค์๋๋ก ๊ฒ์ํ์ฌ ์์๋ณด๋๋ก ํ๋ค!
[root@SRV3 ~]# ls | grep java
java-0.0.1-SNAPSHOT.jar
[root@SRV3 ~]# java -jar java-0.0.1-SNAPSHOT.jar &
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.7.14)
2023-09-04 07:40:18.916 INFO 1625178 --- [ main] sesac.java.JavaApplication : Starting JavaApplication using Java 11.0.12 on SRV3 with PID 1625178 (/root/java-0.0.1-SNAPSHOT.jar started by root in /root)
2023-09-04 07:40:18.925 INFO 1625178 --- [ main] sesac.java.JavaApplication : No active profile set, falling back to 1 default profile: "default"
2023-09-04 07:40:20.471 INFO 1625178 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2023-09-04 07:40:20.484 INFO 1625178 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2023-09-04 07:40:20.485 INFO 1625178 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.78]
2023-09-04 07:40:20.603 INFO 1625178 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2023-09-04 07:40:20.603 INFO 1625178 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 1514 ms
2023-09-04 07:40:20.914 INFO 1625178 --- [ main] o.s.b.a.w.s.WelcomePageHandlerMapping : Adding welcome page: class path resource [static/index.html]
2023-09-04 07:40:21.203 INFO 1625178 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ''
2023-09-04 07:40:21.216 INFO 1625178 --- [ main] sesac.java.JavaApplication : Started JavaApplication in 3.109 seconds (JVM running for 3.949)
(5) ํ์ธ
# ํ๋ก์ธ์ค ํ์ธ
[root@SRV3 ~]# ps -ef | grep java
root 1625178 1613456 14 07:40 pts/0 00:00:06 java -jar java-0.0.1-SNAPSHOT.jar
# ํฌํธ ํ์ธ
[root@SRV3 ~]# netstat -ntlp | grep 8080
tcp6 0 0 :::8080 :::* LISTEN 1625178/java
- ๋!
- ์ถํ ํ๋ก์ ํธ ํ ๋์๋ 1๋์ ์๋ฒ๋ง์ด ์๋๋ผ ์ฌ๋ฌ ๋์ ์๋ฒ์ ์คํ๋ง ๋ถํธ๋ฅผ ๋์ฐ๊ณ ์ ๋จ์์ HAProxy๋ฅผ ํตํด ๋ก๋๋ฐธ๋ฐ์ฑ๊น์ง ํด๋ณผ ์์ ์ด๋ค.
- ๊ทธ๋ฆฌ๊ณ HAProxy๋ฅผ ์ด์ฉํ์ฌ ํธ๋ํฝ์ ๋ถ์ฐํ๋ ๊ฒ ์ธ์๋ SSL Offload์ผ๋ก SSL ์ค์ ๊น์ง ํด๋ณด์!
[์ฐธ๊ณ ] JDK ๋ฒ์ ๋ณ๊ฒฝ in Linux
- ๊ธฐ์กด์ ์ค์น๋ JDK ๋ฒ์ ์ด ๋ฎ์ ๊ฒฝ์ฐ, (3)๋ฒ ํญ๋ชฉ์์ ์ผ๋จ jdk11 ๋ฒ์ ์ ์ค์นํ ๋ค์ ์๋์ ๋ช ๋ น์ด๋ฅผ ํตํด ๋ฒ์ ์ ๋ณ๊ฒฝํด์ผ ํ๋ค.
update-alternatives --config javac
update-alternatives --config java
๋ฐ์ํ
'๐จโ๐ป Back End > Spring' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[Spring] DTO (Data Transfer Object) vs VO (Value Object) ์ฐจ์ด์ (0) | 2024.04.17 |
---|---|
[Spring] Spring Transaction์ ๋ํด ์์๋ณด์! (0) | 2024.04.17 |
[Spring] Spring AOP์ ๋ํด ์์๋ณด์! (0) | 2024.04.17 |
DockerFile๋ก ์คํ๋ง ๋ถํธ ์ด๋ฏธ์ง๋ฅผ ์์ฑํด๋ณด์! (0) | 2023.09.04 |