개발/서버
-
[Redis] 스프링부트 레디스 연동 (간단한 예제)개발/서버 2023. 7. 10. 00:09
의존성 추가 dependencies { implementation 'redis.clients:jedis:4.3.1' //... } 데이터 저장 및 조회 import org.junit.jupiter.api.Test; import redis.clients.jedis.JedisPool; import redis.clients.jedis.JedisPooled; public class TestMain { @Test public void test(){ JedisPooled jedisPooled = new JedisPooled("localhost", 6379); jedisPooled.set("foo", "bar"); System.out.println(jedisPooled.get("foo")); } } 공식문서
-
[Redis] 우분투에서 레디스 설치하기개발/서버 2023. 7. 9. 23:38
설치 $ sudo apt install lsb-release curl gpg $ curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg $ echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.list $ sudo apt-get update $ sudo apt-get install redis레디스 서버 실행 $ sudo serv..