我是校内网,尝试了
改镜像源
(cooragent) ruiy@CJQ:~/sdb/B/cooragent$ sudo vim /etc/docker/daemon.json
[sudo] password for ruiy:
(cooragent) ruiy@CJQ:~/sdb/B/cooragent$ sudo service docker restart
(cooragent) ruiy@CJQ:~/sdb/B/cooragent$ sudo docker info
Registry Mirrors:
https://registry.docker-cn.com/
http://hub-mirror.c.163.com/
https://docker.mirrors.ustc.edu.cn/
https://kfwkfulq.mirror.aliyuncs.com/
Live Restore Enabled: false
但是对于拉去 weaviate 没用,
weaviate 向量库有个图存储想试试效果
尝试多次无果
chatgpt建议通过下载 本地安装,
但是没找到 weaviate 的docker 镜像
解决方法
最后终于找到这个镜像拉去成功
wdocker.io/semitechnologies/weaviate 项目中国可用镜像列表 | 高速可靠的 Docker 镜像资源
拉去命令
docker pull swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/semitechnologies/weaviate:1.31.0
官网 docker配置
1.1 Create a Weaviate database
Save the following code to a file named docker-compose.yml
in your project directory.
image 修改成上面给的
#volumes 是你想存储的卷地址
#PERSISTENCE_DATA_PATH 持久数据地址 这两个地址按照需求修改好
---
services:
weaviate:
command:
- --host
- 0.0.0.0
- --port
- '8080'
- --scheme
- http
image: cr.weaviate.io/semitechnologies/weaviate:1.32.0
ports:
- 8080:8080
- 50051:50051
volumes:
- weaviate_data:/var/lib/weaviate
restart: on-failure:0
environment:
QUERY_DEFAULTS_LIMIT: 25
AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED: 'true'
PERSISTENCE_DATA_PATH: '/var/lib/weaviate'
ENABLE_API_BASED_MODULES: 'true'
ENABLE_MODULES: 'text2vec-ollama,generative-ollama'
CLUSTER_HOSTNAME: 'node1'
volumes:
weaviate_data:
...
Run the following command to start a Weaviate instance using Docker:
docker-compose up -d
1.2 Install a client library
We recommend using a client library to work with Weaviate. Follow the instructions below to install one of the official client libraries, available in Python, JavaScript/TypeScript, Go, and Java.
- Python
Install the latest, Python client v4, by adding weaviate-client
to your Python environment with pip
:
pip install -U weaviate-client
1.3: Connect to Weaviate
Now you can connect to your Weaviate instance.
The example below shows how to connect to Weaviate and perform a basic operation, like checking the cluster status.
- Python
quickstart_check_readiness.py
import weaviate
client = weaviate.connect_to_local()
print(client.is_ready()) # Should print: `True`
client.close() # Free up resources
python 运行有个true 就连上了,
If you did not see any errors, you are ready to proceed. We will replace the simple cluster status check with more meaningful operations in the next steps.
接下来熟悉操作