Ubuntu 连接被拒绝:localhost/127.0.0.1,当我在RaspberryPi中使用spring boot和莴苣时

Ubuntu 连接被拒绝:localhost/127.0.0.1,当我在RaspberryPi中使用spring boot和莴苣时,ubuntu,raspberry-pi,lettuce,Ubuntu,Raspberry Pi,Lettuce,我正在尝试使用RaspberryPI 4制作个人服务器。 我在里面安装了Ubuntu 这是我用来测试Redis的代码 @Bean public RedisConnectionFactory redisConnectionFactory() { return LettuceConnectionFactory(redisHost, redisPort); } 当我在Windows桌面和Linux笔记本电脑上运行它时,它不会产生任何问题 但就我的树莓而言,发生了以下情况 Caused by:

我正在尝试使用RaspberryPI 4制作个人服务器。 我在里面安装了Ubuntu

这是我用来测试Redis的代码

@Bean
public RedisConnectionFactory redisConnectionFactory() {
    return LettuceConnectionFactory(redisHost, redisPort);
}
当我在Windows桌面和Linux笔记本电脑上运行它时,它不会产生任何问题

但就我的树莓而言,发生了以下情况

Caused by: io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: localhost/127.0.0.1:6389
Caused by: java.net.ConnectException: Connection refused
        at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
        at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:714)
        at io.netty.channel.socket.nio.NioSocketChannel.doFinishConnect(NioSocketChannel.java:330)
        at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:334)
        at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:702)
        at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:650)
        at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:576)
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493)
        at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
        at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
        at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
        at java.lang.Thread.run(Thread.java:748)

有人知道如何解决这个问题吗?

在启动应用程序之前,以下命令的输出是什么:
netstat-ant | grep 6389
-如果没有输出,或者输出提到IPv6,这意味着没有人在
localhost/127.0.0.1:6389上侦听,或者可能在IPv6套接字而不是IPv4套接字上侦听。