Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Next »


Global setup

Update Linux Yum as the latest version

Update before set up to maintain the newest version

sudo yum update -y

Java 11

# 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

# 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

Install Common Linux tools

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

sudo yum install git wget bind-utils telnet -y


Disable SELINUX

Check status

sestatus

Edit config

vi /etc/selinux/config

and reboot

Result like below:


ulimit 설정: Too many open files에러

ulimit란

ulimit는 프로세스의 자원 한도를 설정하는 명령으로, 통상적으로 soft hard로 구분

ICE4는 open files 갯수를 메모리 사이즈 만큼 추가, 유처 처리량 unlimited로 변경

  • 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 갯수 설정

vi /etc/security/limits.conf 

설정값 확인


Local Timezone 설정

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

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

Method 1

sudo timedatectl set-timezone Asia/Seoul

Method 2

# Remove your original localtime file
sudo rm /etc/localtime

#Create a softlink to /etc/localtime
sudo ln -sf /usr/share/zoneinfo/Asia/Seoul /etc/localtime

Timezone information: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones

Check Date

type: date

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

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

The fix is pretty straight-forward. On the server (not your client), edit the file /etc/environment and add the following lines.

sudo vi /etc/environment

LANG=en_US.utf-8
LC_ALL=en_US.utf-8

  • No labels