08_폴라리스 설치

폴라리스(polaris) 설치 *폴라리스 : 유저해빗 솔루션 코드네임

1. 설치

  1. root folder 설정
    1. /hmsec/apps/polaris 로 설정
  2. console
    1. config.hmsec_stage.properties 에 설정된 static.file_path 에 압축을 풀어 준비
  3. server
    1. 압축을 푼 뒤 <polaris_root>/bin/polaris env=hmsec_stage 실행
    2. 실행하면 database 의 collection 들이 없는 경우 collection 들을 생성함
     sh -c "cd ~/apps/polaris; nohup bin/polaris env=hmsec_stage > ../volume/server-log/server-$(date -Iseconds).log &"
    

2. properties 변경

  • static 을 따로 묶어서 deploy
static.file_path=/mceadm/apps/polaris/resources/static
storage.path=/mceadm/apps/polaris/resources/static/attach

http.port=8000
...

3. deploy

  1. /mceadm/install folder에 파일 준비
stop_server.sh
  1. deploy-01.sh polaris-v1.2.xxxx.zip : “server deploy scripts” 부분 참고
    • deploy-01.sh 에서 기존의 folder를 새로운 folder와 swap 하기 때문에, html 은 deploy-01.sh 이 끝난 이후에 해야 한다.
  2. deploy-02-html.sh html-20220131.zip : “client deploy scripts” 부분 참고
  3. run_server.sh
cd install
deploy polaris-v1.2.xxx.zip
deploy_html.sh html-20220122.zip

4. server deploy scripts

/hmsec/install/ 에 있고, deploy 하려는 zip file 도 같이있다.

~/install$ deploy-01.sh polaris-v1.2.xxx.zip
# /hmsec/install/ 에 있고, deploy 하려는 zip file 도 같이있다.

if [ "$#" -ne 1 ]; then
    echo "Illegal number of parameters"
    echo "."
    echo "----------------"
    echo "Usage: <run.sh> <upload_file_path>"
    echo "----------------"
    echo "."
    exit 1
fi
filename=$1
fnameNoExt=${filename%.*}

cp $filename ~/apps/
cd ~/apps
unzip $filename

mv polaris polaris_pre
mv $fnameNoExt polaris

mkdir ~/apps/polaris/log

5. client deploy scripts

~/install$ deploy-02-html.sh html-20220122.zip
mkdir -p /mceadm/apps/polaris/resources/static
unzip $1 -d /mceadm/apps/polaris/resources/static
mv ~/apps/polaris_pre/resources/attach ~/apps/polaris_pre/resources/static
rm ~/apps/polaris_pre/ -R

6. start_polaris.sh & stop_polaris.sh

#
# start_polaris.sh 만들기
#
echo "sh -c \\"cd ~/apps/polaris; nohup bin/polaris env=hmsec.stage > ./log/server-\\$(date -Iseconds).log &\\"" > ~/start_polaris.sh
chmod +x ~/start_polaris.sh

#
# stop_polaris.sh 만들기
#
echo "ps axf|grep userhabit.Server | grep -v grep |  awk '{print \\"kill -TERM \\" \\$1}' | sh" > ~/stop_polaris.sh
chmod +x ~/stop_polaris.sh