{"id":177,"date":"2019-03-28T06:33:16","date_gmt":"2019-03-28T06:33:16","guid":{"rendered":"http:\/\/cephswift.com\/?page_id=177"},"modified":"2019-04-16T20:26:06","modified_gmt":"2019-04-16T20:26:06","slug":"examples-of-build-ceph-deb-pkgs-from-source-code-and-install","status":"publish","type":"page","link":"https:\/\/cephswift.com\/index.php\/examples-of-build-ceph-deb-pkgs-from-source-code-and-install\/","title":{"rendered":"Examples of build ceph *.deb pkgs from source code and install"},"content":{"rendered":"<p>Examples of build ceph *.deb pkgs from source code and install:<\/p>\n<p>OS: Ubuntu 16.04<\/p>\n<p>Ceph Version: ceph version 13.0.2-1994-gc335bc1 (c335bc16a4d8083fa1d7bfad51195e380934f635) mimic (dev) ( ### from myself build )<\/p>\n<p>benlu@ubuntu_build_05: ( on this build server, run build as regular user benlu)<\/p>\n<p>$ mkdir ceph<br \/>\n$ cd ceph<br \/>\n$ pwd<\/p>\n<p>benlu@ubuntu_build_05:~\/ceph$ pwd<br \/>\n\/home\/benlu\/ceph<\/p>\n<p>$ git clone https:\/\/github.com\/ceph\/ceph.git<br \/>\n$ ls -ltr<br \/>\n$ cd ceph<br \/>\n$ git describe &#8211;tags<br \/>\n$ ls -ltr<br \/>\n$ .\/install-deps.sh<br \/>\n$ ls -l<br \/>\n$ .\/do_cmake.sh<br \/>\n$ ls -ltr<br \/>\n$ .\/make-debs.sh<br \/>\n\u2026..<br \/>\ndh_builddeb -O&#8211;buildsystem=cmake -O&#8211;parallel<br \/>\ndpkg-deb &#8211;build debian\/ceph ..<br \/>\ndpkg-deb: building package &#8216;ceph&#8217; in &#8216;..\/ceph_13.0.2-1994-gc335bc1-1_amd64.deb&#8217;.<br \/>\ndpkg-deb &#8211;build debian\/ceph-base ..<br \/>\ndpkg-deb: building package &#8216;ceph-base&#8217; in &#8216;..\/ceph-base_13.0.2-1994-gc335bc1-1_amd64.deb&#8217;.<br \/>\ndpkg-deb &#8211;build debian\/ceph-mds ..<br \/>\ndpkg-deb: building package &#8216;ceph-mds&#8217; in &#8216;..\/ceph-mds_13.0.2-1994-gc335bc1-1_amd64.deb&#8217;.<br \/>\ndpkg-deb &#8211;build debian\/ceph-mgr ..<br \/>\ndpkg-deb: building package &#8216;ceph-mgr&#8217; in &#8216;..\/ceph-mgr_13.0.2-1994-gc335bc1-1_amd64.deb&#8217;.<br \/>\ndpkg-deb &#8211;build debian\/ceph-mon ..<br \/>\ndpkg-deb: building package &#8216;ceph-mon&#8217; in &#8216;..\/ceph-mon_13.0.2-1994-gc335bc1-1_amd64.deb&#8217;.<br \/>\ndpkg-deb &#8211;build debian\/ceph-osd ..<br \/>\ndpkg-deb: building package &#8216;ceph-osd&#8217; in &#8216;..\/ceph-osd_13.0.2-1994-gc335bc1-1_amd64.deb&#8217;.<br \/>\ndpkg-deb &#8211;build debian\/ceph-fuse ..<br \/>\ndpkg-deb: building package &#8216;ceph-fuse&#8217; in &#8216;..\/ceph-fuse_13.0.2-1994-gc335bc1-1_amd64.deb&#8217;.<br \/>\ndpkg-deb &#8211;build debian\/rbd-fuse ..<br \/>\ndpkg-deb: building package &#8216;rbd-fuse&#8217; in &#8216;..\/rbd-fuse_13.0.2-1994-gc335bc1-1_amd64.deb&#8217;.<br \/>\ndpkg-deb &#8211;build debian\/rbd-mirror ..<br \/>\ndpkg-deb: building package &#8216;rbd-mirror&#8217; in &#8216;..\/rbd-mirror_13.0.2-1994-gc335bc1-1_amd64.deb&#8217;.<br \/>\ndpkg-deb &#8211;build debian\/rbd-nbd ..<br \/>\ndpkg-deb: building package &#8216;rbd-nbd&#8217; in &#8216;..\/rbd-nbd_13.0.2-1994-gc335bc1-1_amd64.deb&#8217;.<br \/>\ndpkg-deb &#8211;build debian\/ceph-common ..<br \/>\ndpkg-deb: building package &#8216;ceph-common&#8217; in &#8216;..\/ceph-common_13.0.2-1994-gc335bc1-1_amd64.deb&#8217;.<br \/>\ndpkg-deb &#8211;build debian\/ceph-resource-agents ..<br \/>\ndpkg-deb: building package &#8216;ceph-resource-agents&#8217; in &#8216;..\/ceph-resource-agents_13.0.2-1994-gc335bc1-1_amd64.deb&#8217;.<br \/>\ndpkg-deb &#8211;build debian\/librados2 ..<br \/>\ndpkg-deb: building package &#8216;librados2&#8217; in &#8216;..\/librados2_13.0.2-1994-gc335bc1-1_amd64.deb&#8217;.<br \/>\ndpkg-deb &#8211;build debian\/librados-dev ..<br \/>\ndpkg-deb: building package &#8216;librados-dev&#8217; in &#8216;..\/librados-dev_13.0.2-1994-gc335bc1-1_amd64.deb&#8217;.<br \/>\ndpkg-deb &#8211;build debian\/libradosstriper1 ..<br \/>\ndpkg-deb: building package &#8216;libradosstriper1&#8217; in &#8216;..\/libradosstriper1_13.0.2-1994-gc335bc1-1_amd64.deb&#8217;.<br \/>\ndpkg-deb &#8211;build debian\/libradosstriper-dev ..<br \/>\ndpkg-deb: building package &#8216;libradosstriper-dev&#8217; in &#8216;..\/libradosstriper-dev_13.0.2-1994-gc335bc1-1_amd64.deb&#8217;.<br \/>\ndpkg-deb &#8211;build debian\/librbd1 ..<br \/>\ndpkg-deb: building package &#8216;librbd1&#8217; in &#8216;..\/librbd1_13.0.2-1994-gc335bc1-1_amd64.deb&#8217;.<br \/>\ndpkg-deb &#8211;build debian\/librbd-dev ..<br \/>\ndpkg-deb: building package &#8216;librbd-dev&#8217; in &#8216;..\/librbd-dev_13.0.2-1994-gc335bc1-1_amd64.deb&#8217;.<br \/>\ndpkg-deb &#8211;build debian\/libcephfs2 ..<br \/>\ndpkg-deb: building package &#8216;libcephfs2&#8217; in &#8216;..\/libcephfs2_13.0.2-1994-gc335bc1-1_amd64.deb&#8217;.<br \/>\ndpkg-deb &#8211;build debian\/libcephfs-dev ..<br \/>\ndpkg-deb: building package &#8216;libcephfs-dev&#8217; in &#8216;..\/libcephfs-dev_13.0.2-1994-gc335bc1-1_amd64.deb&#8217;.<br \/>\ndpkg-deb &#8211;build debian\/librgw2 ..<br \/>\ndpkg-deb: building package &#8216;librgw2&#8217; in &#8216;..\/librgw2_13.0.2-1994-gc335bc1-1_amd64.deb&#8217;.<br \/>\ndpkg-deb &#8211;build debian\/librgw-dev ..<br \/>\ndpkg-deb: building package &#8216;librgw-dev&#8217; in &#8216;..\/librgw-dev_13.0.2-1994-gc335bc1-1_amd64.deb&#8217;.<br \/>\ndpkg-deb &#8211;build debian\/radosgw ..<br \/>\ndpkg-deb: building package &#8216;radosgw&#8217; in &#8216;..\/radosgw_13.0.2-1994-gc335bc1-1_amd64.deb&#8217;.<br \/>\ndpkg-deb &#8211;build debian\/ceph-test ..<br \/>\ndpkg-deb: building package &#8216;ceph-test&#8217; in &#8216;..\/ceph-test_13.0.2-1994-gc335bc1-1_amd64.deb&#8217;.<br \/>\ndpkg-deb &#8211;build debian\/python-ceph ..<br \/>\ndpkg-deb: building package &#8216;python-ceph&#8217; in &#8216;..\/python-ceph_13.0.2-1994-gc335bc1-1_amd64.deb&#8217;.<br \/>\ndpkg-deb &#8211;build debian\/python-rados ..<br \/>\ndpkg-deb: building package &#8216;python-rados&#8217; in &#8216;..\/python-rados_13.0.2-1994-gc335bc1-1_amd64.deb&#8217;.<br \/>\ndpkg-deb &#8211;build debian\/python3-rados ..<br \/>\ndpkg-deb: building package &#8216;python3-rados&#8217; in &#8216;..\/python3-rados_13.0.2-1994-gc335bc1-1_amd64.deb&#8217;.<br \/>\ndpkg-deb &#8211;build debian\/python-rbd ..<br \/>\ndpkg-deb: building package &#8216;python-rbd&#8217; in &#8216;..\/python-rbd_13.0.2-1994-gc335bc1-1_amd64.deb&#8217;.<br \/>\ndpkg-deb &#8211;build debian\/python3-rbd ..<br \/>\ndpkg-deb: building package &#8216;python3-rbd&#8217; in &#8216;..\/python3-rbd_13.0.2-1994-gc335bc1-1_amd64.deb&#8217;.<br \/>\ndpkg-deb &#8211;build debian\/python-rgw ..<br \/>\ndpkg-deb: building package &#8216;python-rgw&#8217; in &#8216;..\/python-rgw_13.0.2-1994-gc335bc1-1_amd64.deb&#8217;.<br \/>\ndpkg-deb &#8211;build debian\/python3-rgw ..<br \/>\ndpkg-deb: building package &#8216;python3-rgw&#8217; in &#8216;..\/python3-rgw_13.0.2-1994-gc335bc1-1_amd64.deb&#8217;.<br \/>\ndpkg-deb &#8211;build debian\/python-cephfs ..<br \/>\ndpkg-deb: building package &#8216;python-cephfs&#8217; in &#8216;..\/python-cephfs_13.0.2-1994-gc335bc1-1_amd64.deb&#8217;.<br \/>\ndpkg-deb &#8211;build debian\/python3-cephfs ..<br \/>\ndpkg-deb: building package &#8216;python3-cephfs&#8217; in &#8216;..\/python3-cephfs_13.0.2-1994-gc335bc1-1_amd64.deb&#8217;.<br \/>\ndpkg-deb &#8211;build debian\/python3-ceph-argparse ..<br \/>\ndpkg-deb: building package &#8216;python3-ceph-argparse&#8217; in &#8216;..\/python3-ceph-argparse_13.0.2-1994-gc335bc1-1_amd64.deb&#8217;.<br \/>\ndpkg-deb &#8211;build debian\/libcephfs-java ..<br \/>\ndpkg-deb: building package &#8216;libcephfs-java&#8217; in &#8216;..\/libcephfs-java_13.0.2-1994-gc335bc1-1_all.deb&#8217;.<br \/>\ndpkg-deb &#8211;build debian\/libcephfs-jni ..<br \/>\ndpkg-deb: building package &#8216;libcephfs-jni&#8217; in &#8216;..\/libcephfs-jni_13.0.2-1994-gc335bc1-1_amd64.deb&#8217;.<br \/>\ndpkg-deb &#8211;build debian\/rados-objclass-dev ..<br \/>\ndpkg-deb: building package &#8216;rados-objclass-dev&#8217; in &#8216;..\/rados-objclass-dev_13.0.2-1994-gc335bc1-1_amd64.deb&#8217;.<br \/>\ndpkg-genchanges &gt;..\/ceph_13.0.2-1994-gc335bc1-1_amd64.changes<br \/>\ndpkg-genchanges: including full source code in upload<br \/>\ndpkg-source &#8211;after-build ceph-13.0.2-1994-gc335bc1<br \/>\ndpkg-buildpackage: full upload; Debian-native package (full source is included)<br \/>\n+ cd ..\/..<br \/>\n+ mkdir -p xenial\/conf<br \/>\n+ cat<br \/>\n++ dpkg &#8211;print-architecture<br \/>\n+ &#8216;[&#8216; &#8216;!&#8217; -e conf &#8216;]&#8217;<br \/>\n+ ln -s xenial\/conf conf<br \/>\n++ pwd<br \/>\n+ reprepro &#8211;basedir \/tmp\/release\/Ubuntu include xenial WORKDIR\/ceph_13.0.2-1994-gc335bc1-1_amd64.changes<br \/>\n.\/make-debs.sh: line 87: reprepro: command not found<\/p>\n<p>benlu@ubuntu_build_05:~\/ceph$ find \/ -name &#8220;*.deb&#8221;<br \/>\n\u2026\u2026<\/p>\n<p>benlu@ubuntu_build_05:~\/ceph$ ls -l \/var\/cache\/apt\/archives\/*.deb &gt; deb_pkg_location<\/p>\n<p>benlu@ubuntu_build_05:~\/ceph$ ls -l \/tmp\/release\/Ubuntu\/WORKDIR\/*.deb &gt;&gt; deb_pkg_location<\/p>\n<p>$ mkdir all_generated_deb_pkgs<\/p>\n<p>$ cp \/tmp\/release\/Ubuntu\/WORKDIR\/*.deb \/home\/benlu\/ceph\/all_generated_deb_pkgs<\/p>\n<p>$ tar -czvf \/tmp\/all_generated_deb_pkgs.tar.gz \/home\/benlu\/ceph\/all_generated_deb_pkgs<\/p>\n<p>$ sudo tar -czvf \/tmp\/usr.tar.gz \/usr<\/p>\n<p>$ scp \/tmp\/*tar.gz benlu@192.168.56.102:~\/ceph\/<\/p>\n<p>$ ssh benlu@192.168.56.102<\/p>\n<p>$ cd ceph<\/p>\n<p>$ tar -xzvf all_generated_deb_pkgs.tar.gz<\/p>\n<p>$ cd all_generated_deb_pkgs<\/p>\n<p>$ ls -l | grep .deb | awk &#8216;{print $9}&#8217; | xargs sudo dpkg -i ## this is to install all pkgs into new hosts<\/p>\n<p>### verify installed pkgs:<\/p>\n<p>$ benlu@ceph-admin:~\/ceph$ dpkg -l | grep ceph | awk &#8216;{print $2, $3, $4}&#8217;<br \/>\nceph 13.0.2-1994-gc335bc1-1 amd64<br \/>\nceph-base 13.0.2-1994-gc335bc1-1 amd64<br \/>\nceph-common 13.0.2-1994-gc335bc1-1 amd64<br \/>\nceph-fuse 13.0.2-1994-gc335bc1-1 amd64<br \/>\nceph-mds 13.0.2-1994-gc335bc1-1 amd64<br \/>\nceph-mgr 13.0.2-1994-gc335bc1-1 amd64<br \/>\nceph-mon 13.0.2-1994-gc335bc1-1 amd64<br \/>\nceph-osd 13.0.2-1994-gc335bc1-1 amd64<br \/>\nceph-resource-agents 13.0.2-1994-gc335bc1-1 amd64<br \/>\nceph-test 13.0.2-1994-gc335bc1-1 amd64<br \/>\nlibcephfs-dev 13.0.2-1994-gc335bc1-1 amd64<br \/>\nlibcephfs-java 13.0.2-1994-gc335bc1-1 all<br \/>\nlibcephfs-jni 13.0.2-1994-gc335bc1-1 amd64<br \/>\nlibcephfs2 13.0.2-1994-gc335bc1-1 amd64<br \/>\npython-ceph 13.0.2-1994-gc335bc1-1 amd64<br \/>\npython-cephfs 13.0.2-1994-gc335bc1-1 amd64<br \/>\npython3-cephfs 13.0.2-1994-gc335bc1-1 amd64<br \/>\nbenlu@ceph-admin:~\/ceph$<\/p>\n<p>benlu@ceph-admin:~\/ceph$ which ceph<br \/>\n\/usr\/bin\/ceph<\/p>\n<p>$ ceph \u2013-version ( compains with errors )<\/p>\n<p>untar \/usr\/* from build server to cover depends missing<\/p>\n<p>$ sudo cp \/home\/benlu\/ceph\/usr.tar.gz \/<br \/>\n$ ls -ltr \/<br \/>\n$ cd \/<br \/>\n$ sudo tar -xzvf usr.tar.gz<\/p>\n<p>benlu@ceph-admin:~\/ceph$ ceph &#8211;version<br \/>\nceph version 13.0.2-1994-gc335bc1 (c335bc16a4d8083fa1d7bfad51195e380934f635) mimic (dev)<br \/>\nbenlu@ceph-admin:~\/ceph$<\/p>\n<p>Now is good to go for next step: Config CEPH !!!!<\/p>\n<p>===========================================================<\/p>\n<p>## Below arm64 dpkg build and install was tested sucessfully on ubuntu18.04 arm64 server image in AWS:<\/p>\n<p>sudo apt-get update<br \/>\nsudo apt-get install build-essential chrpath libssl-dev libxft-dev libfreetype6 libfreetype6-dev libfontconfig1 libfontconfig1-dev phantomjs<br \/>\nsudo apt autoremove<br \/>\nsudo dpkg &#8211;add-architecture arm64<br \/>\ndebuild &#8212; clean<br \/>\nsudo pbuilder &#8211;update<\/p>\n<p>## start to build<\/p>\n<p>mkdir ~\/ceph_build<br \/>\ncd ~\/ceph_build<br \/>\nwget http:\/\/download.ceph.com\/tarballs\/ceph_13.2.5.orig.tar.gz<br \/>\ntar -xzvf ceph_13.2.5.orig.tar.gz<br \/>\nrm -f ceph_13.2.5.orig.tar.gz<br \/>\ncd ceph-13.2.5<br \/>\nsudo dpkg-buildpackage<\/p>\n<p>## the build above will fail for many pkgs missing, run missing pkgs install as below:<\/p>\n<p>sudo apt install cython3 dh-exec dh-python dh-systemd gperf javahelper jq libaio-dev libbabeltrace-ctf-dev libbabeltrace-dev libblkid-dev libcunit1-dev libcurl4-openssl-dev libfuse-dev libgoogle-perftools-dev libkeyutils-dev libldap2-dev libleveldb-dev liblttng-ust-dev liblz4-dev libnss3-dev liboath-dev libsnappy-dev libudev-dev python-cherrypy3 python-nose python-pecan python-bcrypt python-tox python-coverage python-prettytable python-werkzeug python3-all-dev socat uuid-dev valgrind xfslibs-dev xmlstarlet<\/p>\n<p>## run dpkg build again:<\/p>\n<p>sudo dpkg-buildpackage<\/p>\n<p>## if everything runing through, it will build all arm64 ceph dpkgs for version: ceph-13.2.5-1 in one dir up at ..\/ceph_build\/<\/p>\n<p>mkdir \/tmp\/arm64.deb_all_build_pkgs<br \/>\ncd ..\/ceph_build\/<\/p>\n<p>scp *.deb \/tmp\/arm64.deb_all_build_pkgs\/ ## this is copy all build pkgs over to \/tmp\/arm64.deb_all_build_pkgs\/<\/p>\n<p>scp \/var\/cache\/apt\/archives\/*.deb \/tmp\/arm64.deb_all_build_pkgs\/ ## this is copy all build deps dpkgs to \/tmp\/arm64.deb_all_build_pkgs\/<\/p>\n<p>ls -l \/tmp\/arm64.deb_all_build_pkgs\/*.deb | wc -l<\/p>\n<p>cd \/tmp\/arm64.deb_all_build_pkgs\/<\/p>\n<p>tar czvf ceph_13.2.5-1_build_out.tar.gz *.deb ## this is to create the tar.gz file which include all dpkgs for install on other node<\/p>\n<p>## fresh installation steps on other ubuntu18.04 node<\/p>\n<p>sudo apt update &amp;&amp; sudo apt upgrade<br \/>\ntar -xzvf ceph_13.2.5-1_build_out.tar.gz<br \/>\nrm -f ceph_13.2.5-1_build_out.tar.gz<br \/>\nls -l | grep .deb | awk &#8216;{print $9}&#8217; | xargs sudo dpkg -i<\/p>\n<p>## you may need to run two commands below to clean up system to have above &#8220;dpkg -i&#8221; pass<br \/>\nsudo apt autoremove<br \/>\nsudo apt &#8211;fix-broken install<\/p>\n<p>## verify, system will give output as below<\/p>\n<p>$ which ceph<br \/>\n\/usr\/bin\/ceph<br \/>\n$ ceph &#8211;version<br \/>\nceph version 13.2.5 (cbff874f9007f1869bfd3821b7e33b2a6ffd4988) mimic (stable)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Examples of build ceph *.deb pkgs from source code and install: OS: Ubuntu 16.04 Ceph Version: ceph version 13.0.2-1994-gc335bc1 (c335bc16a4d8083fa1d7bfad51195e380934f635) mimic (dev) ( ### from myself build ) benlu@ubuntu_build_05: ( on this build server, run build as regular user benlu) $ mkdir ceph $ cd ceph $ pwd benlu@ubuntu_build_05:~\/ceph$ pwd \/home\/benlu\/ceph $ git clone https:\/\/github.com\/ceph\/ceph.git [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"_links":{"self":[{"href":"https:\/\/cephswift.com\/index.php\/wp-json\/wp\/v2\/pages\/177"}],"collection":[{"href":"https:\/\/cephswift.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/cephswift.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/cephswift.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cephswift.com\/index.php\/wp-json\/wp\/v2\/comments?post=177"}],"version-history":[{"count":5,"href":"https:\/\/cephswift.com\/index.php\/wp-json\/wp\/v2\/pages\/177\/revisions"}],"predecessor-version":[{"id":250,"href":"https:\/\/cephswift.com\/index.php\/wp-json\/wp\/v2\/pages\/177\/revisions\/250"}],"wp:attachment":[{"href":"https:\/\/cephswift.com\/index.php\/wp-json\/wp\/v2\/media?parent=177"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}