정확한 내용을 확인하려면 공식사이트를 확인해야 한다. 이곳에 모든 명령어들이 있다.명령어는 각 상황에 맞는 특별한 약어들로 짧게 구성되어져 있으니 잘 생각해 보면 쉽게 기억할 수 있다. 또한 각 명령어는 사용가능한 버전과 시간복잡도가 같이 명시되어 있으니 해당 명령을 시스템에 적용하기전 체크할 수 있으니 꼭 체크하자. key 관련 DEL key [key …]열거한 키들을 지운다. 없는 키는 무시한다. DUMP keyRedis만의 특별한 포맷으로 저장하는 값을 돌려준다.이 값에는 64-bit checksum 값이 포함되어 있어 오류를 검출 할 수 있다.RESTORE명령으로 복구 할 수 있다. EXISTS key해당키의 존재 유무를 알려준다. 키가 존재하면 1을 돌려준다. EXPIRE key seconds키..
https://github.com/okihouse/spring-boot-redis-auto-complete위 링크의 자료를 이용 AutocompleteConfig @Configurationpublic class AutocompleteConfig { @Autowiredprivate StringRedisTemplate stringRedisTemplate; @Bean(name = {"autocompleteKeyRepository", "keyRepository"})public AutocompleteKeyRepository keyRepository() {// auto-complete custom key implements for testAutocompleteKeyRepository keyRepository = n..
Jedisjava에서 Redis를 사용할수있도록 도와주는 라이브러리 설치 redis.clients jedis 2.9.0위 내용을 복사하여 pom.xml에 붙어넣는다 최신버전을 다운받아 사용하여도 된다 Redis-server Settings~/redis-stable/redis.conf" 파일을 열어서 바꿀 부분 3가지 1. bind 192.168.0.56- 127.0.0.1 로 되어있을텐데 원격에서 접속해서 쓸 거라 변경했다. 테스트니까 주석처리하면 모든 ip에서 접근가능 보안상 취약하니 실제 운영을 한다면 권장 x 2. protected-mode no- protected-mode yes 로 되어있을텐데 이것을 no로 바꿔준다. 3. requirepass password - #requirepass foob..
pom.xml 설정 org.springframework.data spring-data-redis 1.5.0.RELEASE redis.clients jedis 2.8.0 org.apache.commons commons-pool2 2.4.2 위 내용을 pom.xml에 추가 Config 설정@Configurationpublic class RedisConfig { @Bean public JedisConnectionFactory jedisConnectionFactory() { JedisConnectionFactory jedisConnectionFactory = new JedisConnectionFactory(); jedisConnectionFactory.setHostName("ip주소"); jedisConnect..
redis server 시작redis 서버를 띄우려면, /usr/local/bin/ 폴더 안에 redis-server 실행 파일을 옵션 없이 바로 띄울 수 있다. 만약 예를 들어 /etc/ 폴더 안에 있는 config 파일을 이용해서 서버를 띄우려고 한다면 아래와 같이 입력한다.$ redis-server /etc/redis.conf 데몬으로 띄우고 싶다면 아래와 같이 입력한다.$ redis-server --daemonize yes 데몬으로 띄운 후에 아래와 같이 입력해보면 정상 작동하는지 확인 할 수 있다.$ redis-cli pingPONG redis의 정보를 입력하고 싶다면 아래와 같이 입력한다.$ redis-cli info redis-cli이 아니라 터미널에서 확인하고 싶다면 다음과 같이 입력한다...
redis 설치source를 이용하여 설치 wget http://download.redis.io/redis-stable.tar.gztar xvzf redis-stable.tar.gzcd redis-stablemakemake install 위와 같이 입력한 다음 제대로 작동하는지 확인하고 싶다면 make test를 입력하여 확인한다. 후에 src 폴더에 들어가보면 아래와 같은 실행파일을 확인해볼 수 있다. redis-serverredis-seninelredis-cliredis-benchmarkredis-check-aof, redis-check-dump 위의 파일들은 아래의 커맨드를 이용해서 경로를 바꾼다. sudo cp src/redis-server /usr/local/bin/sudo cp src/redi..