inflearn logo
강의

Course

Instructor

Spring Boot Concepts and Utilization

Spring Data Part 9: Redis

어플리케이션 실행시 에러

18927

sonth2000

18 asked

0

현재 docker toolbox를 이용중입니다..

docker toolbox는 가상머신에 서버를 뛰우기에

디폴트 ip인 192.168.99.100 으로 이전 강의(jpa, postgre 등)에서 application.properites에 설정하여

정상적으로 작동하였습니다. redis사용할 때도 설정이 필요한지 질문드립니다. 

우선 아무설정없이 실행하면 아래에러가 뜨는데 이 설정이 없어서 나는 문제인지 알고싶습니다.

강의를 듣다가 막혀서 진도가 안나가 질문드립니다.

아래 에러메시지를 나열하였습니다.  감사합니다.

 

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.

2019-07-31 23:30:22.611 ERROR 15076 --- [           main] o.s.boot.SpringApplication               : Application run failed

 

java.lang.IllegalStateException: Failed to execute ApplicationRunner

at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:773) [spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]

at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:760) [spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]

at org.springframework.boot.SpringApplication.run(SpringApplication.java:318) [spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]

at org.springframework.boot.SpringApplication.run(SpringApplication.java:1213) [spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]

at org.springframework.boot.SpringApplication.run(SpringApplication.java:1202) [spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]

at me.izac.springbootredis.SpringbootredisApplication.main(SpringbootredisApplication.java:10) [classes/:na]

Caused by: org.springframework.data.redis.RedisConnectionFailureException: Unable to connect to Redis; nested exception is io.lettuce.core.RedisConnectionException: Unable to connect to localhost:6379

at org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory$SharedConnection.getNativeConnection(LettuceConnectionFactory.java:1106) ~[spring-data-redis-2.1.9.RELEASE.jar:2.1.9.RELEASE]

at org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory$SharedConnection.getConnection(LettuceConnectionFactory.java:1085) ~[spring-data-redis-2.1.9.RELEASE.jar:2.1.9.RELEASE]

at org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory.getSharedConnection(LettuceConnectionFactory.java:866) ~[spring-data-redis-2.1.9.RELEASE.jar:2.1.9.RELEASE]

at org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory.getConnection(LettuceConnectionFactory.java:341) ~[spring-data-redis-2.1.9.RELEASE.jar:2.1.9.RELEASE]

at org.springframework.data.redis.core.RedisConnectionUtils.doGetConnection(RedisConnectionUtils.java:132) ~[spring-data-redis-2.1.9.RELEASE.jar:2.1.9.RELEASE]

at org.springframework.data.redis.core.RedisConnectionUtils.getConnection(RedisConnectionUtils.java:95) ~[spring-data-redis-2.1.9.RELEASE.jar:2.1.9.RELEASE]

at org.springframework.data.redis.core.RedisConnectionUtils.getConnection(RedisConnectionUtils.java:82) ~[spring-data-redis-2.1.9.RELEASE.jar:2.1.9.RELEASE]

at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:211) ~[spring-data-redis-2.1.9.RELEASE.jar:2.1.9.RELEASE]

at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:184) ~[spring-data-redis-2.1.9.RELEASE.jar:2.1.9.RELEASE]

at org.springframework.data.redis.core.AbstractOperations.execute(AbstractOperations.java:95) ~[spring-data-redis-2.1.9.RELEASE.jar:2.1.9.RELEASE]

at org.springframework.data.redis.core.DefaultValueOperations.set(DefaultValueOperations.java:236) ~[spring-data-redis-2.1.9.RELEASE.jar:2.1.9.RELEASE]

at me.izac.springbootredis.RedisRunner.run(RedisRunner.java:19) ~[classes/:na]

at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:770) [spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]

... 5 common frames omitted

Caused by: io.lettuce.core.RedisConnectionException: Unable to connect to localhost:6379

at io.lettuce.core.RedisConnectionException.create(RedisConnectionException.java:78) ~[lettuce-core-5.1.7.RELEASE.jar:na]

at io.lettuce.core.RedisConnectionException.create(RedisConnectionException.java:56) ~[lettuce-core-5.1.7.RELEASE.jar:na]

at io.lettuce.core.AbstractRedisClient.getConnection(AbstractRedisClient.java:235) ~[lettuce-core-5.1.7.RELEASE.jar:na]

at io.lettuce.core.RedisClient.connect(RedisClient.java:204) ~[lettuce-core-5.1.7.RELEASE.jar:na]

at org.springframework.data.redis.connection.lettuce.StandaloneConnectionProvider.lambda$getConnection$1(StandaloneConnectionProvider.java:113) ~[spring-data-redis-2.1.9.RELEASE.jar:2.1.9.RELEASE]

at java.util.Optional.orElseGet(Optional.java:267) ~[na:1.8.0_171]

at org.springframework.data.redis.connection.lettuce.StandaloneConnectionProvider.getConnection(StandaloneConnectionProvider.java:113) ~[spring-data-redis-2.1.9.RELEASE.jar:2.1.9.RELEASE]

at org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory$SharedConnection.getNativeConnection(LettuceConnectionFactory.java:1104) ~[spring-data-redis-2.1.9.RELEASE.jar:2.1.9.RELEASE]

... 17 common frames omitted

Caused by: io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: no further information: localhost/127.0.0.1:6379

at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) ~[na:1.8.0_171]

at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717) ~[na:1.8.0_171]

at io.netty.channel.socket.nio.NioSocketChannel.doFinishConnect(NioSocketChannel.java:327) ~[netty-transport-4.1.36.Final.jar:4.1.36.Final]

at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:340) ~[netty-transport-4.1.36.Final.jar:4.1.36.Final]

at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:670) ~[netty-transport-4.1.36.Final.jar:4.1.36.Final]

at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:617) ~[netty-transport-4.1.36.Final.jar:4.1.36.Final]

at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:534) ~[netty-transport-4.1.36.Final.jar:4.1.36.Final]

at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:496) ~[netty-transport-4.1.36.Final.jar:4.1.36.Final]

at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:906) ~[netty-common-4.1.36.Final.jar:4.1.36.Final]

at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[netty-common-4.1.36.Final.jar:4.1.36.Final]

at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[netty-common-4.1.36.Final.jar:4.1.36.Final]

at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_171]

Caused by: java.net.ConnectException: Connection refused: no further information

... 12 common frames omitted

 

spring-boot java spring

Answer 5

3

Robert

tool box 는 기본 IP는 192.168.99.100 로 localhost(127.0.0.1)와 다르기 때문에 그러네요 아래의 properties를 추가 하면 정상작업 가능합니다.

spring.redis.host=192.168.99.100

spring.redis.port=6379

0

OMG

application.properties에 추가하여 해결하였습니다. (윈도우10Home edition)

spring.redis.host=192.168.99.100

spring.redis.port=6379

0

kys4548

spring.datasources.url=jdbc:redis://192.168.99.100:6379로 한참해보다 답변보고 해결하였습니다. 

감사합니다.

0

whiteship

보거스님 답변 감사합니다.

0

whiteship

도커 컨테이너를 포트 맵핑해서 쓰면 IP까지 설정해야 할 필요없이 localhost를 사용해서 접속할텐데 그런 경우가 아니라면 레디스도 application.properties에 설정해야 할거 같네요. 우선은 제 수업 영상 그대로 따라해 보시죠.

자동설정 만들기 1부의 Holoman 관련 문의 드립니다.

0

84

1

라이브러리 개발 예제 강의를 찾습니다 !!!

0

225

2

강의 진행되로 똑같이 했는데 jquery가 실행되지 않았는데

0

310

1

HateOas 가 업데이트가 되어서, "Spring HATEOAS" 코드를 아래처럼 하셔야 될겁니다.

0

364

2

springSecurit jwt에 대해서 질문드립니다.

0

343

1

섹션2 자동설정 부분 질문있습니다.

0

249

1

mongo shell 명령어 대체 mongo -> mongosh

0

1012

1

데이터베이스 마이그레이션 강의에서 질문 있습니다

0

707

0

자동 설정 만들기 2부에서 질문 있습니다

0

413

1

의존성 관리 응용 부분에서 질문 있습니다

0

321

0

Intellij 에서 빈 주입할때 계속 빨간줄이 뜨는데 어떻게 고쳐야 할까요

0

1183

1

자동설정으로 다른 프로젝트 빈 사용(번외질문)

0

363

0

CREATE TABLE 예제 따라하다가 'expected "identifier"; SQL statement:' 오류나는 경우

2

2212

2

junit5 관련하여 질문드립니다.

0

307

2

맨 처음 프로젝트 생성 후 Run 시 에러

0

535

2

외부 설정과 관련된 질문입니다.

0

255

1

test와 runner account.setEmail에 동일한 값 입력

0

323

1

컨트롤러 view 호출

0

265

1

JVM 과 arguments 는 뭔가요???

0

1170

1

pom 테그 에러

0

355

1

안녕하십니까 기선님!!!!! webclient와 비동기관련 질문요청드립니다

0

1554

1

webEnvironment 내장 톰캣

0

228

1

application.yml 파일 분리

0

393

1

안녕하세요 기선님 서블릿 어플리케이션 구조에 대해 질문드립니다

0

281

1