Ollama 连接被拒绝 - 127.0.0.1

Ollama 连接被拒绝 - 127.0.0.1

可以帮我?

[root@llama2 system]# curl http://localhost:11434/api/generate -d '{
  "model": "llama2",
  "prompt":"Why is the sky blue?"
}'

我安装了支持 Nvidia GPU 的 Llama,通过脚本安装是自动的,我运行 llama pull,最后每次我尝试运行 curl 时都会出现以下错误:

curl:(52)服务器回复为空

如果执行telnet:

[root@llama2 system]# telnet localhost 11434
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.

IP表:

[root@llama2 system]# iptables -nL
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination 

状态日志systemctl

[root@llama2 system]# systemctl status ollama.service 
● ollama.service - Ollama Service
   Loaded: loaded (/etc/systemd/system/ollama.service; enabled; vendor preset: disabled)
   Active: active (running) since Thu 2024-01-11 02:21:03 UTC; 5min ago
 Main PID: 46392 (ollama)
    Tasks: 8 (limit: 63452)
   Memory: 399.7M
   CGroup: /system.slice/ollama.service
           └─46392 /usr/local/bin/ollama serve

Jan 11 02:21:03 llama2 systemd[1]: ollama.service: Scheduled restart job, restart counter is at 3.
Jan 11 02:21:03 llama2 systemd[1]: Stopped Ollama Service.
Jan 11 02:21:03 llama2 systemd[1]: Started Ollama Service.
Jan 11 02:21:03 llama2 ollama[46392]: 2024/01/11 02:21:03 images.go:808: total blobs: 6
Jan 11 02:21:03 llama2 ollama[46392]: 2024/01/11 02:21:03 images.go:815: total unused blobs removed: 0
Jan 11 02:21:03 llama2 ollama[46392]: 2024/01/11 02:21:03 routes.go:930: Listening on 127.0.0.1:11434 (version 0.1.19)
Jan 11 02:21:03 llama2 ollama[46392]: 2024/01/11 02:21:03 shim_ext_server.go:142: Dynamic LLM variants [cuda rocm]
Jan 11 02:21:03 llama2 ollama[46392]: 2024/01/11 02:21:03 gpu.go:35: Detecting GPU type
Jan 11 02:21:03 llama2 ollama[46392]: 2024/01/11 02:21:03 gpu.go:54: Nvidia GPU detected
Jan 11 02:21:03 llama2 ollama[46392]: 2024/01/11 02:21:03 gpu.go:84: CUDA Compute Capability detected: 8.6
lines 3-19/19 (END)

在 VPS 上使用 rocky Linux 8.9,我在 VMware 和 Citrix Censerver 上尝试,并且它可以工作!

我没有做任何不同的事情,我只是运行了脚本并执行了拉取并且连接有效,因为我们正在谈论环回连接,我错过了什么吗?

我不知道我还能做什么。

答案1

解决了!问题是由于资源不足。将内存升级到 20GB 并将 GPU 视频升级到 8GB 后,运行正常!

我看到日志 CUDA Nvidia 已停止,因为没有资源尝试启动服务。

相关内容