第 75 章 Network Attached Storage(NAS 网络附加存储)

本文涉及的产品
文件存储 NAS,50GB 3个月
简介:

75.1. Network Storage - Openfiler

Openfiler is a powerful, intuitive browser-based network storage software distribution. Openfiler delivers file-based Network Attached Storage and block-based Storage Area Networking in a single framework.

openfiler 的官方网站

过程 75.1. Openfiler Storage Control Center

  1. 登录管理界面

    			
    https://<ip address>:446/
    			
    			

    初始帐号和密码是: openfiler/password

  2. 首先要修改默认密码

    Accounts->Admin Password

    Current Password:  password
    New Password:  新密码
    Confirm New Password:  确认密码
    			

    Submit 提交

75.1.1. Accounts

  • 用户认证

    openfiler.ldif

    dn: ou=people,dc=bg7nyt,dc=cn
    ou: people
    objectClass: organizationalUnit
    
    dn: ou=Idmap,dc=bg7nyt,dc=cn
    ou: Idmap
    objectClass: organizationalUnit
    			

    添加people组织单元

    [chenjingfeng@backup ldap]$ ldapadd -x -D "cn=root,dc=bg7nyt,dc=cn" -W -f openfiler.ldif
    Enter LDAP Password:
    adding new entry "ou=people,dc=bg7nyt,dc=cn"
    
    adding new entry "ou=Idmap,dc=bg7nyt,dc=cn"
    			
    1. Accounts->Authentication

      Use LDAP: 打勾

      Server:  ldap.bg7nyt.cn
      Base DN:  dc=bg7nyt,dc=cn
      Root bind DN:  cn=root,dc=bg7nyt,dc=cn
      Root bind Password:  你的密码
      					
    2. Services->LDAP Settings

      openfiler_services_ldap.png
      Base DN:  dc=bg7nyt,dc=cn
      Root bind DN:  cn=root,dc=bg7nyt,dc=cn
      Root Password:  你的密码
      					
    3. Services->Enable/Disable

      openfiler_services_en_dis.png
    4. Accounts->Account Administration

      1. Group Administration

        Group Name: nfs
        							
      2. User Administration

        Username: 用户名
        Password: 密码
        Retype password: 确认密码
        Primary Group: 用户组
        							

        查看组织单元:ou=people,dc=bg7nyt,dc=cn

        							
        [chenjingfeng@backup ldap]$ ldapsearch -x -b 'ou=people,dc=bg7nyt,dc=cn'
        # extended LDIF
        #
        # LDAPv3
        # base <ou=people,dc=bg7nyt,dc=cn> with scope sub
        # filter: (objectclass=*)
        # requesting: ALL
        #
        
        # people, bg7nyt.cn
        dn: ou=people,dc=bg7nyt,dc=cn
        ou: people
        objectClass: organizationalUnit
        
        # neo, People, bg7nyt.cn
        dn: uid=neo,ou=People,dc=bg7nyt,dc=cn
        objectClass: inetOrgPerson
        objectClass: posixAccount
        homeDirectory: /dev/null
        loginShell: /bin/false
        cn: neo
        givenName: neo
        sn: neo
        uid: neo
        uidNumber: 500
        gidNumber: 500
        
        # search result
        search: 2
        result: 0 Success
        
        # numResponses: 3
        # numEntries: 2
        							
        							

75.1.2. Volumes

  • 卷管理 [Volumes]

    我这里是使用VMware做的试验,在VMware中增加一些硬盘即可.

    1. Volumes -> Physical Storage Mgmt.

      openfiler_volumes_physical.png
      Edit Disk Type Description Size Label type Partitions
      /dev/sda SCSI VMware, VMware Virtual S 8.00 GB msdos 3 (view)
      /dev/sdb SCSI VMware, VMware Virtual S 8.00 GB gpt 0 (view)
      /dev/sdc SCSI VMware, VMware Virtual S 8.00 GB gpt 0 (view)
      /dev/sdd SCSI VMware, VMware Virtual S 8.00 GB gpt 0 (view)
      ...
      					

      openfiler安装在/dev/sda,/dev/sda硬盘空间不用太大,单独给openfiler使用.建议做RAID 1(硬件RAID卡或服务器主版提供的RAID)

      其它硬盘是用于存储的硬盘,如果有条件这些硬盘组也最好做成硬RAID,没有条件我们可以在openfiler中做软件RAID.

      点击"Edit Disk"列表内硬盘标签,之后可以看到"Create a partition in /dev/sdb"

      openfiler-volumes-1.png
      Mode: Primary
      Partition Type: [Physical volume] / [RAID array member]
      Starting cylinder: 1
      Ending cylinder Size: 1044
      Size: 自动产生
      					

      单击"Create"创建分区

      openfiler-volumes-2.png

      Back to the list of physical storage devices

      如果没有特别需求,不需要创建多个分区.

      Edit partitions in /dev/sdb (1044 cylinders with "gpt" label)
      
      Device Type Number Start cyl End cyl Blocks Size Type Delete
      /dev/sdb1 Linux Physical Volume (0x8e) 1 1 10 78831 76.98 MB Primary Delete
      /dev/sdb2 Linux Physical Volume (0x8e) 2 10 100 721920 705.00 MB Primary Delete
      /dev/sdb3 Linux Physical Volume (0x8e) 3 100 200 801792 783.00 MB Primary Delete
      /dev/sdb4 Linux Physical Volume (0x8e) 4 200 300 802816 784.00 MB Primary Delete
      /dev/sdb5 Linux Physical Volume (0x8e) 5 300 400 801792 783.00 MB Primary Delete
      					
    2. Volumes->Volume Group Mgmt.

      Volume Group 可以实现动态扩展空间,注意如果在使用中有一个成员盘损坏,你将无法恢复数据.

      应急使用可以,不建议长期使用.

      openfiler-vg-0.png
      Volume group name: vg0
      Select physical volumes to add: 在列表前面打勾
      /dev/sdb1 8.00 GB
      /dev/sdc1 8.00 GB
      					

      单击"Add volume group"创建vg0

      openfiler-vg-1.png

      表 75.1. Volume Group Management

      Volume Group Name Size Allocated Free Members Add physical storage Delete VG
      vg0

      15.94 GB

      0 bytes 15.94 GB View member PVs Add PVs Delete

      扩展Volume Group单击[PVs Add]按钮

      openfiler-vg-2.png

      分区列表前面打勾

      [Submit]提交

    3. Volumes -> Create New Volume

      选择VG

      openfiler_cnv_svg.png

      创建卷

      openfiler_cnv_cv.png
      Volume Name: 卷名
      Volume Description: 描述
      Required Space (MB): 配额
      Filesystem type: 文件系统
      					

      单击[Create]按钮

      openfiler_cnv_loev.png

75.1.2.1. RAID

Openfiler提供软RAID.

  1. Volumes -> Physical Storage Mgmt.

    openfiler_volumes_physical.png

    点击"Edit Disk"列表内硬盘标签,之后可以看到"Create a partition in /dev/sdb"

    openfiler_raid_array_member.png

    单击[Create]按钮创建RAID组成员

    openfiler_volumes_physical_edit_partitio

    单击[Back to the list of physical storage devices]返回到 "Physical Storage Management"

  2. Volumes -> Software RAID Mgmt.

    openfiler_volumes_raidmanage.png
    Select RAID array type: RAID(0,1,5,6,10)
    Select chunk size: 这可以针对你的需求做优化
    Select RAID devices to add: 打勾选择
    					

    单击[Add array]创建RAID

    openfiler_volumes_raidmanage1.png

    RAID创建完成后,就可以卷组和卷

    Volumes -> Volume Group Mgmt. -> Create New Volume

    RAID 6 采用双校验盘最少4块硬盘

75.1.2.2. iSCSI

Volumes -> Create New Volume

openfiler_volumes_create_iscsi.png

单击[Create]按钮

openfiler_volumes_loev_iscsi.png

单击[Update]按钮

Services -> Enable/Disable -> iSCSI target 确认已经 Enable

General -> Local Networks

openfiler_general_local_networks.png

单击[Update]按钮

Volumes -> List of Existing Volumes -> Select Volume Group

单击 iScsi 卷列表 Properties 下的 [Edit] 连接

openfiler_volumes_iscsi_access.png

默认是:Deny, 修为Allow

75.1.2.2.1. Microsoft iSCSI Software Initiator

开始菜单 找到 Microsoft iSCSI Initiator 并运行

单击 Discovery 选项卡

单击 [ Add ] 按钮

ms_iscsi_add_target_portal.png

单击 [ OK ] 按钮

ms_iscsi_discovery.png

单击 Targets 选项卡

ms_iscsi_targets.png

单击 [Refresh] 按钮 -> [Log On...]

ms_iscsi_logon.png

单击 [ OK ] 按钮

完成Initiator设置

我的电脑 -> 单击鼠标右键 -> 管理

ms_iscsi_disk_manager.png

初始化硬盘

ms_iscsi_disk_initial.png

选择硬盘

ms_iscsi_disk_select.png

初始化完成,红色图标消失后你就可以对磁盘分区,挂载卷,格式化。

使用 iSCSI 与使用本地磁盘完全一样。

Status -> iSCSI

75.1.3. Quota

  • [注意] 注意

    有些文件系统不支持Quota

    1. Quota -> Guest Quota

      openfiler_quota_sv.png

      单击[Change]按钮

      openfiler_quota_guest.png

      单击[Apply]按钮

75.1.4. Shares

  • Shares

    openfiler_share.png

    单击列表内的连接.

    openfiler_share_subfolder.png
    Folder name: 输入文件夹名
    			

    单击 [Create Sub-folder] 按钮 创建文件夹

    openfiler_share_make_share.png
    Share name: 输入共享名
    Share description: 描述
    Override SMB share name:  
    			
    openfiler_share_edit.png

    单击[Change]按钮 修改

    组的权限制

    openfiler_share_group_access.png

    单击[Update]按钮

    主机访问权限配置

    openfiler_share_host.png

    单击[Update]按钮




原文出处:Netkiller 系列 手札
本文作者:陈景峯
转载请与作者联系,同时请务必标明文章原始出处和作者信息及本声明。

相关实践学习
基于ECS和NAS搭建个人网盘
本场景主要介绍如何基于ECS和NAS快速搭建个人网盘。
阿里云文件存储 NAS 使用教程
阿里云文件存储(Network Attached Storage,简称NAS)是面向阿里云ECS实例、HPC和Docker的文件存储服务,提供标准的文件访问协议,用户无需对现有应用做任何修改,即可使用具备无限容量及性能扩展、单一命名空间、多共享、高可靠和高可用等特性的分布式文件系统。 产品详情:https://www.aliyun.com/product/nas
目录
相关文章
|
3月前
|
网络协议 前端开发 数据处理
|
9天前
|
存储 负载均衡 监控
|
14天前
|
网络协议
centos8 网卡 Nmcli(是network的简写 Nmcli)配置网络
centos8 网卡 Nmcli(是network的简写 Nmcli)配置网络
15 0
|
1月前
|
消息中间件 存储 缓存
Kafka【基础知识 02】集群+副本机制+数据请求+物理存储+数据存储设计(图片来源于网络)
【2月更文挑战第20天】Kafka【基础知识 02】集群+副本机制+数据请求+物理存储+数据存储设计(图片来源于网络)
29 1
|
3月前
|
存储 网络安全 文件存储
无公网ip如何随时随地远程查看本地群晖NAS存储的文件资源(上)
无公网ip如何随时随地远程查看本地群晖NAS存储的文件资源(上)
72 0
|
3月前
|
存储 Unix Linux
分布式文件系统协议:NFS(Network File System)网络文件系统
NFS(Network File System)网络文件系统是一种分布式文件系统协议,最初由Sun Microsystems开发,并在1984年首次发布。 NFS允许不同计算机通过网络共享资源,特别是文件和目录,就像它们是本地存储的一部分一样。使用NFS的客户端可以挂载远程服务器上的文件系统,使得用户能够以透明的方式访问远程数据,实现跨多个系统的文件共享。
129 0
|
3月前
|
运维 网络协议 网络架构
|
4月前
|
存储 监控 数据处理
NAS(Network Attached Storage,
NAS(Network Attached Storage,网络附加存储)是一种用于在网络上共享存储设备的存储架构。NAS设备通常是一个独立的设备,可以通过网络连接到多个客户端,并提供文件级别的存储和访问。NAS设备通常使用NFS或SMB协议来提供文件级别的访问,可以用于存储和共享各种类型的数据,例如文档、图像、视频等。
42 2
|
4月前
|
PHP Docker 容器
一文解读Docker 网络Network
一文解读Docker 网络Network
|
5月前
|
Web App开发 存储 Linux
Linux C/C++开发(后端/音视频/游戏/嵌入式/高性能网络/存储/基础架构/安全)(下)
Linux C/C++开发(后端/音视频/游戏/嵌入式/高性能网络/存储/基础架构/安全)

热门文章

最新文章