3 篇文章带有标签 “systemd”

Ollama

开放 Ollama 服务

环境变量

  • OLLAMA_HOST: Ollama 服务器的 IP 地址(默认 127.0.0.1:11434)
  • OLLAMA_NUM_PARALLEL: 最大并行请求数(默认 1)
  • OLLAMA_MAX_LOADED_MODELS: 最大加载模型数量(默认 1)
  • OLLAMA_KEEP_ALIVE: 模型在内存中保持加载的持续时间(默认 5m),-1 表示永久保持加载。

Linux

  1. 安装 Ollama 服务。
curl -fsSL https://ollama.com/install.sh | sh

编辑 systemd 服务,调用 systemctl edit ollama.service。这将打开一个编辑器。 sudo systemctl edit ollama.service 对于每个环境变量,在 [Service] 部分下添加一行 Environment: [Service] Environment="OLLAMA_HOST=0.0.0.

Kubernetes集群证书过期

证书一年过期了

kubectl get nodes
Unable to connect to the server: x509: certificate has expired or is not yet valid

查看API服务器的证书日期

  • 方法1
openssl x509 -in /etc/kubernetes/pki/apiserver.crt -noout -text|grep -A2 'Validity'
        Validity
            Not Before: Jun 16 06:09:07 2020 GMT
            Not After : Jun 16 06:09:07 2021 GMT
  • 方法2
openssl x509 -in /etc/kubernetes/pki/apiserver.crt -noout -text|grep ' Not '
            Not Before: Jun 16 06:09:07 2020 GMT
            Not After : Jun 16 06:09:07 2021 GMT

重新配置证书 sudo kubeadm alpha certs renew all [renew] Reading configuration from the cluster...

Linux系统DNS设置

之前在文件/etc/resolv.conf中设置了,过段时间总是自动恢复默认值。(注释中写的很详细,是不可编辑的由系统自动生成的文件)

/etc/resolv.conf # This file is managed by man:systemd-resolved(8). Do not edit. # # This is a dynamic resolv.conf file for connecting local clients to the # internal DNS stub resolver of systemd-resolved. This file lists all # configured search domains. # # Run "resolvectl status" to see details about the uplink DNS servers # currently in use. # # Third party programs must not access this file directly, but only through the # symlink at /etc/resolv.conf. To manage man:resolv.