Merge remote-tracking branch 'LCTT/master'

This commit is contained in:
Xingyu.Wang 2018-09-15 22:18:44 +08:00
commit 8da63a23a0
11 changed files with 323 additions and 328 deletions

View File

@ -1,8 +1,9 @@
Distrochooser 帮助 Linux 初学者选择合适的 Linux 发行版
======
![](https://www.ostechnix.com/wp-content/uploads/2018/08/distrochooser-logo-720x340.png)
你好 Linux 新手!今天,我为你们带来了一个好消息!你也许想知道如何选择合适的 Linux 发行版。当然,你可能已经咨询过一些 Linux 专家来帮助你的需要选择 Linux 发行版。你们中的一些人可能已经用 Google 搜索并浏览了各种资源、Linux 论坛、网站和博客来寻找完美的发行版。好了,你不必再那样做了。有了 **Distrochooser**,一个帮助你轻松找到 Linux 发行版的网站。
![](https://www.ostechnix.com/wp-content/uploads/2018/08/distrochooser-logo-720x340.png)
你好 Linux 新手!今天,我为你们带来了一个好消息!你也许想知道如何选择合适的 Linux 发行版。当然,你可能已经咨询过一些 Linux 专家来帮助你的需要选择 Linux 发行版。你们中的一些人可能已经用 Google 搜索并浏览了各种资源、Linux 论坛、网站和博客来寻找完美的发行版。好了,你不必再那样做了。有了 **Distrochooser**,一个帮助你轻松找到 Linux 发行版的网站。
### Distrochooser 如何帮助 Linux 初学者选择合适的 Linux 发行版?
@ -11,6 +12,7 @@ Distrochooser 会根据你的答案向你询问一系列问题并建议你尝试
![][2]
你将被重定向到 Distrochooser 主页,其中有一个小测试在等待你注册。
![](https://www.ostechnix.com/wp-content/uploads/2018/08/distrochooser-home-page.png)
你需要回答一系列问题(准确地说是 16 个问题)。问题同时有单选和多选。以下是完整的问题列表。
@ -32,8 +34,6 @@ Distrochooser 会根据你的答案向你询问一系列问题并建议你尝试
15. 软件:管理
16. 软件:更新
仔细阅读问题并在相应问题下面选择合适的答案。Distrochooser 提供了更多选择来选择接近完美的发行版。
* 你总是可以跳过问题,
@ -42,9 +42,7 @@ Distrochooser 会根据你的答案向你询问一系列问题并建议你尝试
* 你可以随时删除答案,
* 你可以在测试结束时对属性进行加权,以强调对你来说重要的内容。
选择问题的答案后,单击**继续**以转到下一个问题。完成后,单击**获取结果**按钮。你也可以通过单击答案下面的**“清除”**按钮随时清除选择。
选择问题的答案后单击“Proceed”以转到下一个问题。完成后单击“Get Result”按钮。你也可以通过单击答案下面的“Clear”按钮随时清除选择。
### 结果?
@ -69,7 +67,7 @@ via: https://www.ostechnix.com/distrochooser-helps-linux-beginners-to-choose-a-s
作者:[SK][a]
选题:[lujun9972](https://github.com/lujun9972)
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -1,53 +0,0 @@
Mastering CI/CD at OpenDev
======
![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/BUSINESS_opennature_3.png?itok=J1OSECM_)
After launching in 2017, the [OpenDev Conference][1] is now an annual event. At the inaugural event last September, the conference focus was on edge computing. This year's event, taking place May 22-23, will be focused on Continuous Integration/Continuous Deployment (CI/CD) and will be co-located with the OpenStack Summit in Vancouver.
I was invited to participate in the program committee for OpenDev CI/CD based on my background on the CI/CD system for the OpenStack project and my recent move into the container space. Today I frequently talk about CI/CD pipelines using various open source technologies, including [Jenkins][3] [GitLab][2],[Spinnaker][4] , and [Artifactory][5]
This event is exciting for me because we're bringing two open source infrastructure ideas together into one event. First, we'll be discussing CI/CD tooling that can be used by any organization. To this end, in the [keynotes][6] we'll hear practical talks about open source CI/CD tooling, including a talk about Spinnaker from Boris Renski and one from Jim Blair on [Zuul][7]. The keynotes also will include higher-level talks about the preference for open technologies, especially across communities and inside open source projects themselves. From Fatih Degirmenci and Daniel Farrell we'll hear about sharing continuous delivery practices across communities, and Benjamin Mako Hill will join us to talk about why free software needs free tools.
Given the relative newness of CI/CD, the rest of the event is a mix of talks, workshops, and collaborative discussions. When selecting from talks and workshops submitted, and coming up with collaborative discussion topics, we wanted to make sure there was a diverse schedule so anyone on the open CI/CD spectrum would find something interesting.
The talks will be standard conference style, selected to cover key topics like crafting CI/CD pipelines, improving security when practicing DevOps, and more specific solutions like container-based [Aptomi][8] on Kubernetes and doing CI/CD in ETSI NFV environments. Many of these sessions will serve as an introduction to these topics, ideal for those who are new to the CI/CD space or any of these specific technologies.
The hands-on workshops are longer and will have specific outcomes in mind for attendees. These include "[Anomaly Detection in Continuous Integration Jobs][9]," "[How to Install Zuul and Configure Your First Jobs][10]," and "[Spinnaker 101: Releasing Software with Velocity and Confidence][11]." (Note that space is limited in these workshops, so an RSVP system has been set up. You'll find an RSVP button on the session links provided here.)
Perhaps what I'm most excited about are the collaborative discussions, and these take up over half of the conference schedule. The topics were chosen by the program committee based on what we've been seeing in our communities. These are "fishbowl"-style sessions, where several people get in a room together to discuss a specific topic around CI/CD.
The idea for this style of session was taken from developer summits that the Ubuntu community pioneered and the OpenStack community continued. Topics for these collaborative discussions include separate sessions for CI and CD fundamentals, improvements that can be made to encourage cross-community collaboration, driving CI/CD culture in organizations, and why open source CI/CD tooling is so important. Shared documents are used to take notes during these sessions to make sure that as much knowledge shared during the session is retained as possible. It's also common for action items to come from these discussions, so community members can push forward initiatives related to the topic being covered.
The event concludes with a [Joint Conclusion Session][12], which will be summarizing the key points from the collaborative discussions and identifying work areas that attendees wish to work on in future.
Registration for this event is included in [OpenStack Summit registration][13], or tickets for this event only can be purchased for $199 onsite at the Vancouver Convention Center. Learn more about tickets and the full agenda on the [OpenDev website][1].
I hope you'll join us in Vancouver for an exciting two days of learning, collaborating and making progress together on CI/CD.
--------------------------------------------------------------------------------
via: https://opensource.com/article/18/5/opendev
作者:[Elizabeth K.Joseph][a]
选题:[lujun9972](https://github.com/lujun9972)
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://opensource.com/users/pleia2
[1]:http://2018.opendevconf.com/
[2]:https://about.gitlab.com/
[3]:https://jenkins.io/
[4]:https://www.spinnaker.io/
[5]:https://jfrog.com/artifactory/
[6]:http://2018.opendevconf.com/schedule/
[7]:https://zuul-ci.org/
[8]:http://aptomi.io/
[9]:https://www.openstack.org/summit/vancouver-2018/summit-schedule/events/21692/anomaly-detection-in-continuous-integration-jobs
[10]:https://www.openstack.org/summit/vancouver-2018/summit-schedule/events/21693/how-to-install-zuul-and-configure-your-first-jobs
[11]:https://www.openstack.org/summit/vancouver-2018/summit-schedule/events/21699/spinnaker-101-releasing-software-with-velocity-and-confidence
[12]:https://www.openstack.org/summit/vancouver-2018/summit-schedule/events/21831/opendev-cicd-joint-collab-conclusion
[13]:https://www.eventbrite.com/e/openstack-summit-may-2018-vancouver-tickets-40845826968?aff=VancouverSummit2018

View File

@ -1,123 +0,0 @@
HankChow translating
7 Python libraries for more maintainable code
======
![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/programming_keyboard_coding.png?itok=E0Vvam7A)
> Readability counts.
> — [The Zen of Python][1], Tim Peters
It's easy to let readability and coding standards fall by the wayside when a software project moves into "maintenance mode." (It's also easy to never establish those standards in the first place.) But maintaining consistent style and testing standards across a codebase is an important part of decreasing the maintenance burden, ensuring that future developers are able to quickly grok what's happening in a new-to-them project and safeguarding the health of the app over time.
### Check your code style
A great way to protect the future maintainability of a project is to use external libraries to check your code health for you. These are a few of our favorite libraries for [linting code][2] (checking for PEP 8 and other style errors), enforcing a consistent style, and ensuring acceptable test coverage as a project reaches maturity.
[PEP 8][3] is the Python code style guide, and it sets out rules for things like line length, indentation, multi-line expressions, and naming conventions. Your team might also have your own style rules that differ slightly from PEP 8. The goal of any code style guide is to enforce consistent standards across a codebase to make it more readable, and thus more maintainable. Here are three libraries to help prettify your code.
#### 1\. Pylint
[Pylint][4] is a library that checks for PEP 8 style violations and common errors. It integrates well with several popular [editors and IDEs][5] and can also be run from the command line.
To install, run `pip install pylint`.
To use Pylint from the command line, run `pylint [options] path/to/dir` or `pylint [options] path/to/module.py`. Pylint will output warnings about style violations and other errors to the console.
You can customize what errors Pylint checks for with a [configuration file][6] called `pylintrc`.
#### 2\. Flake8
[Flake8][7] is a "Python tool that glues together PEP8, Pyflakes (similar to Pylint), McCabe (code complexity checker), and third-party plugins to check the style and quality of some Python code."
To use Flake8, run `pip install flake8`. Then run `flake8 [options] path/to/dir` or `flake8 [options] path/to/module.py` to see its errors and warnings.
Like Pylint, Flake8 permits some customization for what it checks for with a [configuration file][8]. It has very clear docs, including some on useful [commit hooks][9] to automatically check your code as part of your development workflow.
Flake8 integrates with popular editors and IDEs, but those instructions generally aren't found in the docs. To integrate Flake8 with your favorite editor or IDE, search online for plugins (for example, [Flake8 plugin for Sublime Text][10]).
#### 3\. Isort
[Isort][11] is a library that sorts your imports alphabetically and breaks them up into [appropriate sections][12] (e.g., standard library imports, third-party library imports, imports from your own project, etc.). This increases readability and makes it easier to locate imports if you have a lot of them in your module.
Install isort with `pip install isort`, and run it with `isort path/to/module.py`. More configuration options are in the [documentation][13]. For example, you can [configure][14] how isort handles multi-line imports from one library in an `.isort.cfg` file.
Like Flake8 and Pylint, isort also provides plugins that integrate it with popular [editors and IDEs][15].
### Outsource your code style
Remembering to run linters manually from the command line for each file you change is a pain, and you might not like how a particular plugin behaves with your IDE. Also, your colleagues might prefer different linters or might not have plugins for their favorite editors, or you might be less meticulous about always running the linter and correcting the warnings. Over time, the codebase you all share will get messy and harder to read.
A great solution is to use a library that automatically reformats your code into something that passes PEP 8 for you. The three libraries we recommend all have different levels of customization and different defaults for how they format code. Some of these are more opinionated than others, so like with Pylint and Flake8, you'll want to test these out to see which offers the customizations you can't live without… and the unchangeable defaults you can live with.
#### 4\. Autopep8
[Autopep8][16] automatically formats the code in the module you specify. It will re-indent lines, fix indentation, remove extraneous whitespace, and refactor common comparison mistakes (like with booleans and `None`). See a full [list of corrections][17] in the docs.
To install, run `pip install --upgrade autopep8`. To reformat code in place, run `autopep8 --in-place --aggressive --aggressive <filename>`. The `aggressive` flags (and the number of them) indicate how much control you want to give autopep8 over your code style. Read more about [aggressive][18] options.
#### 5\. Yapf
[Yapf][19] is yet another option for reformatting code that comes with its own list of [configuration options][20]. It differs from autopep8 in that it doesn't just address PEP 8 violations. It also reformats code that doesn't violate PEP 8 specifically but isn't styled consistently or could be formatted better for readability.
To install, run `pip install yapf`. To reformat code, run, `yapf [options] path/to/dir` or `yapf [options] path/to/module.py`. There is also a full list of [customization options][20].
#### 6\. Black
[Black][21] is the new kid on the block for linters that reformat code in place. It's similar to autopep8 and Yapf, but way more opinionated. It has very few options for customization, which is kind of the point. The idea is that you shouldn't have to make decisions about code style; the only decision to make is to let Black decide for you. You can read about [limited customization options][22] and instructions on [storing them in a configuration file][23].
Black requires Python 3.6+ but can format Python 2 code. To use, run `pip install black`. To prettify your code, run: `black path/to/dir` or `black path/to/module.py`.
### Check your test coverage
You're writing tests, right? Then you will want to make sure new code committed to your codebase is tested and doesn't drop your overall amount of test coverage. While percentage of test coverage is not the only metric you should use to measure the effectiveness and sufficiency of your tests, it is one way to ensure basic testing standards are being followed in your project. For measuring test coverage, we have one recommendation: Coverage.
#### 7\. Coverage
[Coverage][24] has several options for the way it reports your test coverage to you, including outputting results to the console or to an HTML page and indicating which line numbers are missing test coverage. You can set up a [configuration file][25] to customize what Coverage checks for and make it easier to run.
To install, run `pip install coverage`. To run a program and see its output, run `coverage run [path/to/module.py] [args]`, and you will see your program's output. To see a report of which lines of code are missing coverage, run `coverage report -m`.
Continuous integration (CI) is a series of processes you can run to automatically check for linter errors and test coverage minimums before you merge and deploy code. There are lots of free or paid tools to automate this process, and a thorough walkthrough is beyond the scope of this article. But because setting up a CI process is an important step in removing blocks to more readable and maintainable code, you should investigate continuous integration tools in general; check out [Travis CI][26] and [Jenkins][27] in particular.
These are only a handful of the libraries available to check your Python code. If you have a favorite that's not on this list, please share it in the comments.
--------------------------------------------------------------------------------
via: https://opensource.com/article/18/7/7-python-libraries-more-maintainable-code
作者:[Jeff Triplett][a]
选题:[lujun9972](https://github.com/lujun9972)
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://opensource.com/users/laceynwilliams
[1]:https://www.python.org/dev/peps/pep-0020/
[2]:https://en.wikipedia.org/wiki/Lint_(software)
[3]:https://www.python.org/dev/peps/pep-0008/
[4]:https://www.pylint.org/
[5]:https://pylint.readthedocs.io/en/latest/user_guide/ide-integration.html
[6]:https://pylint.readthedocs.io/en/latest/user_guide/run.html#command-line-options
[7]:http://flake8.pycqa.org/en/latest/
[8]:http://flake8.pycqa.org/en/latest/user/configuration.html#configuration-locations
[9]:http://flake8.pycqa.org/en/latest/user/using-hooks.html
[10]:https://github.com/SublimeLinter/SublimeLinter-flake8
[11]:https://github.com/timothycrosley/isort
[12]:https://github.com/timothycrosley/isort#how-does-isort-work
[13]:https://github.com/timothycrosley/isort#using-isort
[14]:https://github.com/timothycrosley/isort#configuring-isort
[15]:https://github.com/timothycrosley/isort/wiki/isort-Plugins
[16]:https://github.com/hhatto/autopep8
[17]:https://github.com/hhatto/autopep8#id4
[18]:https://github.com/hhatto/autopep8#id5
[19]:https://github.com/google/yapf
[20]:https://github.com/google/yapf#usage
[21]:https://github.com/ambv/black
[22]:https://github.com/ambv/black#command-line-options
[23]:https://github.com/ambv/black#pyprojecttoml
[24]:https://coverage.readthedocs.io/en/latest/
[25]:https://coverage.readthedocs.io/en/latest/config.html
[26]:https://travis-ci.org/
[27]:https://jenkins.io/

View File

@ -1,3 +1,5 @@
translated by hopefully2333
Steam Makes it Easier to Play Windows Games on Linux
======
![Steam Wallpaper][1]

View File

@ -1,116 +0,0 @@
ucasFL translating
What is ZFS? Why People Use ZFS? [Explained for Beginners]
======
Today, we will take a look at ZFS, an advanced file system. We will discuss where it came from, what it is, and why it is so popular among techies and enterprise.
Even though Im from the US, I prefer to pronounce it ZedFS instead of ZeeFS because it sounds cooler. You are free to pronounce it however you like.
Note: You will see ZFS repeated many times in the article. When I talk about feature and installation, Im talking about OpenZFS. ZFS (developed by Oracle) and OpenZFS have followed different paths since Oracle shutdown OpenSolaris. (More on that later.)
### History of ZFS
The Z File System (ZFS) was created by [Matthew Ahrens and Jeff Bonwick][1] in 2001. ZFS was designed to be a next generation file system for [Sun Microsystems][2] [OpenSolaris][3]. In 2008, ZFS was ported to FreeBSD. The same year a project was started to port [ZFS to Linux][4]. However, since ZFS is licensed under the [Common Development and Distribution License][5], which is incompatible with the [GNU General Public License][6], it cannot be included in the Linux kernel. To get around this problem, most Linux distros offer methods to install ZFS.
Shortly after Oracle purchased Sun Microsystems, OpenSolaris became close-source. All further development of ZFS became closed source, as well. Many of the developers of ZFS where unhappy about this turn of events. [Two-thirds of the core ZFS devlopers][1], including Ahrens and Bonwick, left Oracle due to this decision. They joined other companies and created the [OpenZFS project][7] in September of 2013. The project has spearheaded the open-source development of ZFS.
Lets go back to the license issue mentioned above. Since the OpenZFS project is separate from Oracle, some probably wonder why they dont change the license to something that is compatible with the GPL so it can be included in the Linux kernel. According to the [OpenZFS website][8], changing the license would involve contacting anyone who contributed code to the current OpenZFS implementation (including the initial, common ZFS code till OpenSolaris) and get their permission to change the license. Since this job is near impossible (because some contributors may be dead or hard to find), they have decided to keep the license they have.
### What is ZFS? What are its features?
![ZFS filesystem][9]
As I said before, ZFS is an advanced file system. As such, it has some interesting [features][10]. Such as:
* Pooled storage
* Copy-on-write
* Snapshots
* Data integrity verification and automatic repair
* RAID-Z
* Maximum 16 Exabyte file size
* Maximum 256 Quadrillion Zettabytes storage
Lets break down a couple of those features.
#### Pooled Storage
Unlike most files systems, ZFS combines the features of a file system and a volume manager. This means that unlike other file systems, ZFS can create a file system that spans across a series of drives or a pool. Not only that but you can add storage to a pool by adding another drive. ZFS will handle [partitioning and formatting][11].
![Pooled storage in ZFS][12]Pooled storage in ZFS
#### Copy-on-write
[Copy-on-write][13] is another interesting (and cool) features. On most files system, when data is overwritten, it is lost forever. On ZFS, the new information is written to a different block. Once the write is complete, the file systems metadata is updated to point to the new info. This ensures that if the system crashes (or something else happens) while the write is taking place, the old data will be preserved. It also means that the system does not need to run [fsck][14] after a system crash.
#### Snapshots
Copy-on-write leads into another ZFS feature: snapshots. ZFS uses snapshots to track changes in the file system. “[The snapshot][13] contains the original version of the file system, and the live filesystem contains any changes made since the snapshot was taken. No additional space is used. As new data is written to the live file system, new blocks are allocated to store this data.” It a file is deleted, the snapshot reference is removed, as well. So, snapshots are mainly designed to track changes to files, but not the addition and creation of files.
Snapshots can be mounted as read-only to recover a past version of a file. It is also possible to rollback the live system to a previous snapshot. All changes made since the snapshot will be lost.
#### Data integrity verification and automatic repair
Whenever new data is written to ZFS, it creates a checksum for that data. When that data is read, the checksum is verified. If the checksum does not match, then ZFS knows that an error has been detected. ZFS will then automatically attempt to correct the error.
#### RAID-Z
ZFS can handle RAID without requiring any extra software or hardware. Unsurprisingly, ZFS has its own implementation of RAID: RAID-Z. RAID-Z is actually a variation of RAID-5. However, it is designed to overcome the RAID-5 write hole error, “in which the data and parity information become inconsistent after an unexpected restart”. To use the basic [level of RAID-Z][15] (RAID-Z1) you need at least two disks for storage and one for [parity][16]. RAID-Z2 required at least two storage drives and two drive for parity. RAID-Z3 requires at least two storage drives and three drive for parity. When drives are added to the RAID-Z pools, they have to be added in multiples of two.
#### Huge Storage potential
When ZFS was created, it was designed to be [the last word in file systems][17]. At a time when most file systems where 64-bit, the ZFS creators decided to jump right to 128-bit to future proof it. This means that ZFS “offers 16 billion billion times the capacity of 32- or 64-bit systems”. In fact, Jeff Bonwick (one of the creators) said [that powering][18] a “fully populating a 128-bit storage pool would, literally, require more energy than boiling the oceans.”
### How to Install ZFS?
If you want to use ZFS out of the box, it would require installing either [FreeBSD][19] or an [operating system using the illumos kernel][20]. [illumos][21] is a fork of the OpenSolaris kernel.
In fact, support for [ZFS is one of the main reasons why some experienced Linux users opt for BSD][22].
If you want to try ZFS on Linux, you can only use it at your storage file system. As a far as I know, no Linux distro give you the option to install ZFS on your root out of the box. If you are interested in trying ZFS on Linux, the [ZFS on Linux project][4] has a number of tutorials on how to do that.
### Caveat
This article has sung the benefits of ZFS. Now let me tell you a quick problem with ZFS. Using RAID-Z [can be expensive][23] because of the number of drives you need to purchase to add storage space.
Have you every ZFS? What was your experience like? Let us know in the comments below.
If you found this article interesting, please take a minute to share it on social media, Hacker News or [Reddit][24].
--------------------------------------------------------------------------------
via: https://itsfoss.com/what-is-zfs/
作者:[John Paul][a]
选题:[lujun9972](https://github.com/lujun9972)
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/john/
[1]: https://wiki.gentoo.org/wiki/ZFS
[2]: http://en.wikipedia.org/wiki/Sun_Microsystems
[3]: http://en.wikipedia.org/wiki/Opensolaris
[4]: https://zfsonlinux.org/
[5]: https://en.wikipedia.org/wiki/Common_Development_and_Distribution_License
[6]: https://en.wikipedia.org/wiki/GNU_General_Public_License
[7]: http://www.open-zfs.org/wiki/Main_Page
[8]: http://www.open-zfs.org/wiki/FAQ#Do_you_plan_to_release_OpenZFS_under_a_license_other_than_the_CDDL.3F
[9]: https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/09/what-is-zfs.png
[10]: https://wiki.archlinux.org/index.php/ZFS
[11]: https://www.howtogeek.com/175159/an-introduction-to-the-z-file-system-zfs-for-linux/
[12]: https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/09/zfs-overview.png
[13]: https://www.freebsd.org/doc/handbook/zfs-term.html
[14]: https://en.wikipedia.org/wiki/Fsck
[15]: https://wiki.archlinux.org/index.php/ZFS/Virtual_disks#Creating_and_Destroying_Zpools
[16]: https://www.pcmag.com/encyclopedia/term/60364/raid-parity
[17]: https://web.archive.org/web/20060428092023/http://www.sun.com/2004-0914/feature/
[18]: https://blogs.oracle.com/bonwick/128-bit-storage:-are-you-high
[19]: https://www.freebsd.org/
[20]: https://wiki.illumos.org/display/illumos/Distributions
[21]: https://wiki.illumos.org/display/illumos/illumos+Home
[22]: https://itsfoss.com/why-use-bsd/
[23]: http://louwrentius.com/the-hidden-cost-of-using-zfs-for-your-home-nas.html
[24]: http://reddit.com/r/linuxusersgroup

View File

@ -1,3 +1,5 @@
heguangzhi Translating
3 open source log aggregation tools
======
Log aggregation systems can help with troubleshooting and other tasks. Here are three top options.

View File

@ -1,3 +1,4 @@
translating by name1e5s
Know Your Storage: Block, File & Object
======

View File

@ -0,0 +1,52 @@
在OpenDev上掌握CI/CD(持续集成/持续发布)
======
![在OpenDev上掌握CI/CD](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/BUSINESS_opennature_3.png?itok=J1OSECM_)
在2017年启动后OpenDev会议现在是一个年度活动。在去年9月的首届活动上会议的重点是边缘计算。今年的活动将于5月22-23日举行会议的重点是持续集成和持续发布 (CI/CD)并将与OpenStack峰会一起在温哥华举行。
基于我在OpenStack项目的CI/CD系统的技术背景和近期进入容器下的CI/CD方面的经验我被邀请加入OpenDev CI/CD的编程委员会。今天我经常通过很多开源技术例如[Jenkins][3] [GitLab][2],[Spinnaker][4],和[Artifactory][5],来讨论CI/CD流水管线。
这次活动对我来说是很激动人心的因为我们将在这个活动中融合两个开源基础设施理念。首先我们将讨论可以被任何组织使用的CI/CD工具。为此目的在[keynotes][6],我们将听到关于开源CI/CD工具的使用讲座一场来自Boris Renski的关于Spinnaker的和一场来自Jim Blair的关于[Zuul][7]的。同时讲座会涉及关于开源技术的偏好的高级别话题特别是那种跨社区的和本身就是开源项目的。从Fatih Degirmenci和Daniel Farrel那里我们将听到关于在不同社区分享持续发布实践经历接着Benjamin Mako Hill会为我带来一场关于为什么免费软件需要免费工具的分享。
在分享CI/CD相对新颖特性后接下来的活动是对话研讨会和协作讨论的混合组合。当从所提交的讲座和研讨会选择并提出协作讨论主题时我们希望确保有一个多样灵活的日程表这样任何参与者都能在CI/CD活动进程中发现有趣的东西。
这些讲座会是标准的会议风格选择以涵盖关键主题如制作CI/CD管线在实践DevOps时提升安全性以及更具体的解决方案如基于容器关于Kubernetes的[Aptomi][8]和在ETSI NFV环境下CI/CD。这些会话的大部分将会是作为给新接触CI/CD或这些特定技术的参与者关于这些话题和理念的简介。
交互式的研讨会会持续相对比较长的时间,参与者将会在思想上得到特定的体验。这些研讨会包括"[Anomaly Detection in Continous Integration Jobs(在持续集成任务中的异常检测)][9]","[How to Install Zuul and Configure Your First Jobs(如何安装Zuul和配置第一个任务)][10]",和"[Spinnake 101: Releasing Software with Velocity and Confidence(Spinnake 101:快速可靠的软件发布)][11]."(注意这些研讨会空间是有限的所以设立了一个RSVP系统。你们将会在会议的链接里找到一个RSVP的按钮。)
可能最让我最兴奋的是协作讨论这些协作讨论占据了一半以上的活动安排。协作讨论的主题由编程委员会选取。编程委员会是根据我们在社区里所看到选取对应的主题。这是“鱼缸”风格式的会议通常是几个人聚在一个房间里围绕着CI/CD讨论某一个主题。
这次会议风格的理念是来自于开发者峰会最初是由Ubuntu社区提出接着OpenStack社区在活动上采纳。这些协作讨论的主题包含不同的会议这些会议是关于CI/CD基础可以鼓励跨社区协作的提升举措在组织里推行CI/CD文化和为什么开源CI/CD工具如此重要。采用共享文档来做会议笔记以确保尽可能的在会议的过程中分享知识。在讨论过程中提出行动项目也是很常见的因此社区成员可以推动和所涉及的主题相关的倡议。
活动将以联合总结会议结束。联合总结会议将总结来自协同讨论的关键点和为即将在这个领域工作的参与者指出可选的职业范围。
可以在[OpenStack Summit registration(OpenStack峰会注册)][13]上注册参加活动。或者可以在温哥华唯一指定售票的会议中心购买活动的入场券,价格是$199。更多关于票和全部的活动安排见官网[OpenDev website][1]。
我希望你们能够加入我们并在温哥华渡过令人激动的两天并且在这两天的活动中学习协作和在CI/CD取得进展。
--------------------------------------------------------------------------------
via: https://opensource.com/article/18/5/opendev
作者:[Elizabeth K.Joseph][a]
选题:[lujun9972](https://github.com/lujun9972)
译者:[jamelouis](https://github.com/jamelouis)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://opensource.com/users/pleia2
[1]:http://2018.opendevconf.com/
[2]:https://about.gitlab.com/
[3]:https://jenkins.io/
[4]:https://www.spinnaker.io/
[5]:https://jfrog.com/artifactory/
[6]:http://2018.opendevconf.com/schedule/
[7]:https://zuul-ci.org/
[8]:http://aptomi.io/
[9]:https://www.openstack.org/summit/vancouver-2018/summit-schedule/events/21692/anomaly-detection-in-continuous-integration-jobs
[10]:https://www.openstack.org/summit/vancouver-2018/summit-schedule/events/21693/how-to-install-zuul-and-configure-your-first-jobs
[11]:https://www.openstack.org/summit/vancouver-2018/summit-schedule/events/21699/spinnaker-101-releasing-software-with-velocity-and-confidence
[12]:https://www.openstack.org/summit/vancouver-2018/summit-schedule/events/21831/opendev-cicd-joint-collab-conclusion
[13]:https://www.eventbrite.com/e/openstack-summit-may-2018-vancouver-tickets-40845826968?aff=VancouverSummit2018

View File

@ -1,102 +1,98 @@
15 command-line aliases to save you time
15 个可以节省你时间的命令别名
======
![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/computer_keyboard_laptop_development_blue.png?itok=IfckxN48)
Linux command-line aliases are great for helping you work more efficiently. Better still, some are included by default in your installed Linux distro.
Linux 命令行别名非常适合帮助你提高工作效率。更好的是,有些 Linux 发行版中就默认包含一些别名。
This is an example of a command-line alias in Fedora 27:
这是 Fedora 27 中的命令别名的示例:
![](https://opensource.com/sites/default/files/uploads/default.png)
The command `alias` shows the list of existing aliases. Setting an alias is as simple as typing:
这个 `alias` 命令列出了已有的别名。设置别名也十分简单:
`alias new_name="command"`
Here are 15 command-line aliases that will save you time:
这里有 15 个命令行别名,可以节省你的时间:
1. To install any utility/application:
1. 安装任何应用实用 / 应用程序:
`alias install="sudo yum install -y"`
Here, `sudo` and `-y` are optional as per users preferences:
在这里, `sudo``-y` 是可选的,因为每个用户的偏好:
![install alias.png][2]
2. To update the system:
2. 更新系统:
`alias update="sudo yum update -y"`
3. To upgrade the system:
3. 升级系统:
`alias upgrade="sudo yum upgrade -y"`
4. To change to the root user:
4. 切换 root 用户:
`alias root="sudo su -"`
5. To change to "user," where "user" is set as your username:
5. 要更改"用户", 其中"user"设置为你的用户名:
`alias user="su user"`
6. To display the list of all available ports, their status, and IP:
6. 显示列出所有可用端口,状态还有 IP
`alias myip="ip -br -c a"`
7. To `ssh` to the server `myserver`:
7. `ssh`你的服务器`myserver`
`alias myserver="ssh user@my_server_ip”`
8. To list all processes in the system:
8. 列出系统中所有进程:
`alias process="ps -aux"`
9. To check the status of any system service:
9. 检查系统的服务状态:
`alias sstatus="sudo systemctl status"`
10. To restart any system service:
10. 重启系统服务在:
`alias srestart="sudo systemctl restart"`
11. To kill any process by its name:
11. 按名称杀死进程:
`alias kill="sudo pkill"`
![kill process alias.png][4]
12. To display the total used and free memory of the system:
12. 显示系统系统总使用内存和空闲内存
`alias mem="free -h"`
13. To display the CPU architecture, number of CPUs, threads, etc. of the system:
13. 显示系统 CPU 框架结构CPU 数量,线程数等:
`alias cpu="lscpu"`
14. To display the total disk size of the system:
14. 显示系统总磁盘大小:
`alias disk="df -h"`
15. To display the current system Linux distro (for CentOS, Fedora, and Red Hat):
15. 显示当前系统 Linux 发行版本(适用于 CentOS,Fedora 和 Red Hat)
`alias os="cat /etc/redhat-release"`
![system_details alias.png][6]
--------------------------------------------------------------------------------
via: https://opensource.com/article/18/8/time-saving-command-line-aliases
作者:[Aarchit Modi][a]
选题:[lujun9972](https://github.com/lujun9972)
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
译者:[MZqk](https://github.com/)
校对:[校对者 ID](https://github.com/ 校对者 ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux 中国](https://linux.cn/) 荣誉推出
[a]:https://opensource.com/users/architmodi
[2]:https://opensource.com/sites/default/files/uploads/install.png (install alias.png)

View File

@ -0,0 +1,120 @@
这 7 个 Python 库让你写出更易维护的代码
======
![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/programming_keyboard_coding.png?itok=E0Vvam7A)
> 可读性很重要。
> — [Python 之禅The Zen of Python][1], Tim Peters
尽管很多项目一开始的时候就有可读性和编码标准的要求,但随着项目进入“维护模式”,这些要求都会变得虎头蛇尾。然而,在代码库中保持一致的代码风格和测试标准能够显著减轻维护的压力,也能确保新的开发者能够快速了解项目的情况,同时能更好地保持应用程序的运行良好。
### 检查你的代码风格
使用外部库来检查代码运行情况不失为保护项目未来可维护性的一个好方法。以下会推荐一些我们最喜爱的[检查代码][2](包括检查 PEP 8 和其它代码风格错误)的库,用它们来强制保持代码风格一致,并确保在项目成熟时有一个可接受的测试覆盖率。
[PEP 8][3]是Python代码风格规范规定了行长度缩进多行表达式、变量命名约定等内容。尽管你的团队自身可能也会有不同于 PEP 8 的代码风格规范,但任何代码风格规范的目标都是在代码库中强制实施一致的标准,使代码的可读性更强、更易于维护。下面三个库就可以用来帮助你美化代码。
#### 1\. Pylint
[Pylint][4] 是一个检查违反 PEP 8 规范和常见错误的库。它在一些流行的编辑器和 IDE 中都有集成,也可以单独从命令行运行。
执行 `pip install pylint`安装 Pylint 。然后运行 `pylint [options] path/to/dir` 或者 `pylint [options] path/to/module.py` 就可以在命令行中使用 Pylint它会向控制台输出代码中违反规范和出现错误的地方。
你还可以使用 `pylintrc` [配置文件][6]来自定义 Pylint 对哪些代码错误进行检查。
#### 2\. Flake8
对 [Flake8][7] 的描述是“将 PEP 8、Pyflakes类似 Pylint、McCabe代码复杂性检查器、第三方插件整合到一起以检查 Python 代码风格和质量的一个 Python 工具”。
执行 `pip install flake8` 安装 flake8 ,然后执行 `flake8 [options] path/to/dir` 或者 `flake8 [options] path/to/module.py` 可以查看报出的错误和警告。
和 Pylint 类似Flake8 允许通过[配置文件][8]来自定义检查的内容。它有非常清晰的文档,包括一些有用的[提交钩子][9],可以将自动检查代码纳入到开发工作流程之中。
Flake8 也允许集成到一些流行的编辑器和 IDE 当中,但在文档中并没有详细说明。要将 Flake8 集成到喜欢的编辑器或 IDE 中,可以搜索插件(例如 [Sublime Text 的 Flake8 插件][10])。
#### 3\. Isort
[Isort][11] 这个库能将你在项目中导入的库按字母顺序,并将其[正确划分为不同部分][12](例如标准库、第三方库,自建的库等)。这样提高了代码的可读性,并且可以在导入的库较多的时候轻松找到各个库。
执行 `pip install isort` 安装 isort然后执行 `isort path/to/module.py` 就可以运行了。文档中还提供了更多的配置项,例如通过配置 `.isort.cfg` 文件来决定 isort 如何处理一个库的多行导入。
和 Flake8、Pylint 一样isort 也提供了将其与流行的[编辑器和 IDE][15] 集成的插件。
### 共享代码风格
每次文件发生变动之后都用命令行手动检查代码是一件痛苦的事,你可能也不太喜欢通过运行 IDE 中某个插件来实现这个功能。同样地,你的同事可能会用不同的代码检查方式,也许他们的编辑器中也没有安装插件,甚至自己可能也不会严格检查代码和按照警告来更正代码。总之,你共享的代码库将会逐渐地变得混乱且难以阅读。
一个很好的解决方案是使用一个库,自动将代码按照 PEP 8 规范进行格式化。我们推荐的三个库都有不同的自定义级别来控制如何格式化代码。其中有一些设置较为特殊,例如 Pylint 和 Flake8 ,你需要先行测试,看看是否有你无法忍受蛋有不能修改的默认配置。
#### 4\. Autopep8
[Autopep8][16] 可以自动格式化指定的模块中的代码,包括重新缩进行,修复缩进,删除多余的空格,并重构常见的比较错误(例如布尔值和 `None` 值)。你可以查看文档中完整的[更正列表][17]。
运行 `pip install --upgrade autopep8` 安装 autopep8。然后执行 `autopep8 --in-place --aggressive --aggressive <filename>` 就可以重新格式化你的代码。`aggressive` 标记的数量表示 auotopep8 在代码风格控制上有多少控制权。在这里可以详细了解 [aggressive][18] 选项。
#### 5\. Yapf
[Yapf][19] 是另一种有自己的[配置项][20]列表的重新格式化代码的工具。它与 autopep8 的不同之处在于它不仅会指出代码中违反 PEP 8 规范的地方,还会对没有违反 PEP 8 但代码风格不一致的地方重新格式化,旨在令代码的可读性更强。
执行`pip install yapf` 安装 Yapf然后执行 `yapf [options] path/to/dir``yapf [options] path/to/module.py` 可以对代码重新格式化。
#### 6\. Black
[Black][21] 在代码检查工具当中算是比较新的一个。它与 autopep8 和 Yapf 类似,但限制较多,没有太多的自定义选项。这样的好处是你不需要去决定使用怎么样的代码风格,让 black 来给你做决定就好。你可以在这里查阅 black 的[自定义选项][22]以及[如何在配置文件中对其进行设置][23]。
Black 依赖于 Python 3.6+,但它可以格式化用 Python 2 编写的代码。执行 `pip install black` 安装 black然后执行 `black path/to/dir``black path/to/module.py` 就可以使用 black 优化你的代码。
### 检查你的测试覆盖率
如果你正在进行测试工作,你需要确保提交到代码库的新代码都已经测试通过,并且不会降低测试覆盖率。虽然测试覆盖率不是衡量测试有效性和充分性的唯一指标,但它是确保项目遵循基本测试标准的一种方法。对于计算测试覆盖率,我们推荐使用 Coverage 这个库。
#### 7\. Coverage
[Coverage][24] 有数种显示测试覆盖率的方式,包括将结果输出到控制台或 HTML 页面,并指出哪些具体哪些地方没有被覆盖到。你可以通过配置文件自定义 Coverage 检查的内容,让你更方便使用。
执行 `pip install coverage` 安装 Converage 。然后执行 `coverage [path/to/module.py] [args]` 可以运行程序并查看输出结果。如果要查看哪些代码行没有被覆盖,执行 `coverage report -m` 即可。
持续集成Continuous integration, CI是在合并和部署代码之前自动检查代码风格错误和测试覆盖率最小值的过程。很多免费或付费的工具都可以用于执行这项工作具体的过程不在本文中赘述但 CI 过程是令代码更易读和更易维护的重要步骤,关于这一部分可以参考 [Travis CI][26] 和 [Jenkins][27]。
以上这些只是用于检查 Python 代码的各种工具中的其中几个。如果你有其它喜爱的工具,欢迎在评论中分享。
--------------------------------------------------------------------------------
via: https://opensource.com/article/18/7/7-python-libraries-more-maintainable-code
作者:[Jeff Triplett][a]
选题:[lujun9972](https://github.com/lujun9972)
译者:[HankChow](https://github.com/HankChow)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://opensource.com/users/laceynwilliams
[1]:https://www.python.org/dev/peps/pep-0020/
[2]:https://en.wikipedia.org/wiki/Lint_(software)
[3]:https://www.python.org/dev/peps/pep-0008/
[4]:https://www.pylint.org/
[5]:https://pylint.readthedocs.io/en/latest/user_guide/ide-integration.html
[6]:https://pylint.readthedocs.io/en/latest/user_guide/run.html#command-line-options
[7]:http://flake8.pycqa.org/en/latest/
[8]:http://flake8.pycqa.org/en/latest/user/configuration.html#configuration-locations
[9]:http://flake8.pycqa.org/en/latest/user/using-hooks.html
[10]:https://github.com/SublimeLinter/SublimeLinter-flake8
[11]:https://github.com/timothycrosley/isort
[12]:https://github.com/timothycrosley/isort#how-does-isort-work
[13]:https://github.com/timothycrosley/isort#using-isort
[14]:https://github.com/timothycrosley/isort#configuring-isort
[15]:https://github.com/timothycrosley/isort/wiki/isort-Plugins
[16]:https://github.com/hhatto/autopep8
[17]:https://github.com/hhatto/autopep8#id4
[18]:https://github.com/hhatto/autopep8#id5
[19]:https://github.com/google/yapf
[20]:https://github.com/google/yapf#usage
[21]:https://github.com/ambv/black
[22]:https://github.com/ambv/black#command-line-options
[23]:https://github.com/ambv/black#pyprojecttoml
[24]:https://coverage.readthedocs.io/en/latest/
[25]:https://coverage.readthedocs.io/en/latest/config.html
[26]:https://travis-ci.org/
[27]:https://jenkins.io/

View File

@ -0,0 +1,116 @@
初学者指南ZFS 是什么,为什么要使用 ZFS
======
![ZFS filesystem][9]
今天,我们来谈论一下 ZFS一个高级文件系统。我们将讨论 ZFS 从何而来,它是什么,以及为什么它在科技界和企业界如此受欢迎。
虽然我是一个美国人,但我更喜欢读成 ZedFS 而不是 ZeeFS因为前者听起来更酷一些。你可以根据你的个人喜好来发音。
注意:在这篇文章中,你将会看到很多次 ZFS。当我在谈论特性和安装的时候我所指的是 OpenZFS 。自从 Oracle 公司放弃 OpenSolaris 项目之后ZFS由 Oracle 公司开发)和 OpenZFS 已经走向了不同的发展道路。
### ZFS 的历史
Z 文件系统ZFS是在 2001 年由 [Matthew Ahrens 和 Jeff Bonwick][1] 开发的。ZFS 是作为 Sun 公司的[<ruby>微系统<rt>MicroSystem</rt></ruby>][2] [OpenSolaris][3] 的下一代文件系统而设计的。在 2008 年ZFS 被移植到了 FreeBSD 。同一年,一个新的项目也开始了:[ZFS to Linux][4] 。然而,由于 ZFS 是[通用开发和发布许可证CDDL][5]许可的,它和 [GNU 通用公共许可证][6] 不兼容,因此不能将它迁移到 Linux 内核中。为了解决这个问题,绝大多数 Linux 发行版提供了一些方法来安装 ZFS 
在 Oracle 公司收购 Sun 公司之后不久,微系统 OpenSolaris 就闭源了,这使得 ZFS 的最新开发也闭源了。许多 ZFS 开发者对这件事情非常不开心。[三分之二的 ZFS 核心开发者][1],包括 Ahrens 和 Bonwick因为这个决定而离开了 Oracle 公司。他们加入其他公司,并于 2013 年 9 月创立了 [OpenZFS][7] 这一项目。该项目引领着 ZFS 的开源开发。
让我们回到上面提到的许可证问题上。既然 OpenZFS 项目已经和 Oracle 公司分离开了,有人可能好奇他们为什么不使用和 GPL 兼容的许可证,这样就可以把它加入到 Linux 内核中了。根据 [OpenZFS 官网][8] 的介绍,更改许可证需要联系所有为当前 OpenZFS 实现贡献过代码的人(包括初始公共 ZFS 代码以及 OpenSolaris 代码),并得到他们的许可才行。这几乎是不可能的(因为一些贡献者可能已经去世了或者很难找到),因此他们决定保留原来的许可证。
### ZFS 是什么,它有什么特性?
正如前面所说过的ZFS 是一个高级文件系统。因此,它有一些有趣的[特性][10]。比如:
* 存储池
* 写时拷贝
* 快照
* 数据完整性验证和自动修复
* RAID-Z
* 最大单个文件大小为 16 EB1 EB = 1024 PB
* 最大 256 万亿的四次方 ZB1 ZB = 1024 EB的存储
让我们来深入了解一下其中一些特性。
#### 存储池
与大多数文件系统不同ZFS 结合了文件系统和卷管理器的特性。这意味着它与其他文件系统不同ZFS 可以创建跨域一系列硬盘或池的文件系统。不仅如此你还可以通过添加硬盘来增大池的存储容量。ZFS 可以进行[分区和格式化][11]。
![Pooled storage in ZFS][12]
*ZFS 存储池*
#### 写时拷贝
[<ruby>写时拷贝<rt>Copy-on-write</rt></ruby>][13]是另一个有趣并且很酷的特性。在大多数文件系统上,当数据被重写时,它将永久丢失。而在 ZFS 中新数据会写到不同的块。写完成之后更新文件系统元数据信息使之指向新的数据块LCTT 译注:更新之后,原数据块成为磁盘上的垃圾,需要有对应的垃圾回收机制)。这确保了如果在写新数据的时候系统崩溃(或者发生其它事,比如突然断电),那么原数据将会保存下来。这也意味着,在系统发生崩溃之后,不需要运行 [fsck][14] 来检查和修复文件系统。
#### 快照
写时拷贝使得 ZFS 有了另一个特性:<ruby>快照<rt>snapshots</rt></ruby>。ZFS 使用快照来跟踪文件系统中的更改。[快照][13]包含文件系统的原始版本(文件系统的一个只读版本),实时文件系统则包含了自从快照创建之后的任何更改。没有使用额外的空间。因为新数据将会写到实时文件系统新分配的块上。如果一个文件被删除了,那么它在快照中的索引也会被删除。所以,快照主要是用来跟踪文件的更改,而不是文件的增加和创建。
快照可以挂载成只读的,以用来恢复一个文件的过去版本。实时系统也可以回滚到之前的快照。回滚之后,自从快照创建之后的所有更改将会丢失。
#### 数据完整性验证和自动修复
当向 ZFS 写入新数据时会创建该数据的校验和。在读取数据的时候使用校验和进行验证。如果前后校验和不匹配那么就说明检测到了错误然后ZFS 会尝试自动修正错误。
#### RAID-Z
ZFS 不需要任何额外软件或硬件就可以处理 RAID磁盘阵列。毫无奇怪因为 ZFS 有自己的 RAID 实现RAID-Z 。RAID-Z 是 RAID-5 的一个变种,不过它克服了 RAID-5 的写漏洞意外重启之后数据和校验信息会变得不同步LCTT 译注RAID-5 的 stripe 在正写数据时如果这时候电源中断那么奇偶校验数据将跟该部分数据不同步因此前边的写无效RAID-Z 用了 “variable-width RAID stripes” 技术,因此所有的写都是 full-stripe writes。为了使用基本级别的 [RAID-Z][15]RAID-Z1你需要至少三块磁盘其中两块用来存储数据另外一块用来存储[奇偶校验信息][16]。而RAID-Z2 需要至少两块磁盘存储数据以及两块磁盘存储校验信息。RAID-Z3 需要至少两块磁盘存储数据以及三块磁盘存储校验信息。另外,只能向 RAID-Z 池中加入偶数倍的磁盘,而不能是奇数倍的。
#### 巨大的存储潜力
创建 ZFS 的时候,它就被设计成了[最后一个文件系统][17] 。那时候,大多数文件系统都是 64 位的ZFS 的创建者决定直接跳到 128 位,等到将来再来证明这是对的。这意味着 ZFS 的容量大小是 32 位或 64 位文件系统的 160 亿亿倍。事实上Jeff Bonwick其中一个创建者“完全填满一个 128 位的存储池所需要的[能量][18],从字面上讲,比煮沸海洋需要的还多。”
### 如何安装 ZFS
如果你想立刻使用 ZFS开箱即用那么你需要安装 [FreeBSD][19] 或一个[使用 illumos 内核的操作系统][20]。[illumos][21] 是 OpenSolaris 内核的一个克隆版本。
事实上,支持 [ZFS 是一些有经验的 Linux 用户选择 BSD 的主要原因][22]。
如果你想在 Linux 上尝试 ZFS那么只能在存储文件系统上使用。据我所知没有任何 Linux 发行版可以在根目录上安装 ZFS实现开箱即用。如果你对在 Linux 上尝试 ZFS 感兴趣,那么 [ZFS on Linux 项目][4] 上有大量的教程可以指导你怎么做。
### 附加说明
这篇文章论述了 ZFS 的优点。现在,让我来告诉你一个关于 ZFS 很现实的问题。使用 RAID-Z [会很贵][23],因为你需要购买大量的磁盘来增大存储空间。
你已经使用过 ZFS 了吗?你的使用经验是什么样的?请在下面的评论中告诉我们。
如果你觉得这篇文章有趣,请花一分钟的时间把它分享到社交媒体、极客新闻或 [Reddit][24] 。
--------------------------------------------------------------------------------
via: https://itsfoss.com/what-is-zfs/
作者:[John Paul][a]
选题:[lujun9972](https://github.com/lujun9972)
译者:[ucasFL](https://github.com/ucasFL)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/john/
[1]: https://wiki.gentoo.org/wiki/ZFS
[2]: http://en.wikipedia.org/wiki/Sun_Microsystems
[3]: http://en.wikipedia.org/wiki/Opensolaris
[4]: https://zfsonlinux.org/
[5]: https://en.wikipedia.org/wiki/Common_Development_and_Distribution_License
[6]: https://en.wikipedia.org/wiki/GNU_General_Public_License
[7]: http://www.open-zfs.org/wiki/Main_Page
[8]: http://www.open-zfs.org/wiki/FAQ#Do_you_plan_to_release_OpenZFS_under_a_license_other_than_the_CDDL.3F
[9]: https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/09/what-is-zfs.png
[10]: https://wiki.archlinux.org/index.php/ZFS
[11]: https://www.howtogeek.com/175159/an-introduction-to-the-z-file-system-zfs-for-linux/
[12]: https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/09/zfs-overview.png
[13]: https://www.freebsd.org/doc/handbook/zfs-term.html
[14]: https://en.wikipedia.org/wiki/Fsck
[15]: https://wiki.archlinux.org/index.php/ZFS/Virtual_disks#Creating_and_Destroying_Zpools
[16]: https://www.pcmag.com/encyclopedia/term/60364/raid-parity
[17]: https://web.archive.org/web/20060428092023/http://www.sun.com/2004-0914/feature/
[18]: https://blogs.oracle.com/bonwick/128-bit-storage:-are-you-high
[19]: https://www.freebsd.org/
[20]: https://wiki.illumos.org/display/illumos/Distributions
[21]: https://wiki.illumos.org/display/illumos/illumos+Home
[22]: https://itsfoss.com/why-use-bsd/
[23]: http://louwrentius.com/the-hidden-cost-of-using-zfs-for-your-home-nas.html
[24]: http://reddit.com/r/linuxusersgroup