Cloud Found使用dev_setup进行单节点部署之排错分析

在学习云计算并尝试使用Cloud Foundry部署单节点PaaS平台时,遇到一系列问题,包括动态库缺失、configure错误等。本文详细记录了解决这些问题的过程,如通过识别错误信息、安装缺失库和调整编译工具链。着重强调了问题分析方法的重要性,适用于类似场景的故障排查。
摘要由CSDN通过智能技术生成

最近开始学云计算,看了一些基本概念的书,发现以前的很多知识现在都用的上。只是有一些新的知识需要学习。

废话不多说,遇到的第一个问题就是如何用Cloud Foundry部署一个自己的集群,当然第一步就是做一个单节点的PaaS平台。

网上就有如何布置安装的帖子,我何必多说,我只说一些自己在弄的过程中遇到的一些问题,以及如何解决的。其实这些方法很具有通用性,在很多场合下都很适用的。

我争取以类型说明,因为每个人的电脑出现的问题都不一定一样,学会分析的方法反而更重要。


注意:因为我Cloud Foundry是在ubuntu上安装的,下面的具体解决方法中有是ubuntu上的方法,其他发行版其实方法一样,只是使用的命令不同而已。注意区分就行了。


问题1--缺少动态库

特点:如果学过编译链接原理的就知道,在链接过程中需要指定使用的链接库,使用的命令就是ld,所以注意下面的信息,观察到STDERR:一行,首先是ld命令引起,意味着链接过程出问题了,然后是说明: cannot find -lncurses。意思就是找不到名字为ncurses的动态库。这种错误还是很明显的。

gcc -O2 -Wall -DLUA_USE_LINUX   -c -o linit.o linit.c
ar rcu liblua.a lapi.o lcode.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o lundump.o lvm.o lzio.o lauxlib.o lbaselib.o ldblib.o liolib.o lmathlib.o loslib.o ltablib.o lstrlib.o loadlib.o linit.o
ranlib liblua.a
gcc -O2 -Wall -DLUA_USE_LINUX   -c -o lua.o lua.c
gcc -o lua  lua.o liblua.a -lm -Wl,-E -ldl -lreadline -lhistory -lncurses
make[2]: Leaving directory `/tmp/lua-5.1.4/src'
make[1]: Leaving directory `/tmp/lua-5.1.4/src'
STDERR: /usr/bin/ld: cannot find -lncurses
collect2: ld returned 1 exit status
make[2]: *** [lua] Error 1
make[1]: *** [linux] Error 2
make: *** [linux] Error 2
---- End output of "bash"  "/tmp/chef-script20120930-23056-vcj5jy-0" ----
Ran "bash"  "/tmp/chef-script20120930-23056-vcj5jy-0" returned 2

解决思路:既然找不到,一般是两种情况:

(1)链接脚本出问题了

(2)系统中没有安装这个动态库

一般情况下,我们不会去动这个脚本,所以第一反映就是没有装这个动态库,所以解决方法就是找到这个库并安装。要安装一般也有两种办法:

(1)下载源码自己编译,但是这种情况很少出现

(2)在软件源中搜索相应的动态库安装。一般都这种解决。

解决:知道问题所在了,那接下来要具体怎么做,其实也很简单,分两步走:

(1)搜索这个动态库的名字

(2)安装这个动态库

好了,整个过程就像上面说的解决,现在看看我们是怎么解决的吧。第一,在ubuntu下动态库的名字都是以“lib”开头;第二、确定动态库大概的名字,从上面的错误信息来看,动态库的名字叫做“ncurses”,中间的"-l"是“-link”的意思,是编译过程中的标准语法。所以我们确定我们需要的动态库名称可能叫做“libncurses”。OK,然后我们搜索一下,得到如下结果:

ubuntu@cloudfoundry:~$ apt-cache search libncurses
libncurses5 - shared libraries for terminal handling
libncurses5-dbg - debugging/profiling libraries for ncurses
libncurses5-dev - developer's libraries for ncurses
libncursesw5 - shared libraries for terminal handling (wide character support)
libncursesw5-dbg - debugging/profiling libraries for ncursesw
libncursesw5-dev - developer's libraries for ncursesw
centerim-utf8 - A text-mode multi-protocol instant messenger client
libncurses-gst - Ncurses bindings for GNU Smalltalk
libncurses-ruby - Transitional package for ruby-ncurses
libncurses-ruby1.8 - Transitional package for ruby-ncurses
libncurses-ruby1.9 - Transitional package for ruby-ncurses
libncurses-ruby1.9.1 - Transitional package for ruby-ncurses
libncursesada-dbg - Ada binding to the ncurses text interface library: debug symbols
libncursesada-doc - Ada binding to the ncurses text interface library: documentation
libncursesada2 - Ada binding to the ncurses text interface library: shared library
libncursesada2-dev - Ada binding to the ncurses text interface library: development
ruby-ncurses - ruby extension for the ncurses C library
看到这么多,是不是很晕,这种时候就要大致分析可能哪个是自己需要的了。因为Cloud Foundry是用Ruby开发的,所以我觉得和Ruby相关的libncurses-ruby可能是我需要的,当然为了保险,我也装了libncurses5,当然哪个才是对的我也不知道,实在不行多装几个,总有成功的时候,只是我装了以后,第二次就没有遇到这个问题了。所以地一个问题算比较漂亮的解决了。
注:命令 apt-cache search XXX是在软件原列表中搜索的意思。


问题2、configure过程出现错误

特点:这个错误我一开始认为是因为缺少这个叫odbc的错误引起的,但是装了odbc后还是出错,后来发现这里的信息应该这样看:STDERR: configure: WARNING: No odbc library found skipping odbc。出错的地方是configure,意思是配置文件在你初始化配置的时候出现错误。

注:当时还出现下面的错误信息,其实这部分信息不止一个错误,但是我们先关注第一个错。

STDERR: configure: WARNING: No odbc library found skipping odbc
configure: WARNING: "ODBC library - link check failed"
configure: WARNING: No OpenGL headers found, wx will NOT be usable
configure: WARNING:
                wxWidgets must be installed on your system.

		Please check that wx-config is in path, the directory
		where wxWidgets libraries are installed (returned by
		'wx-config --libs' or 'wx-config --static --libs' command)
		is in LD_LIBRARY_PATH or equivalent variable and
		wxWidgets version is 2.8.4 or above.
configure: WARNING: No 'xsltproc' command found: the documentation cannot be built
configure: WARNING: No 'fop' command found: going to generate placeholder PDF files
gcc: fatal error: no input files
compilation terminated.
make[3]: *** [../ebin/hipe_consttab.beam] Aborted
make[2]: *** [opt] Error 2
make[1]: *** [opt] Error 2
make: *** [secondary_bootstrap_build] Error 2
make[3]: *** [../ebin/hipe_consttab.beam] Aborted
make[2]: *** [opt] Error 2
make[1]: *** [opt] Error 2
make: *** [secondary_bootstrap_build] Error 2
---- End output of "bash"  "/tmp/chef-script20120930-18247-lp90nh-0" ----
Ran "bash
评论 11
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值