검색

이 콘텐츠는 선택한 언어로 제공되지 않습니다.

4.10. Data Journaling

download PDF
Ordinarily, GFS writes only metadata to its journal. File contents are subsequently written to disk by the kernel's periodic sync that flushes file system buffers. An fsync() call on a file causes the file's data to be written to disk immediately. The call returns when the disk reports that all data is safely written.
Data journaling can result in a reduced fsync() time, especially for small files, because the file data is written to the journal in addition to the metadata. An fsync() returns as soon as the data is written to the journal, which can be substantially faster than the time it takes to write the file data to the main file system.
Applications that rely on fsync() to sync file data may see improved performance by using data journaling. Data journaling can be enabled automatically for any GFS files created in a flagged directory (and all its subdirectories). Existing files with zero length can also have data journaling turned on or off.
Using the gfs_tool command, data journaling is enabled on a directory (and all its subdirectories) or on a zero-length file by setting the inherit_jdata or jdata attribute flags to the directory or file, respectively. The directory and file attribute flags can also be cleared.

Usage

Setting and Clearing the inherit_jdata Flag
gfs_tool setflag inherit_jdata Directory
gfs_tool clearflag inherit_jdata Directory
Setting and Clearing the jdata Flag
gfs_tool setflag jdata File
gfs_tool clearflag jdata File
Directory
Specifies the directory where the flag is set or cleared.
File
Specifies the zero-length file where the flag is set or cleared.

Examples

This example shows setting the inherit_jdata flag on a directory. All files created in the directory or any of its subdirectories will have the jdata flag assigned automatically. Any data written to the files will be journaled. This example also shows the gfs_tool stat command you can use to verify what flags are set for a directory; the output has been elided to show only the relevant information.
[root@tng3-1]# gfs_tool setflag inherit_jdata /mnt/gfs/data
[root@tng3-1]# gfs_tool stat /mnt/gfs/data
...
Flags:
  inherit_jdata
This example shows setting the jdata flag on a file. The file must have a size of zero when you set this flag. Any data written to the file will be journaled. This example also shows the gfs_tool stat command you can use to verify what flags are set for a file; the output has been elided to show only the relevant information.
[root@tng3-1]# gfs_tool setflag jdata /mnt/gfs/datafile
[root@tng3-1]# gfs_tool stat /mnt/gfs/datafile
...
Flags:
  jdata
Red Hat logoGithubRedditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

© 2024 Red Hat, Inc.