当前位置: 首页 > ds >正文

基于LNMP分布式个人云存储

1.准备工作

a.关闭两台虚拟机的安全软件

客户端:

[root@master ~]# systemctl stop firewalld
[root@master ~]# systemctl disable firewalld
[root@master ~]# systemctl status firewalld
○ firewalld.service - firewalld - dynamic firewall daemonLoaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor>Active: inactive (dead)Docs: man:firewalld(1)
[root@master ~]# getenforce
Disabled

服务端:

[root@node1 ~]# systemctl stop firewalld
[root@node1 ~]# systemctl disable firewalld
[root@node1 ~]# systemctl status firewalld
○ firewalld.service - firewalld - dynamic firewall daemonLoaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor>Active: inactive (dead)Docs: man:firewalld(1)
[root@node1 ~]# getenforce
Disabled

b.两台虚拟机,一台是客户端(web),一台是服务端(nfs),修改两台主机名称为web,nfs

客户端(web):

[root@master ~]# hostnamectl set-hostname web
[root@master ~]# bash
[root@web ~]#

nfs端(nfs):

[root@node1 ~]# hostnamectl set-hostname nfs
[root@node1 ~]# bash
[root@nfs ~]#

2.服务端(nfs)配置

a.安装mariadb,mariadb-server,nfs-utils相关软件

[root@nfs /]# yum install mariadb mariadb-server nfs-utils -y

b.上传软件

使用xftp将nextcloud-25.0.1.zip软件压缩包上传到Linux的根目录,并解压缩

解压缩:

[root@nfs ~]cd /
[root@nfs /]# unzip  /nextcloud-25.0.1.zip 

c.设置nextcloud安装命令权限

[root@nfs /]# chmod -R 777 /nextcloud

d.设置数据库

#启动mariadb
[root@nfs /]# systemctl start mariadb#进入mysql以root的身份运行
[root@nfs /]# mysql -uroot -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 3
Server version: 10.5.29-MariaDB MariaDB ServerCopyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.#创建数据库
MariaDB [(none)]> create  database  nextcloud;
Query OK, 1 row affected (0.001 sec)#创建用户及密码,%是允许远程连接设备
MariaDB [(none)]> create  user  'nextcloud'@'%' identified  by '123456';
Query OK, 0 rows affected (0.001 sec)#设置权限
MariaDB [(none)]>  grant all on  nextcloud.*  to  'nextcloud'@'%';
Query OK, 0 rows affected (0.001 sec)#退出数据库
MariaDB [(none)]> exit
Bye

e.重启数据库

[root@nfs /]# systemctl restart mariadb

f.编写nfs主配置文件/etc/exports

#编辑配置文件,写入共享的文件和ip地址,权限
[root@nfs ~]#vim /etc/exports
/nextcloud      192.168.75.154/24(rw,all_squash,sync)

g.先重启rpc服务,在重启nfs服务

[root@nfs /]# systemctl enable --now rpcbind
[root@nfs /]# systemctl enable --now nfs-server

3.客户端(web)配置

a.安装nginx,php,autofs,nfs-utils相关软件

[root@web ~]# yum install nginx autofs nfs-utils -y

b.查询服务端(nfs)远程共享的目录

[root@web ~]# showmount -e 192.168.75.155
Export list for 192.168.75.155:
/nextcloud 192.168.75.154/24

c.编辑autofs自动挂载服务配置文件/etc/auto.master

#编辑配置文件,定位第7行在下面写入代码
[root@web ~]# vim /etc/auto.master
/misc   /etc/auto.misc
/lei    /etc/auto.jun

d.编辑上面的目录/etc/auto.jun

#编写子目录写入代码
[root@web ~]# vim /etc/auto.jun
jun     192.168.75.155:/nextcloud

e.启动autofs服务

[root@web ~]# systemctl restart nginx

f.查看服务端共享的文件

[root@web jun]# ls
3rdparty  console.php  dist        occ           public.php  status.php
apps      COPYING      index.html  ocm-provider  remote.php  themes
AUTHORS   core         index.php   ocs           resources   updater
config    cron.php     lib         ocs-provider  robots.txt  version.

4.安装并测试

a.打开浏览器后输入服务器IP地址,进入nextcloud安装向导

b.管理员的用户名即密码自定

c.存储与数据库:选择MySQL/MariaDB,设置数据库用户为nextcloud,密码为123456,数据库名为nextcloud,主机名为服务端主机:3306

d.安装成功

http://www.xdnf.cn/news/16206.html

相关文章:

  • Docker详解及实战
  • 274款古装人物头像
  • 20250704-基于强化学习在云计算环境中的虚拟机资源调度研究
  • DeepSeek 助力 Vue3 开发:打造丝滑的日历(Calendar),日历_家庭维护示例(CalendarView01_31)
  • 性能测试-jmeter实战5
  • 【无标题】word 中的中文排序
  • 字节 AI 编辑器 Trae 2.0 SOLO 出道! 国际版不充分指南及与国内版的对比
  • 腾讯云推出CodeBuddy:革新AI全栈开发体验
  • Xorg占用显卡内存问题和编译opencv GPU版本
  • docker安装minio及配置禁止列出目录文件
  • 时序数据库主流产品概览
  • 分布式电商系统:缓存策略、负载均衡与容灾方案
  • 一款基于 WPF 开源、功能全面的串口调试工具
  • YOLO12论文阅读:Attention-Centric Real-Time Object Detectors
  • Python关于pandas的基础知识
  • Springboot和postman的使用
  • torchvision.transforms 与 MONAI 数据增强的异同
  • 华为视觉算法面试30问全景精解
  • 网易视觉算法面试30问全景精解
  • C++ 模板库map数据结构的概念和使用案例
  • 板凳-------Mysql cookbook学习 (十二--------5)
  • 鸿蒙卡片开发保姆级教程
  • Java 线程池详解:从原理到实战,彻底掌握并发编程核心组件
  • Baumer工业相机堡盟工业相机如何通过YoloV8深度学习模型实现水下鱼类识别(C#代码,UI界面版)
  • 【机器学习深度学习】微调量化与模型导出量化:区分与应用
  • 数字护网:一次深刻的企业安全体系灵魂演练
  • JavaScript 03 严格检查模式Strict字符串类型详解
  • 论文笔记 | Beyond Pick-and-Place: Tackling Robotic Stacking of Diverse Shapes
  • Python机器学习:从零基础到项目实战
  • Netty中AbstractReferenceCountedByteBuf对AtomicIntegerFieldUpdater的使用