Compilation and deployment of ceph luminous version

1, ceph L version code
Download github, omit
2, Change file

For the comment line, add the following:
#cmake -DBOOST_J=$(nproc) $ARGS "$@" ..
cmake -DCMAKE_C_FLAGS="-O0 -g3 -gdwarf-4" -DCMAKE_CXX_FLAGS="-O0 -g3 -gdwarf-4" -DBOOST_J=$(nproc) $ARGS "$@" ..

Interpretation of the above modifications:

CMAKE_C_FLAGS = "- O0 -g3 -gdwarf-4": c language compilation configuration
 CMAKE_CXX_FLAGS = "- O0 -g3 -gdwarf-4": c + + compilation configuration
 -O0: turn off compiler optimization. If not, when using GDB tracker, most variables are optimized and cannot be displayed. The production environment must be turned off
 -g3: means a lot of debugging information will be generated
 -Gdwarf-4: dwarf is a debugging format, and the version of dwarf-4 is 4

3, script,

This step will create a directory called build and enter the build directory. You can see the Makefile file to facilitate the next make compilation.

Many errors should be reported in this step, which can be solved one by one:
About the following rpm packages and their dependencies need to be installed:

yum install python-sphinx nss-devel  lttng-ust-devel babeltrace libbabeltrace-devel libibverbs python3 python3-devel python-Cython  python3*-Cython  gperftools gperftools-devel  gperf
Tips: Install here python3-devel There will be conflicts when you uninstall python-devel,Waiting for installation python3-devel After installation python-devel That's right;
rpm -e python-devel
yum install python-devel

1. pthread_create problem
This problem has been fixed for a long time
/Home / CEPH luminous / build / cmakefiles / cmaketmp / checksymbolexists. C: 8: for 'pthread'_ Undefined reference to create '

yum install python-sphinx
Some bloggers say that it can be solved by upgrading the version of cmake, but the problems still exist after upgrading.
2. nss related

yum install nss-devel
3.LTTngUST related

yum install lttng-ust-devel

yum install babeltrace
yum install libbabeltrace-devel


yum install libibverbs

6.liblua related
The problem has also been fixed for a long time.

Forget how,
It seems to be using In the script, execute git submodule update --init --recursive to install the relevant source package? (because I commented out this line for convenience)

Compiled environment dependent packages?
[root@ceph1 ceph-luminous]# rpm -qa | grep lua

[root@ceph1 ceph-luminous]# ls src/lua/
cmake  CMakeLists.txt  doc  etc  Makefile  src

7. Python 3libs problem

yum install yum
install python3-devel python3-devel

tips: uninstall rpm-e Python devel, install python3 devel, and then install Python devel
8. Python problem


yum install python-Cython,Actually installed:

yum install python3*-Cython,Actually installed:

9.gperf problem:

Yum install gperftools gperftools devel (69 dependent packages)
yum install gperf
10.sclo problem

yum install centos-release-scl

Do now_ complete
4, Compile and install

Execute cmake. - LH to see what compilation options ceph has, and select according to your own needs



Execute make – j8 to compile the source code

Execute make install to compile and install the source code

5, Check ceph version, prettytable problem

yum install python-prettytable

6, Start deployment

1. Time synchronization:

[root@ceph-node1 ~]# yum install -y ntp ntpdate ntp-doc
[root@ceph-node2 ~]# yum install -y ntp ntpdate ntp-doc
[root@ceph-node3 ~]# yum install -y ntp ntpdate ntp-doc

[root@ceph-node1 ~]# ntpdate
31 Jul 03:43:04 ntpdate[973]: adjust time server offset 0.001528 sec
[root@ceph-node1 ~]# hwclock 
Tue 31 Jul 2018 03:44:55 AM EDT  -0.302897 seconds
[root@ceph-node1 ~]# crontab -e
*/5 * * * * /usr/sbin/ntpdate

2. No key access between nodes and configuration of / etc/hosts and hostname
3. Initialization configuration of mon

ceph-deploy new ceph1 ceph2 ceph3 --public-network= --cluster-network=
ceph-deploy --overwrite-conf mon create-initial

Question 1:
Error: Failed to execute command: systemctl enable (the problem will be handled for a long time)

After setting setenforce 0

After the source code is installed, no target and service files are generated under / usr/lib/systemd/system /

[root@ceph2 ceph-luminous]# pwd
cp systemd/ceph*.target  /usr/lib/systemd/system/
cp systemd/ceph*.service  /usr/lib/systemd/system/
cp systemd/ceph  /usr/lib/systemd/system/

Question 2:
No ceph user issues


Add ceph users and modify permissions
adduser -d /home/easystack/ -m ceph
 vim /etc/passwd / / change to 0

Question 3:
This is because the name and hostname of / etc/hosts are inconsistent (or conflict).

After correct modification:

Execute CEPH deploy admin ceph1 ceph2 ceph3 to push the key to the corresponding location (mainly ceph.client.admin.keyring should be placed under / etc/ceph /)
So far, mon initialization succeeded

4. mgr deployment
no active mgr is a manager added after version J. at this time, you need to open this function module:

Just create the mgr directory manually: mkdir -p /var/lib/ceph/mgr


5. osd deployment

//Here, the effect is the same when prepare is changed to create
ceph-deploy osd prepare  --bluestore  --block-wal /dev/vde1 --block-db /dev/vde2 ceph1:/dev/vdb  
ceph-deploy osd activate ceph1:/dev/vdb1

After deployment, the structure relationship among block wal, block dB and block (take osd.0 as an example):

After the deployment is successful, "health" appears_ WARN application not enabled on 1 pool(s)”,refs:

It is used to mark the created storage pool:
use 'ceph osd pool application enable <pool-name> <app-name>', where <app-name> is 'cephfs', 'rbd', 'rgw', or freeform for custom applications.
ceph osd pool application enable dpool rbd

a. Simplify the behavior of pools by allowing senior management tools to easily identify their use cases. For example, the new Ceph dashboard (the upcoming blog) currently uses a set of heuristics to guess whether to use pools for RBD workloads. Pool tags avoid cumbersome and error prone processes.
b. Prevent applications from using pools that are not properly marked for use by them. For example, the rbd CLI can warn or prevent image creation in a pool with an RGW label.

6. End
The final deployment is completed, and the renderings are as follows:

Deployment script:

Reference link:

Keywords: Programming Ceph yum Python RPM

Added by boblang on Tue, 23 Jun 2020 12:57:04 +0300