반응형
250x250
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- Airflow
- IntelliJ
- codepipeline
- chartjs
- kubeflow
- aws cicd
- codedeploy error
- JavaScript
- java bigdecimal
- Spring
- SQL
- Flux
- VPN
- Spring Error
- bootstrap
- chart.js
- PostgreSQL
- Kafka
- aws
- node
- docker
- AWS CI/CD 구축하기
- Jenkins
- 도커
- COALESCE
- Python
- codedeploy
- codebuild
- or some instances in your deployment group are experiencing problems.
- redis
Archives
- Today
- Total
Small Asteroid Blog
[AWS] EC2에 Redis 설치하고 외부 접속하기 본문
728x90
redis 설치 전 yum 업데이트와 gcc 를 설치한다.
sudo yum update -y
sudo yum install gcc make -y
파일 다운받기
sudo wget http://download.redis.io/redis-stable.tar.gz
압축풀기
sudo tar zxvf redis-stable.tar.gz
압축 풀고 해당 폴더를 확인하면 파일이 생성된것을 확인할 수 있다.
파일 이동 후 make 파일을 실행시킨다.
cd redis-stable/
sudo make
이 위치의 redis-server 파일을 설치 초기에 cp 명령어를 통해 다운받은 redis-server을 복사한 위치와 동일해야한다
redis-server파일과 redis-cli 파일을 /usr/local/bin 디렉토리로 복사한다.
sudo cp /home/ec2-user/redis/redis-stable/src/redis-server /home/ec2-user/redis/redis-stable/src/redis-cli /usr/local/bin/
config 파일을 /etc/redis로 복사한다.
sudo mkdir /etc/redis
sudo cp redis.conf /etc/redis
redis.conf 파일 수정하기
sudo vi /etc/redis/redis.conf
bind 0.0.0.0
daemonize yes
logfile /var/log/redis.log
dir /var/lib/redis
Redis를 백그라운드에서 실행하기 위해 no -> yes 로 변경한다.
백그라운드에서 실행하기 때문에 로그를 저장하기 위해 위치를 지정해준다.
working directory 위치를 설정한다.
redis-server 실행하기
명령어로 redis 실행 가능
백그라운드에서 실행하기
아래 명령어를 통해 saxenap분이 작성한 shell script 파일을 다운로드 한다.
sudo wget https://raw.githubusercontent.com/saxenap/install-redis-amazon-linux-centos/master/redis-server
다운받은 파일의 위치를 이동시키고 파일 권한을 변경해준다.
sudo mv redis-server /etc/init.d
sudo chmod 755 /etc/init.d/redis-server
해당 명령어를 사용해 스크립트 파일의 레디스 변수값을 확인한다.
sudo vi /etc/init.d/redis-server
redis-server Auto-Enable 설정한다.
sudo chkconfig --add redis-server
sudo chkconfig --level 345 redis-server on
redis 실행
sudo service redis-server start
EC2 외부 접속
보안그룹 인바운드 규칙에 6379 포트를 추가해준다.
728x90
반응형