首页 > 网络 > 云计算 >

世界杯外围投注官网

2016-10-19

准备一台ubuntu机器,物理机虚拟机都行,但应该物理机好一点,在编译的时候可以使用多线程加速。

准备

准备一台ubuntu机器,物理机虚拟机都行,但应该物理机好一点,在编译的时候可以使用多线程加速。

第一种方式是在Github上下载源码

git clone git@github.com:ceph/ceph

这样下载源码不会下载Ceph的子模块,这样编译的时候会出现问题。
运行以下命令来安装这些子模块:

git submodule update --init --recursive

不知道为啥我电脑用git下载不了源码,所以这个方法自己没有亲身实践。

第二种方式是在官网下载源码

http://ceph.com/resources/downloads/

官网有个好处就是会将所有子模块一并下载下来,免除掉些许麻烦。

这次我编译的是Ceph-10.2.2版本。

安装依赖

现在Ceph都会自带install-deps.sh来安装所需要的依赖包。
如果出现问题,手动装也是能解决问题的。

sudo apt-get install autotools-dev autoconf automake cdbs gcc g++ git libboost-dev libedit-dev libssl-dev libtool libfcgi libfcgi-dev libfuse-dev linux-kernel-headers libcrypto++-dev libcrypto++ libexpat1-dev pkg-config

若是之后过程中提示缺少什么包,手动安装就好了。

编译方法

在Github上或者自带文档上面都能看到编译方法,也很简单,就这三步,照着做就好了。

./autogen.sh
./configure
make

make的时候可以使用多线程来加速make -j4,可以把4换成你CPU的核数,这样会快些。

编译成功

若是前面一切顺利的话,运行完就成功了。可以进入到编译的目录下去,开始运行测试集群:

root@cci-test3:~/blog/ceph-10.2.2/src/世界杯外围投注官网:MON=1 MDS=0 ./vstart.sh -d -n -x
......
root@cci-test3:~/blog/ceph-10.2.2/src/世界杯外围投注官网:./ceph -s
*** DEVELOPER MODE: setting PATH, PYTHONPATH and LD_LIBRARY_PATH ***
    cluster 05f0dc34-4a98-498a-9e89-06decaba704c
     health HEALTH_OK
     monmap e1: 1 mons at {a=192.168.138.95:6789/0}
            election epoch 2, quorum 0 a
     osdmap e9: 3 osds: 3 up, 3 in
      pgmap v2689: 8 pgs, 1 pools, 0 bytes data, 0 objects
            54178 MB used, 48713 MB / 105 GB avail
                   8 active+clean
root@cci-test3:~/blog/ceph-10.2.2/src/世界杯外围投注官网

调试集群已经启动成功,可以使用命令停止集群

./stop.sh

接下来就可以更改世界杯外围投注网站了,修改世界杯外围投注网站后可以重新编译,然后启动集群。查看编译后的集群。

osd目录:~/ceph-10.2.2/src/dev/
log目录:~/ceph-10.2.2/src/out/

打包

Ubuntu下使用dpkg工具打包

sudo apt-get install dpkg-dev
dpkg-checkbuilddeps        世界杯外围投注官网 make sure we have all dependencies
dpkg-buildpackage

要是不出问题的话,慢慢等着就可以了,打包的过程不比编译的过程慢,我这里会先生成一个.dsc文件和源码的tar包,可以上官网看这个.dsc文件干嘛的,我也没去关心了。
最后面打包的结果如下,很多个deb包:

-rw-r--r-- 1 root root     16828 Oct 12 18:34 ceph_10.2.2-1_amd64.changes
-rw-r--r-- 1 root root    999078 Oct 12 17:26 ceph_10.2.2-1_amd64.deb
-rw-r--r-- 1 root root      3744 Oct 12 14:55 ceph_10.2.2-1.dsc
-rw-r--r-- 1 root root  66488177 Oct 12 14:55 ceph_10.2.2-1.tar.gz
-rw-r--r-- 1 root root  53079646 Oct 12 17:27 ceph-base_10.2.2-1_amd64.deb
-rw-r--r-- 1 root root  12683536 Oct 12 17:37 ceph-common_10.2.2-1_amd64.deb
-rw-r--r-- 1 root root 222737196 Oct 12 17:43 ceph-common-dbg_10.2.2-1_amd64.deb
-rw-r--r-- 1 root root   1020478 Oct 12 17:43 ceph-fs-common_10.2.2-1_amd64.deb
-rw-r--r-- 1 root root   1059938 Oct 12 17:43 ceph-fs-common-dbg_10.2.2-1_amd64.deb
-rw-r--r-- 1 root root   2724794 Oct 12 17:34 ceph-fuse_10.2.2-1_amd64.deb
-rw-r--r-- 1 root root  22472260 Oct 12 17:35 ceph-fuse-dbg_10.2.2-1_amd64.deb
-rw-r--r-- 1 root root   3592278 Oct 12 17:27 ceph-mds_10.2.2-1_amd64.deb
-rw-r--r-- 1 root root  46224612 Oct 12 17:29 ceph-mds-dbg_10.2.2-1_amd64.deb
-rw-r--r-- 1 root root   3584964 Oct 12 17:29 ceph-mon_10.2.2-1_amd64.deb
-rw-r--r-- 1 root root  34673086 Oct 12 17:30 ceph-mon-dbg_10.2.2-1_amd64.deb
-rw-r--r-- 1 root root  11109806 Oct 12 17:30 ceph-osd_10.2.2-1_amd64.deb
-rw-r--r-- 1 root root 133049658 Oct 12 17:34 ceph-osd-dbg_10.2.2-1_amd64.deb
-rw-r--r-- 1 root root   1002504 Oct 12 17:43 ceph-resource-agents_10.2.2-1_amd64.deb
-rw-r--r-- 1 root root  49574642 Oct 12 18:06 ceph-test_10.2.2-1_amd64.deb
-rw-r--r-- 1 root root 820225398 Oct 12 18:33 ceph-test-dbg_10.2.2-1_amd64.deb
-rw-r--r-- 1 root root   2744238 Oct 12 17:56 libcephfs1_10.2.2-1_amd64.deb
-rw-r--r-- 1 root root  25308900 Oct 12 17:57 libcephfs1-dbg_10.2.2-1_amd64.deb
-rw-r--r-- 1 root root  42413010 Oct 12 17:59 libcephfs-dev_10.2.2-1_amd64.deb
-rw-r--r-- 1 root root   1008236 Oct 12 17:20 libcephfs-java_10.2.2-1_all.deb
-rw-r--r-- 1 root root  20372124 Oct 12 18:33 libcephfs-jni_10.2.2-1_amd64.deb
-rw-r--r-- 1 root root   2648758 Oct 12 17:44 librados2_10.2.2-1_amd64.deb
-rw-r--r-- 1 root root  24035854 Oct 12 17:44 librados2-dbg_10.2.2-1_amd64.deb
-rw-r--r-- 1 root root  43558908 Oct 12 17:47 librados-dev_10.2.2-1_amd64.deb
-rw-r--r-- 1 root root   2723438 Oct 12 17:47 libradosstriper1_10.2.2-1_amd64.deb
-rw-r--r-- 1 root root  23395404 Oct 12 17:47 libradosstriper1-dbg_10.2.2-1_amd64.deb
-rw-r--r-- 1 root root  38782538 Oct 12 17:50 libradosstriper-dev_10.2.2-1_amd64.deb
-rw-r--r-- 1 root root   3099136 Oct 12 17:50 librbd1_10.2.2-1_amd64.deb
-rw-r--r-- 1 root root  47337882 Oct 12 17:51 librbd1-dbg_10.2.2-1_amd64.deb
-rw-r--r-- 1 root root  77491296 Oct 12 17:56 librbd-dev_10.2.2-1_amd64.deb
-rw-r--r-- 1 root root   3655794 Oct 12 17:59 librgw2_10.2.2-1_amd64.deb
-rw-r--r-- 1 root root  37322260 Oct 12 18:00 librgw2-dbg_10.2.2-1_amd64.deb
-rw-r--r-- 1 root root  62672252 Oct 12 18:04 librgw-dev_10.2.2-1_amd64.deb
-rw-r--r-- 1 root root    999136 Oct 12 18:33 python-ceph_10.2.2-1_amd64.deb
-rw-r--r-- 1 root root   1200508 Oct 12 18:33 python-cephfs_10.2.2-1_amd64.deb
-rw-r--r-- 1 root root   1562364 Oct 12 18:33 python-rados_10.2.2-1_amd64.deb
-rw-r--r-- 1 root root   1262606 Oct 12 18:33 python-rbd_10.2.2-1_amd64.deb
-rw-r--r-- 1 root root   1225844 Oct 12 18:04 radosgw_10.2.2-1_amd64.deb
-rw-r--r-- 1 root root   3863166 Oct 12 18:04 radosgw-dbg_10.2.2-1_amd64.deb
-rw-r--r-- 1 root root   1399948 Oct 12 17:35 rbd-fuse_10.2.2-1_amd64.deb
-rw-r--r-- 1 root root   4887752 Oct 12 17:35 rbd-fuse-dbg_10.2.2-1_amd64.deb
-rw-r--r-- 1 root root   2364120 Oct 12 17:35 rbd-mirror_10.2.2-1_amd64.deb
-rw-r--r-- 1 root root  38018688 Oct 12 17:36 rbd-mirror-dbg_10.2.2-1_amd64.deb
-rw-r--r-- 1 root root   1436434 Oct 12 17:36 rbd-nbd_10.2.2-1_amd64.deb
-rw-r--r-- 1 root root   5408914 Oct 12 17:36 rbd-nbd-dbg_10.2.2-1_amd64.deb

问题

这里是我遇到的一些问题,很多问题都是测试环境造成的,也留意一下吧。
问题1:

Downloading/unpacking virtualenv
  Cannot fetch index base URL https://pypi.python.org/simple/
  Could not find any downloads that satisfy the requirement virtualenv
Cleaning up...
No distributions at all found for virtualenv
Storing debug log for failure in /root/.pip/pip.log
./install-deps.sh: line 154: /root/jiangchuan/ceph-master/install-deps-python2.7_tmp/bin/virtualenv: No such file or directory
./install-deps.sh: line 157: /root/jiangchuan/ceph-master/install-deps-python2.7/bin/activate: No such file or directory
Requirement already satisfied (use --upgrade to upgrade): setuptools>=0.8 in /usr/lib/python2.7/dist-packages
Downloading/unpacking pip>=7.0
  Cannot fetch index base URL https://pypi.python.org/simple/
  Could not find any downloads that satisfy the requirement pip>=7.0
Cleaning up...
No distributions at all found for pip>=7.0
Storing debug log for failure in /root/.pip/pip.log

解决:网络问题。

问题2:
运行./install_deps.sh出现问题

Hash of the package https://pypi.python.org/packages/45/9c/acd0645222dc9f3593e86a33b3e5cae0be841c04807bf0f183625bc5fe85/virtualenv-15.0.3-py2.py3-none-any.whl世界杯外围投注官网md5=75d2e7305967ec368c43152b7c55546e (from https://pypi.python.org/simple/virtualenv/) (0b8b9a404b3fa766f9e101593e085893) doesn&世界杯外围投注官网39;t match the expected hash 75d2e7305967ec368c43152b7c55546e!
Cleaning up...
Bad md5 hash for package https://pypi.python.org/packages/45/9c/acd0645222dc9f3593e86a33b3e5cae0be841c04807bf0f183625bc5fe85/virtualenv-15.0.3-py2.py3-none-any.whl世界杯外围投注官网md5=75d2e7305967ec368c43152b7c55546e (from https://pypi.python.org/simple/virtualenv/)
Storing debug log for failure in /root/.pip/pip.log
./install-deps.sh: line 154: /root/jiangchuan/ceph-master/install-deps-python2.7_tmp/bin/virtualenv: No such file or directory
./install-deps.sh: line 157: /root/jiangchuan/ceph-master/install-deps-python2.7/bin/activate: No such file or directory
Requirement already satisfied (use --upgrade to upgrade): setuptools>=0.8 in /usr/lib/python2.7/dist-packages
Requirement already satisfied (use --upgrade to upgrade): pip>=7.0 in /usr/local/lib/python2.7/dist-packages
Requirement already satisfied (use --upgrade to upgrade): wheel>=0.24 in /usr/local/lib/python2.7/dist-packages
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.org/en/latest/security.html世界杯外围投注官网snimissingwarning.
  SNIMissingWarning
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.org/en/latest/security.html世界杯外围投注官网insecureplatformwarning.
  InsecurePlatformWarning
./install-deps.sh: line 163: /root/jiangchuan/ceph-master/install-deps-python2.7/bin/activate: No such file or directory

解决:下载的文件校验不符,重新运行命令。

问题3:
cmake的时候出错,这个时候是自己在git下载v11版本zip到本地,使用cmake来编译的。

CMake Error at src/CMakeLists.txt:705 (add_subdirectory):
  add_subdirectory given source "googletest/googlemock" which is not an
  existing directory.
-- Configuring incomplete, errors occurred!
See also "/root/jiangchuan/ceph-master/build/CMakeFiles/CMakeOutput.log".
See also "/root/jiangchuan/ceph-master/build/CMakeFiles/CMakeError.log".
root@cloud-17:~/jiangchuan/ceph-master/build世界杯外围投注官网 make
make: *** No targets specified and no makefile found.  Stop.

解决:自己手动在Git上下载zip包,应该是没有相关子模块。

问题4:

root@cloud-17:~/jiangchuan/ceph-master世界杯外围投注官网 ./autogen.sh 
+ set -e
+ test -f src/ceph.in
+ which libtoolize
+ [ /usr/bin/libtoolize ]
+ LIBTOOLIZE=libtoolize
+ test -d .git
+ rm -f config.cache
+ aclocal -I m4 --install
./autogen.sh: 41: ./autogen.sh: aclocal: not found

解决:缺这个就安装这个

sudo apt-get install automake

问题5:
make的时候出错,这个时候使用的是10.2.2版本:

root@cloud-17:~/jiangchuan/ceph-0.80.10世界杯外围投注官网 make  
Making all in .
make[1]: Entering directory `/root/jiangchuan/ceph-0.80.10&世界杯外围投注官网39;
make[1]: Nothing to be done for `all-am&世界杯外围投注官网39;.
make[1]: Leaving directory `/root/jiangchuan/ceph-0.80.10&世界杯外围投注官网39;
Making all in src
make[1]: Entering directory `/root/jiangchuan/ceph-0.80.10/src&世界杯外围投注官网39;
make  all-recursive
make[2]: Entering directory `/root/jiangchuan/ceph-0.80.10/src&世界杯外围投注官网39;
Making all in ocf
make[3]: Entering directory `/root/jiangchuan/ceph-0.80.10/src/ocf&世界杯外围投注官网39;
make[3]: Nothing to be done for `all&世界杯外围投注官网39;.
make[3]: Leaving directory `/root/jiangchuan/ceph-0.80.10/src/ocf&世界杯外围投注官网39;
Making all in java
make[3]: Entering directory `/root/jiangchuan/ceph-0.80.10/src/java&世界杯外围投注官网39;
make  all-am
make[4]: Entering directory `/root/jiangchuan/ceph-0.80.10/src/java&世界杯外围投注官网39;
make[4]: Nothing to be done for `all-am&世界杯外围投注官网39;.
make[4]: Leaving directory `/root/jiangchuan/ceph-0.80.10/src/java&世界杯外围投注官网39;
make[3]: Leaving directory `/root/jiangchuan/ceph-0.80.10/src/java&世界杯外围投注官网39;
make[3]: Entering directory `/root/jiangchuan/ceph-0.80.10/src&世界杯外围投注官网39;
make[3]: *** No rule to make target `erasure-code/jerasure/jerasure/src/cauchy.c&世界杯外围投注官网39;, needed by `erasure-code/jerasure/jerasure/src/libec_jerasure_generic_la-cauchy.lo&世界杯外围投注官网39;.  Stop.
make[3]: Leaving directory `/root/jiangchuan/ceph-0.80.10/src&世界杯外围投注官网39;
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/root/jiangchuan/ceph-0.80.10/src&世界杯外围投注官网39;
make[1]: *** [all] Error 2
make[1]: Leaving directory `/root/jiangchuan/ceph-0.80.10/src&世界杯外围投注官网39;
make: *** [all-recursive] Error 1

解决:参照网上的解决办法。

No rule to make target erasure-code/jerasure/jerasure/src/cauchy.c
如果直接使用ceph 的src.rpm包,编译成功,没有任何错误。
但是,如果从github上取ceph的源码编译,则老实遍不成功,报如下错误:
No rule to make target erasure-code/jerasure/jerasure/src/cauchy.c
网上搜了一把,也有其他人遇到这样的问题,但都没有给出解决方案。
仔细研究了一下,错误原因原来是这样的:
ceph 在github上,还有好多的submodules, 如:
src/erasure-code/jerasure/gf-complete
src/erasure-code/jerasure/jerasure
src/libs3
src/rocksdb
git clone https://github.com/ceph/ceph.git 是不会取这下submodule的世界杯外围投注网站的。
而上面编译ceph遇到的错误就是:编译过程中用到了erasure-code/jerasure/jerasure/src/cauchy.c,
由于没有git submodule, 所以找不到这个文件而报错。

解决方法:
把submodule的世界杯外围投注网站也取下来
git submodule update –init –recursive
至于ceph.src.rpm为什么能编译成功,那是因为,所需要的submodule的世界杯外围投注网站已经一起打包,包含在src.rpm里面了。

问题6:
打包的时候出现问题,一直要等很久很久很久。
重试了很多遍才行的,不知名问题也不知道怎么解决,多多尝试几遍就好了。

相关文章
最新文章
热点推荐