Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents

...

Global setup

...

Yum Repo 업데이트

Update before set up to maintain the newest version

sudo yum update -y

Java 11

...

Code Block
# Java 11 install
sudo yum install java-11-openjdk java-11-openjdk-devel -y
sudo amazon-linux-extras install java-openjdk11 // AWS JDK 11 Install


# test install java 11
java -version

# If required, java version change when set up multiple version
sudo update-alternatives --config java

참고: 폐쇠망일때, JDK binary install https://ionsdp.atlassian.net/wiki/spaces/ICE4P/pages/763691009/Java+11

Nodejs

To use postman, should install newman

Code Block
# Install node version manager (nvm) by typing the following at the command line.
cd ~
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.36.0/install.sh | bash

# Activate nvm by typing the following at the command line.
. ~/.nvm/nvm.sh

# install Node latest
nvm install node

# install specific version
nvm install v14.16.1

# use specific version
nvm use v14.16.1

#test install node
node -e "console.log('Running Node.js ' + process.version)"

# reference
https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/setting-up-node-on-ec2-instance.html
https://github.com/nvm-sh/nvm/blob/master/README.md
# global package install
npm install -g yarn cross-env pm2 newman

# Change account as a ec2-user
exit

...

(JDK 11) 설치

Java11 설치

Nodejs v14.16.1 설치

Node.js 설치

Linux 유틸 설치

Git, wget, telnet, bind-utils(nslookup, host, etc..)

...

Check status

sestatus

...

Edit config

Selinux config 편집기 실행

vi /etc/selinux/config

and reboot

Image Removed

Result like below:

Selinux 설정값 변경

SELINUX=disabled

...

리눅스 재시작

sudo reboot

결과 확인

sestatus

...

...

ulimit 설정: Too many open files에러

...

  • max user processes 한 유저가 최대로 처리할 수 있는 processes 양

    • Java에서 동시에 생성 가능한 쓰레드 수 제어

  • open files 한 프로세스에서 열 수 있는 open file descriptor의 최대 숫자(열수 있는 최대 파일 수)

    • Java에서 소켓 통신(HTTP API, JDBC 커넥션 등)

    • 단, 자동으로 JDK 내부 코드상에서 hard limit 값이 soft limit에 update(자바 옵션이 -DMaxFDLimit:ture 디폴트로 설정되어있음)

    • Open file 갯수가 적으면 Out of memory 혹은 Too many open files 에러 발생

설정값

...

조회

soft: ulimit -a

hard: ulimit -aH

...

ulimit open file 갯수 설정

ulimit config 편집기 실행

vi /etc/security/limits.conf 

soft & hard openfile limit 설정

  • * soft nofile 65535

  • * hard nofile 66535

...

설정값 확인

soft: ulimit -a

hard: ulimit -aH

...

...

Local Timezone 설정

To set the local time zone should not recommend If global service.

글로벌 서비스를 할 경우 특정 지역으로 시간대를 설정하는 것을 권장하지 않습니다.

Method 1

Code Block
sudo timedatectl set-timezone Asia/Seoul

...

타임존 파일 에러 해결: No such file or directory

warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory

...