hadoop+hbase ,因为后来hbase的单独飞跃:从2.0跨越至9.0 。导致很多版本不兼容问题。再者还有hbase同OS的关系问题。
昨天在用换用debian6+hadoop0.21+hbase0.90.4 之后,成功安装。hadoop0.21+hbase0.90.4+ubuntu10这个组合却总是失败,不知道原因,在ubuntu下总是无法在hbase shell中创建表。
这里,感谢国华师兄的指导,和一起奋斗的进嘉同学。
Category Archives: Linux
Linux环境下如何安装C++编译器Code::Block(转)
安这个东东有点崩溃,整了一个下午。由于之前没有过Linux使用及开发经验,初次涉及Linux环境下的开发,多少感觉不太适应,特别是对于各种软件的安装,相比Windows确实要麻烦许多。
前几天买了一本书叫《Linux程序设计第3版》,据说相当经典,经典当然不能错过,特别是对于一个刚刚开始学习Linux的新手而言。花了一天半时间狂翻了300多页,多多少少心里知道这是讲啥东东,感觉还不错,嘿~
心里痒痒就开始整Linux,虽然说vim+gcc+gdb已经能够满足Linux下C++的开发了,但还是想找一个IDE作为辅助集成开发环境。查了很多篇博客,看来大家都还比较推荐这款Code::Block,总结了一些文章的观点,原因可以从以下几点看出:
linux下多线程编程初学笔记(1)
主要了解这三个函数
/*pthread_create函数主要完成线程的创建. 参数解释: thread参数是一个线程标识符,当新创建一个线程的时候,会以此变量记录线程标识符 attr参数用于设置线程的属性,一般使用时,常为NULL start_routine 函数指针,指向一个函数.也就是这个线程所要运行的函数 arg参数:线程所指向的函数的参数,如果函数不需要参数,设为NULL */ int pthread_create(pthread_t *thread,pthread_attr_t *attr, void *(*start_routine)(void *),void *arg); /* pthread_join : 调用pthread_join的线程将等待参数thread所指向的线程 结束为止,当pthread_join函数返回时,被等待线程的资源被收回。 参数解释: 第一个参数为被等待的线程标识符, 第二个参数为一个用户定义的指针,它可以用来存储被等待线程的返回值 */ int pthread_join(pthread *thread,void **thread_return); /* pthread_exit 主要用于结束线程. 下面主要解释一下pthread_exit的参数 retval .当线程调用pthread_exit时, 线程将退出,retval中保存需要返回的信息.只要pthread_join中的第二个参数thread_return不是NULL,这个值将被传递给thread_return. */ void pthread_exit(void *retval); |
下面分析一个实例:
#include <pthread .h> #include <stdio .h> #include <errno .h> #include <string .h> void *thread_function(void *arg); char message[] = "Hello World"; int main() { int res; pthread_t a_thread; void *thread_result; res = pthread_create(&a_thread, NULL, thread_function, (void *)message); if (res != 0) { perror("Thread creation failed"); exit(1); } printf("Waiting for thread to finish...n"); res = pthread_join(a_thread, &thread_result); //pthread_join 阻塞执行的线程直到某线程结束 if (res != 0) { perror("Thread join failed"); exit(1); } printf("Thread joined, it returned %sn", (char *)thread_result); printf("Message is now %sn", message); exit(0); } void *thread_function(void *arg) { printf("thread_function is running. Argument was %sn", (char *)arg); sleep(3); strcpy(message, "Bye!"); pthread_exit("Thank you for the CPU time"); } </string></errno></stdio></pthread> |
当主线程执行到pthread_create时,将创建一个新线程.我们将它称之为子线程
这时将根据cpu将主线程和子线程之间调度
当主线程执行到pthread_join的时候,将阻塞主线程的执行,直到a_thread所标示的子线程执行结束后,再执行主线程

执行结果
SSH下的乱码问题
1.vi /etc/sysconfig/i18n
将内容改为
LANG=”zh_CN.GB18030″
LANGUAGE=”zh_CN.GB18030:zh_CN.GB2312:zh_CN”
SUPPORTED=”zh_CN.GB18030:zh_CN:zh:en_US.UTF-8:en_US:en”
SYSFONT=”lat0-sun16″
这样中文在SSH,telnet终端就可以正常显示了。
2.安安装Linux的时候选择的是中文字,但是使用的时候出现了乱码解决方法是在命令提示下输入export LANG=C
3.export LC_ALL=zh_CN.GBK
export LANG=zh_CN.GBK
Linux: the big picture
This article gives a brief introduction to Linux, with a sketch of the background history. It was written for PC Update, the monthly magazine of the PC user group in Melbourne, Australia. This version does not contain all the editorial changes and spelling fixes made by the magazine.
April 28, 2003