Ceph入门到精通-ceph 源码编译

这篇具有很好参考价值的文章主要介绍了Ceph入门到精通-ceph 源码编译。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

Ceph - a scalable distributed storage system

Please see https://ceph.com/ for current info.

Contributing Code

Most of Ceph is dual licensed under the LGPL version 2.1 or 3.0. Some miscellaneous code is under a BSD-style license or is public domain. The documentation is licensed under Creative Commons Attribution Share Alike 3.0 (CC-BY-SA-3.0). There are a handful of headers included here that are licensed under the GPL. Please see the file COPYING for a full inventory of licenses by file.

Code contributions must include a valid "Signed-off-by" acknowledging the license for the modified or contributed file. Please see the file SubmittingPatches.rst for details on what that means and on how to generate and submit patches.

We do not require assignment of copyright to contribute code; code is contributed under the terms of the applicable license.

Checking out the source

You can clone from github with

git clone git@github.com:ceph/ceph

or, if you are not a github user,

git clone https://github.com/ceph/ceph.git

Ceph contains many git submodules that need to be checked out with

git submodule update --init --recursive

Build Prerequisites

The list of Debian or RPM packages dependencies can be installed with:

./install-deps.sh

Building Ceph

Note that these instructions are meant for developers who are compiling the code for development and testing. To build binaries suitable for installation we recommend you build deb or rpm packages or refer to the ceph.spec.in or debian/rules to see which configuration options are specified for production builds.

Build instructions:

./do_cmake.sh
cd build
ninja

(do_cmake.sh now defaults to creating a debug build of ceph that can be up to 5x slower with some workloads. Please pass "-DCMAKE_BUILD_TYPE=RelWithDebInfo" to do_cmake.sh to create a non-debug release.

The number of jobs used by ninja is derived from the number of CPU cores of the building host if unspecified. Use the -j option to limit the job number if the build jobs are running out of memory. On average, each job takes around 2.5GiB memory.)

This assumes you make your build dir a subdirectory of the ceph.git checkout. If you put it elsewhere, just point CEPH_GIT_DIR to the correct path to the checkout. Any additional CMake args can be specified by setting ARGS before invoking do_cmake. See cmake options for more details. Eg.

ARGS="-DCMAKE_C_COMPILER=gcc-7" ./do_cmake.sh

To build only certain targets use:

ninja [target name]

To install:

ninja install

CMake Options

If you run the cmake command by hand, there are many options you can set with "-D". For example, the option to build the RADOS Gateway is defaulted to ON. To build without the RADOS Gateway:

cmake -DWITH_RADOSGW=OFF [path to top-level ceph directory]

Another example below is building with debugging and alternate locations for a couple of external dependencies:

cmake -DLEVELDB_PREFIX="/opt/hyperleveldb" \
-DCMAKE_INSTALL_PREFIX=/opt/ceph -DCMAKE_C_FLAGS="-Og -g3 -gdwarf-4" \
..

Ceph has several bundled dependencies such as Boost, RocksDB and Arrow. By default, cmake will build these bundled dependencies from source instead of using libraries that are already installed on the system. You can opt-in to using these system libraries, provided they meet the minimum version required by Ceph, with cmake options like WITH_SYSTEM_BOOST:

cmake -DWITH_SYSTEM_BOOST=ON [...]

To view an exhaustive list of -D options, you can invoke cmake with:

cmake -LH

If you often pipe ninja to less and would like to maintain the diagnostic colors for errors and warnings (and if your compiler supports it), you can invoke cmake with:

cmake -DDIAGNOSTICS_COLOR=always ...

Then you'll get the diagnostic colors when you execute:

ninja | less -R

Other available values for 'DIAGNOSTICS_COLOR' are 'auto' (default) and 'never'.

Building a source tarball

To build a complete source tarball with everything needed to build from source and/or build a (deb or rpm) package, run

./make-dist

This will create a tarball like ceph-$version.tar.bz2 from git. (Ensure that any changes you want to include in your working directory are committed to git.)

Running a test cluster

To run a functional test cluster,

cd build
ninja vstart        # builds just enough to run vstart
../src/vstart.sh --debug --new -x --localhost --bluestore
./bin/ceph -s

Almost all of the usual commands are available in the bin/ directory. For example,

./bin/rados -p rbd bench 30 write
./bin/rbd create foo --size 1000

To shut down the test cluster,

../src/stop.sh

To start or stop individual daemons, the sysvinit script can be used:

./bin/init-ceph restart osd.0
./bin/init-ceph stop

Running unit tests

To build and run all tests (in parallel using all processors), use ctest:

cd build
ninja
ctest -j$(nproc)

(Note: Many targets built from src/test are not run using ctest. Targets starting with "unittest" are run in ninja check and thus can be run with ctest. Targets starting with "ceph_test" can not, and should be run by hand.)

When failures occur, look in build/Testing/Temporary for logs.

To build and run all tests and their dependencies without other unnecessary targets in Ceph:

cd build
ninja check -j$(nproc)

To run an individual test manually, run ctest with -R (regex matching):

ctest -R [regex matching test name(s)]

(Note: ctest does not build the test it's running or the dependencies needed to run it)

To run an individual test manually and see all the tests output, run ctest with the -V (verbose) flag:

ctest -V -R [regex matching test name(s)]

To run tests manually and run the jobs in parallel, run ctest with the -j flag:

ctest -j [number of jobs]

There are many other flags you can give ctest for better control over manual test execution. To view these options run:

man ctest

Building the Documentation

Prerequisites

The list of package dependencies for building the documentation can be found in doc_deps.deb.txt:

sudo apt-get install `cat doc_deps.deb.txt`

Building the Documentation

To build the documentation, ensure that you are in the top-level /ceph directory, and execute the build script. For example:

admin/build-doc

Reporting Issues

To report an issue and view existing issues, please visit Overview - Ceph - Ceph.文章来源地址https://www.toymoban.com/news/detail-660071.html

到了这里,关于Ceph入门到精通-ceph 源码编译的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • Ceph入门到精通-Ceph PG状态详细介绍(全)

    本文主要介绍PG的各个状态,以及ceph故障过程中PG状态的转变。 Ceph is still creating the placement group. Ceph 仍在创建PG。 activating The placement group is peered but not yet active. PG已经互联,但是还没有active。 active Ceph will process requests to the placement group. Ceph 可处理到此PG的请求。 clean Ceph re

    2024年02月14日
    浏览(28)
  • Ceph入门到精通-ceph故障处理 - osd down处理

    发现osd掉之后,我们首先要确认是哪个主机的哪块盘,来判断是这个盘坏了还是什么原因 来看一下是哪两块 登录对应机器确认下是哪块盘 2.我们发现盘还在,首先尝试能否重启ceph-osd服务 ,这里已经拉起来了 3.如果重启无望或者盘漂移,重新卸载安装 3.1 看看日志 是不是有

    2024年02月01日
    浏览(27)
  • Ceph入门到精通-podman 入门实战

    目录 podman安装 podman制作本地镜像 podman(docker)命令回顾 podman快速入门 一入编程深似海,从此节操是路人。 最近使用podman,就想着写一篇总结性的笔记,以备后续参考。就如同写代码,不写注释,过了一段时间可能会想这是我写的吗?不会吧,还要理一下逻辑才能读懂,不利

    2023年04月24日
    浏览(32)
  • Ceph入门到精通-sysctl参数优化

    sysctl.conf  是一个文件,通常用于在 Linux 操作系统中配置内核参数。这些参数可以控制网络、文件系统、内存管理等各方面的行为。 99-xx.yml  可能是一个文件名,其中  99-  是一个特定的命名约定。在  sysctl.conf  文件中,通常会有一个特定的顺序来加载配置项。通常,以 

    2024年02月10日
    浏览(27)
  • Ceph入门到精通-创建存储桶通知

    在存储桶级别创建存储桶通知。这些需要 与发送存储桶通知的目标一起发布。桶 通知是 S3 操作。 父主题: 存储桶管理 运行 IBM Storage Ceph 集群,带有 Ceph Object Gateway。 正在运行的 HTTP 服务器、RabbitMQ 服务器或 Kafka 服务器。 根级访问。 用户访问密钥和私有密钥。 终结点参数

    2024年02月15日
    浏览(62)
  • Ceph入门到精通-LVS基础知识

    LB集群:    (Load  Balancing)即负载均衡集群,其目的是为了提高访问的并发量及提升服务器的性能,其    实现方式分为硬件方式和软件方式。   硬件实现方式:         常用的有 F5公司的BIG-IP系列、A10公司的AX系列、Citrix公司的 NetScaler系列等   软件实现方式:   

    2024年02月11日
    浏览(27)
  • Ceph入门到精通-OSD waring 设置建议

    以下检查表明 OSD 节点存在问题。 1 在 /var/lib/ceph/osd 中找到的多个ceph_fsid值。 这可能意味着您正在托管许多集群的 OSD 此节点或某些 OSD 配置错误以加入 您期望的集群。 2 设置可能会导致数据丢失,因为如果 未达到最小值,Ceph 将不会确认对客户端的写入。 osd pool default 

    2024年02月11日
    浏览(38)
  • Ceph入门到精通-更换osd、扩容osd

    1. 1 查看故障盘osd id 1.2 销毁osd 1.3 更换故障硬盘 1.4 查看新硬盘盘符 1.5 擦除新硬盘 1.6 预备替换原osd 1.7 查看osd fsid 1.8 激活osd 3.1 停止所有osd服务 3.2 销毁所有osd 3.3 擦除磁盘数据 3.4 清除crush数据 3.5 删除osd应用 4. 调整PG

    2024年02月19日
    浏览(32)
  • Ceph入门到精通-Nginx超时参数分析设置

    nginx中有些超时设置,本文汇总了nginx中几个超时设置 Nginx 中的超时设置包括: “client_body_timeout”:设置客户端向服务器发送请求体的超时时间,单位为秒。 “client_header_timeout”:设置客户端向服务器发送请求头的超时时间,单位为秒。 “send_timeout”:设置服务器向客户端

    2024年02月07日
    浏览(32)
  • Ceph入门到精通-Nginx 大量请求 延迟优化

    优化nginx以处理大量请求并减少延迟可以通过以下几种方法实现: 调整worker_processes和worker_connections参数:增加worker_processes值可以增加nginx的进程数量,提高并发处理能力。增加worker_connections参数的值可以增加每个worker进程可处理的连接数,从而在请求高峰期更好地分配负载。

    2024年02月10日
    浏览(25)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包