安装Sub-Store
使用Docker安装
- 下载镜像:
docker pull substore/substore:latest
- 运行Docker容器:
docker run -d --name substore \ -p 808:808 \ -p 364:364 \ substore/substore:latest
手动安装(推荐)
- 下载安装包:
- 下载最新版本的Sub-Store安装包,例如从官方网站或GitHub仓库。
- 安装文件:
./substore_1.x.x-ubuntu_x64.deb
- 启动服务:
sudo systemctl start substore sudo systemctl enable substore
使用包管理工具(例如Ansible)
- 克隆仓库:
git clone https://github.com/substore/substore.git
- 运行安装脚本:
./playbook/install.yml
配置Sub-Store
设置域名和IP地址
- 进入控制台:
substorectl --endpoint http://localhost:808
- 配置域名:
domain mysubstore.com
- 配置IP地址:
ip 192.168.1.1
添加存储层
- 创建存储层:
substorectl --endpoint http://localhost:808 storage create --name my-storage --provider ipfs
- 查看存储层:
substorectl --endpoint http://localhost:808 storage list
配置API访问
设置API权限
- 进入控制台:
substorectl --endpoint http://localhost:808 settings
- 设置API参数:
api __set /api/v1 --setting APIPort=8081 --setting GatewayPort=3641 --setting EnableHTTPS=true
文件上传和管理
- 使用Web界面:
- 访问
http://localhost:808
- 访问
- 使用命令上传文件:
substorectl --endpoint http://localhost:808 file upload --path /path/to/file.txt
集群扩展
- 添加新的节点:
substorectl --endpoint http://localhost:808 cluster add-node --address 192.168.1.2:808
- 等待同步:
同步完成后,新节点将自动加入网络。
高级配置
- 调整网络参数:
- 修改
/etc/substore.conf,调整NAT和防火墙设置。
- 修改
- 日志级别:
echo 'debug' > /etc/substore.loglevel
安全配置
- 设置访问控制:
substorectl --endpoint http://localhost:808 security set-acl --action read/write --user admin
- IP白名单:
substorectl --endpoint http://localhost:808 security set-ip-whitelist 192.168.1./24
维护和监控
- 备份数据:
substorectl --endpoint http://localhost:808 storage export --name my-storage --export-file backup.tar.gz
- 监控健康:
- 查看日志:
journalctl -u substore - 检查网络连接:
ping 192.168.1.1
- 查看日志:
故障排除
- 节点不在线:
检查网络连接和防火墙设置。
- 数据恢复:
使用备份文件重新添加存储层。
通过以上步骤,您可以成功配置并管理Sub-Store网络,确保遵循安全最佳实践,并定期维护以确保网络的稳定运行。









