OpenIndiana – ZFS存储

我对Linux / opensolaris命令行选项感到有点不舒服,但不是很好。

我试图build立一个基于ZFS的存储,规格是:

  • 带有4个硬盘的戴尔670机器(SATA和IDE)
  • 我已经下载并创build了Open Indiana USB,可以启动并安装
  • 我也看到了napp-it( http://www.napp-it.org/index_en.html ),并将它安装在Oracle Solaris Express(Personal Home PC)上。

我有点困惑,有几个问题:

  1. 引导/安装磁盘是独立的,我有额外的4个附加的内部驱动器,当我做安装时,我如何形成包括所有4个驱动器的池?
  2. 如果我使用napp-it方式(这对我来说似乎更容易),并通过web gui形成所有4个驱动器的池,我如何通过networking将其共享到Windows机器上,我还有两个iMac(Apple OSX) 。
  3. 有没有关于ZFS的文档,以及如何处理/维护它?
  4. 您认为的其他build议会有帮助吗?

我真的很想在openindiana上安装zfs NAS,如果有些专家可以一步一步地提供命令行或napp-it web gui – 包括设置与windows,osx客户端的共享,我们将不胜感激。

大概1:在单个磁盘上安装OpenIndiana(基本安装程序不支持镜像,如果需要,您必须稍后再做)

2.在OpenIndiana运行时创build池

3.如果您使用napp-it,您可以通过共享菜单创build共享文件夹(只需点击一个ZFS文件夹 – 共享smb列),然后在其他pipe理任务(如磁盘,池,共享acl,作业,捕捉和复制pipe理。

4.如果要通过afp和napp-it(完全由Web-UI支持)共享文件夹,则需要首先运行napp-it online-afp-installer。 看到这个pdf 。

我可以告诉你用于创build池的CLI命令。 我不知道GUI或WebUI。

#replace drive0... with your drives zpool create tank drive0 drive1 #This will create a striped set, no redundancy, single failure = dead pool zpool create tank mirror drive0 drive1 mirror drive2 drive3 #This will create a stripe set of mirrors, basically RIAD10 zpool create tank raidz drive0 drive1 drive2 drive3 #Thid create a stripe set with single parity, like RAID5 zpool create tank raidz2 drive0 drive1 drive2 drive3 #Thid create a stripe set with double parity, like RAID6 

运行zpool status以确保您运行的命令成功。

您可以使用像zfs set mountpoint=/another_location tank这样的命令更改池的安装点(默认为/tank ,因为这是上面select的名称) zfs set mountpoint=/another_location tank

它不会直接适用于你的情况,但可能会有所帮助,我在我的博客上介绍了FreeBSD的ZFS 。

问题1:ZFS引导池只能是单个磁盘或简单的镜像。 由于引导加载程序(x86上的GRUB,SPARC上的OpenBoot)的限制,此时不能使用多个镜像或RAID-Z池进行引导。 IIRC,有一个Google夏季代码提案,将GRUB 2.0支持到OI中,这可能允许从更复杂的池启动。 现在,如果要在单个池中使用四个当前磁盘,则需要使用额外的磁盘作为根/启动池。

问题#2:请参阅zfs(1)的手册页中的“sharesmb”属性,以便为Windows客户端启用CIFS共享。 MacOS X也应该能够连接到CIFS共享,尽pipe也可以在那里使用NFS。

问题3:ZFS最佳实践指南有很多信息可以帮助您: http : //www.solarisinternals.com/wiki/index.php/ZFS_Best_Practices_Guide

在问题4:我同意ewwhite以上:想想NexentaStor如果你想要做的是build立一个NAS。

我写了一篇OpenIndiana教程。

另一件事是简单的解释一下如何把它locking一点。 我在服务器上有一些朋友和家人,所以我对他们的信任几乎不像陌生人 – 关于我的系统。

毕竟他们仍然是“用户”。 你永远不能相信'用户'。

ZFS文件服务器演练

– 编辑 –

经提议,该post的文本已被剪切和粘贴。

但是,在我的博客上它的格式更好。 所以,在这里读一读。 在哪里。

自写这个我做了一些不同的东西,如删除用户的权限和符号链接只需SFTP在一个可访问的目录所需的工具。 我感觉它使机器更安全。

当我升级到16-20海湾服务器时,我会重写这个。


使用ZFS打开Indiana创build一个locking的文件服务器

用SSH安装OpenIndiana v148

在这个例子中,你将需要一个至less有四(4)个磁盘的系统

 The system disk This disk is to put the operating system on. I recommend at least 30GB The faster the better The first data disk This the first disk of a pair. Reliablilty is paramount Buy as big as you can afford The second data disk This the second disk of a pair. Reliablilty, again, is paramount And buy as big as you can afford AT LEAST ONE BACKUP DISK RAID, ZFS, OTHER... their purpose is to help with uptime ZFS also assists in somewhat painlessly growing your storage capacity Backup is backup, redundant disk strategies are for use and failure Buy as big as you can afford 

按照提示,打开SSH,使用整个系统盘。

通过CLI更新系统

pkg image-update –require-new-be

在安装时,GUI工具在版本148中不起作用。

find磁盘名称

格式

使用[CTRL + C]退出格式命令

创build镜像的zpool

zpool创build新池镜像c2t2d0 c2t3d0

看看你的手艺

zpool状态df -h

创build一个基础目录结构

newpool | -business | -hobby | -books | -users | -admin01 | | -asmith | -shared | | -lsmith | -shared | -misc

mkdir / newpool / business / mkdir / newpool / hobby / mkdir / newpool / books / mkdir / newpool / users / mkdir / newpool / users / admin01 / mkdir / newpool / users / asmith / mkdir / newpool / users / asmith / shared / mkdir / newpool / users / lsmith / mkdir / newpool / users / lsmith / shared / mkdir / newpool / misc /

如有必要,创build任何组

groupadd admin01 groupadd internal groupadd external groupadd common

添加任何不存在的初始用户

请注意,我正在用两个命令创build两个用户,他们很长,所以文本正在包装。

useradd -d / newpool / users / asmith / -c“Adam Smith”-G internal,common -s / usr / lib / rsh asmith useradd -d / newpool / users / lsmith / -c“Luanne Smith”-G external, common -s / usr / lib / rsh lsmith

选项如下:

 -d is the home directory /newpool/users/username/ in this example. -c is the real name, it can really be anything. But it you want it to contain a space then enclose the value in double quotes. -G list all the groups of the directories you want the people to have access to separated by commas. At the very least I give membership to the common group -G common . But maybe I want to give access to the external directory as well -G external,common . -s /usr/lib/rsh is the 'restricted shell' to prevent a lot of funny business. 

为任何不存在的初始用户设置密码

passwd lsmith passwd asmith

passwd用户名

(input密码两次 – tada!)

(passwd:密码已成功更改为用户名)

修改现有的用户

usermod -G admin01,内部,普通admin01

(UX:usermod:admin01当前已login,有些更改可能会在下次login时才会生效。)

您可以在明文/ etc / passwd文件中validation用户信息

您可以在明文/ etc / group文件中validation组创build

应用适当的所有者:组属性

chown admin01:admin01 / newpool / business / chown admin01:peers / newpool / hobby / chown admin01:peers / newpool / books / chown admin01:admin01 / newpool / users / chown admin01:admin01 / newpool / users / admin01 / chown asmith: admin01 / newpool / users / asmith / chown asmith:admin01 / newpool / users / asmith / shared / chown lsmith:admin01 / newpool / users / lsmith / chown lsmith:admin01 / newpool / users / lsmith / shared / chown admin01:common / newpool /其它/

应用适当的权限

(4读2写1执行)

(!执行所需的非所有者:组目录遍历文件系统)

chmod 700 / newpool / business / chmod 750 / newpool / hobby / chmod 750 / newpool / books / chmod 711 / newpool / users / chmod 770 / newpool / users / admin01 / chmod 770 / newpool / users / asmith / chmod 770 / newpool / users / asmith / shared / chmod 770 / newpool / users / lsmith / chmod 770 / newpool / users / lsmith / shared / chmod 750 / newpool / misc /

770赋予了可写性,可读性,遍历所有者和组成员,而对于其他用户而言则是一般用户目录

750给所有者写信,阅读和遍历所有者和组成员,而不是别人 – 只读访问普通用户

711提供了所有者的访问权限,并且能够将目录遍历到每个人 – 允许普通用户更深入地访问他们可能访问的目录树

700除了拥有者以外不能访问任何人,甚至不能打开目录 – 完全撤销对普通用户的访问

NFS和Samba

目前,我没有为此服务器设置任何NFS或Samba共享。

我会更新说明应该改变。

设置配额

在我的文件服务器上,我不打算拥有许多用户,甚至更less的用户组。 到目前为止,我没有计划任何配额。

如果我确实设定了配额,那么我可能会根据用户而定。

zfs设置userquota @ username = 100G newpool / users / username

但是,使用ZFS版本15的用户组配额也可以使用。

zfs set groupquota @ common = 250GB newpool / misc

更多用户?

添加新的目录

mkdir在users / newpool / users / username /和/ newpool / users / username / shared /

添加新用户

useradd -d / newpool / users / username / -c“Fname Lname”-G [逗号分隔列表]常用-s / usr / lib / rsh用户名

将所有者:组属性更改为新的用户目录

同上

对新目录应用适当的权限

同上

设置新的用户密码

同上