需求:服务器是arm64架构,go-fastdfs没有arm64的二进制包
lscpu #查看系统的 CPU 架构信息
Architecture: aarch64
解决办法:源码编译安装go-fastdfs
1、安装golang环境安装
参考:https://www.osyunwei.com/archives/14314.html
2、下载go-fastdfs
https://github.com/sjqzhang/go-fastdfs/archive/refs/tags/v1.4.0.tar.gz
上传安装包到/data/soft 目录
cd /data/soft
tar zxvf go-fastdfs-1.4.0.tar.gz #解压
mv go-fastdfs-1.4.0 /data/server/go/gopath #移动到项目路径
cd /data/server/go/gopath/go-fastdfs-1.4.0
mv vendor src
export GO111MODULE=off #禁用 Go 模块的在线下载功能。在这种情况下,Go 将不会尝试从远程仓库下载依赖项,而是依赖于 GOPATH 中已经存在的本地包
pwd=`pwd`
GOPATH=$pwd go build -o fileserver fileserver.go
在当前目录会生成fileserver二进制文件。
拷贝fileserver到go-fastdfs安装目录,执行./fileserver即可
至此,Linux下arm64架构编译安装go-fastdfs完成。

» 转载请注明来源:系统运维 » Linux下arm64架构编译安装go-fastdfs


