Notice
Recent Posts
Link
정화 코딩
[Back-end] Window 환경 로컬에 WSL(Ubuntu)로 Redis 설치하기 본문
WSL(Windows Subsystem for Linux) 설치 및 실행
WSL: Windows에서 리눅스를 실행할 수 있게 해주는 기능
wsl --install
Ubuntu에서 Redis 설치 및 실행
sudo apt update
sudo apt install redis-server -y
sudo service redis-server start
Redis 시작 후 정상 작동하는지 확인
redis-cli
SET hello "hello world"
GET hello
Spring Boot에서 Redis 연결 설정
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-redis'
}
build.gradle 파일에 위와 같이 Redis 관련 의존성을 추가한다. 그리고 다시 빌드한다.
spring:
data:
redis:
host: localhost
port: 6379
application.yml에 위와 같은 설정을 추가한다. (Redis는 WSL 안에서 실행 중이지만, 같은 PC이기 때문에 localhost 로 접근 가능)
'Web Development' 카테고리의 다른 글
[Back-end] 졸업 프로젝트 PreView: free-tier AWS EC2 인스턴스 생성 후 서버 실행 (0) | 2025.04.04 |
---|---|
[Back-end] 졸업 프로젝트 PreView: free-tier AWS RDS (MySQL) 인스턴스 생성 (0) | 2025.04.03 |
[SpringBoot] 졸업 프로젝트 PreView: 프로젝트 초기 세팅 2 (0) | 2025.03.26 |
[SpringBoot] jakarta.validation 관련 Cannot resolve symbol 'validation' 오류 발생 원인과 해결 방법 (1) | 2025.03.26 |
[SpringBoot] 졸업 프로젝트 PreView: DB ERD 설계 (0) | 2025.03.19 |
Comments