828华为云征文 | 云服务器Flexus X实例,搭建ChatGpt:AI-OpenAI
搭建能AI-OpenAI
1、购买华为云 Flexus X 实例
Flexus云服务器X实例-华为云 (huaweicloud.com)
2、安装 Docker 的必要依赖
bashyum install -y yum-utils device-mapper-persistent-data lvm2
3、下载docker-ce.repo
bashwget -O /etc/yum.repos.d/docker-ce.repo https://mirrors.huaweicloud.com/docker-ce/linux/centos/docker-ce.repo
4、修改镜像仓库
bash[docker-ce-stable] name=Docker CE Stable - $basearch baseurl=https://repo.huaweicloud.com/docker-ce/linux/centos/9.9/$basearch/stable enabled=1 gpgcheck=1 gpgkey=https://repo.huaweicloud.com/docker-ce/linux/centos/gpg [docker-ce-stable-debuginfo] name=Docker CE Stable - Debuginfo $basearch baseurl=https://repo.huaweicloud.com/docker-ce/linux/centos/9.9/debug-$basearch/stable enabled=0 gpgcheck=1 gpgkey=https://repo.huaweicloud.com/docker-ce/linux/centos/gpg [docker-ce-stable-source] name=Docker CE Stable - Sources baseurl=https://repo.huaweicloud.com/docker-ce/linux/centos/9.9/source/stable enabled=0 gpgcheck=1 gpgkey=https://repo.huaweicloud.com/docker-ce/linux/centos/gpg [docker-ce-test] name=Docker CE Test - $basearch baseurl=https://repo.huaweicloud.com/docker-ce/linux/centos/9.9/$basearch/test enabled=0 gpgcheck=1 gpgkey=https://repo.huaweicloud.com/docker-ce/linux/centos/gpg [docker-ce-test-debuginfo] name=Docker CE Test - Debuginfo $basearch baseurl=https://repo.huaweicloud.com/docker-ce/linux/centos/9.9/debug-$basearch/test enabled=0 gpgcheck=1 gpgkey=https://repo.huaweicloud.com/docker-ce/linux/centos/gpg [docker-ce-test-source] name=Docker CE Test - Sources baseurl=https://repo.huaweicloud.com/docker-ce/linux/centos/9.9/source/test enabled=0 gpgcheck=1 gpgkey=https://repo.huaweicloud.com/docker-ce/linux/centos/gpg [docker-ce-nightly] name=Docker CE Nightly - $basearch baseurl=https://repo.huaweicloud.com/docker-ce/linux/centos/9.9/$basearch/nightly enabled=0 gpgcheck=1 gpgkey=https://repo.huaweicloud.com/docker-ce/linux/centos/gpg [docker-ce-nightly-debuginfo] name=Docker CE Nightly - Debuginfo $basearch baseurl=https://repo.huaweicloud.com/docker-ce/linux/centos/9.9/debug-$basearch/nightly enabled=0 gpgcheck=1 gpgkey=https://repo.huaweicloud.com/docker-ce/linux/centos/gpg [docker-ce-nightly-source] name=Docker CE Nightly - Sources baseurl=https://repo.huaweicloud.com/docker-ce/linux/centos/9.9/source/nightly enabled=0 gpgcheck=1 gpgkey=https://repo.huaweicloud.com/docker-ce/linux/centos/gpg
5、刷新仓库,重新构建
bashyum clean all yum makecache
6、Docker安装
bashsudo yum install docker-ce-20.10.24 docker-ce-cli-20.10.24 containerd.io
7、安装完成后,验证按照并且启动 Docker 服务
docker --version sudo systemctl start docker sudo systemctl enable docker
8、配置华为云镜像加速
{ "registry-mirrors": [ "https://fd0cfec0ac0d446db7fd9d27e92d4a8e.mirror.swr.myhuaweicloud.com" ] }
重新加载,构建
systemctl daemon-reload systemctl restart docker.service
9、安装openAI(sK-秘钥需要换成自己的)
docker run --name chatgpt-web -d -p 1002:3002 --env OPENAI_API_KEY=sK-秘钥 --env AUTH_SECRET_KEY=1234 --restart always chenzhaoyu94/chatgpt-web:latest
10、检查是否安装成功
bashdocker ps
11、访问测试-服务器端口开放1002-浏览器地址访问公网ip:1002
如下页面表示已经搭建好了ChatGpt:AI-OpenAI,如果遇到回复慢的为题需要自行解决可能是被隔离了
总结
华为云服务器Flexus X实例搭建AI-OpenAI整个过程非常流程,服务器出色的性能和稳定性,过程变得轻松而高效,如果有需要学习如何搭建的小伙伴,可以前往购买华为云服务器Flexus X实例,当前正在促销,优惠力度非常大