,,,
hbase(main):010:0> put 't1','row1','info:name','xiaoming'
hbase(main):011:0> put 't1','row2','info:age','18'
hbase(main):012:0> put 't1','row3','info:sex','male'
查询表记录get
[tnuser@sht-sgmhadoopcm-01 bin]$ graceful_stop.sh sht-sgmhadoopdn-04
Disabling balancer!
HBase Shell; enter 'help' for list of supported commands.
Type "exit" to leave the HBase Shell
Version 0.92.1, r1298924, Fri Mar 9 16:58:34 UTC 2012
balance_switch false
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/local/contentplatform/hbase-0.92.1/lib/slf4j-log4j12-1.5.8.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/local/contentplatform/hadoop-1.0.3/lib/slf4j-log4j12-1.4.3.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
true
0 row(s) in 0.7580 seconds
Unloading sht-sgmhadoopdn-04 region(s)
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/local/contentplatform/hbase-0.92.1/lib/slf4j-log4j12-1.5.8.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/local/contentplatform/hadoop-1.0.3/lib/slf4j-log4j12-1.4.3.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
19/04/07 20:11:14 INFO zookeeper.ZooKeeper: Client environment:zookeeper.version=3.4.3-1240972, built on 02/06/2012 10:48 GMT
19/04/07 20:11:14 INFO zookeeper.ZooKeeper: Client environment:host.name=sht-sgmhadoopcm-01
19/04/07 20:11:14 INFO zookeeper.ZooKeeper: Client environment:java.version=1.6.0_12
19/04/07 20:11:14 INFO zookeeper.ZooKeeper: Client environment:java.vendor=Sun Microsystems Inc.
19/04/07 20:11:14 INFO zookeeper.ZooKeeper: Client environment:java.home=/usr/java/jdk1.6.0_12/jre
19/04/07 20:11:14 INFO zookeeper.ZooKeeper: Client environment:java.library.path=/usr/local/contentplatform/hadoop-1.0.3/libexec/../lib/native/Linux-amd64-64:/usr/local/contentplatform/hbase-0.92.1/lib/native/Linux-amd64-64
19/04/07 20:11:14 INFO zookeeper.ZooKeeper: Client environment:java.io.tmpdir=/tmp
19/04/07 20:11:14 INFO zookeeper.ZooKeeper: Client environment:java.compiler=
19/04/07 20:11:14 INFO zookeeper.ZooKeeper: Client environment:os.name=Linux
19/04/07 20:11:14 INFO zookeeper.ZooKeeper: Client environment:os.arch=amd64
19/04/07 20:11:14 INFO zookeeper.ZooKeeper: Client environment:os.version=3.10.0-514.el7.x86_64
19/04/07 20:11:14 INFO zookeeper.ZooKeeper: Client environment:user.name=tnuser
19/04/07 20:11:14 INFO zookeeper.ZooKeeper: Client environment:user.home=/home/tnuser
19/04/07 20:11:14 INFO zookeeper.ZooKeeper: Client environment:user.dir=/usr/local/contentplatform/hbase-0.92.1/bin
19/04/07 20:11:14 INFO zookeeper.ZooKeeper: Initiating client connection, connectString=sht-sgmhadoopdn-01:2181,sht-sgmhadoopcm-01:2181,sht-sgmhadoopdn-02:2181 sessionTimeout=900000 watcher=hconnection
19/04/07 20:11:14 INFO zookeeper.ClientCnxn: Opening socket connection to server /172.16.101.58:2181
19/04/07 20:11:14 INFO zookeeper.RecoverableZooKeeper: The identifier of this process is [email protected]
19/04/07 20:11:14 WARN client.ZooKeeperSaslClient: SecurityException: java.lang.SecurityException: Unable to locate a login configuration occurred when trying to find JAAS configuration.
19/04/07 20:11:14 INFO client.ZooKeeperSaslClient: Client will not SASL-authenticate because the default JAAS configuration section 'Client' could not be found. If you are not using SASL, you may ignore this. On the other hand, if you expected SASL to work, please fix your JAAS configuration.
19/04/07 20:11:14 INFO zookeeper.ClientCnxn: Socket connection established to sht-sgmhadoopdn-01/172.16.101.58:2181, initiating session
19/04/07 20:11:14 INFO zookeeper.ClientCnxn: Session establishment complete on server sht-sgmhadoopdn-01/172.16.101.58:2181, sessionid = 0x169f7b052050003, negotiated timeout = 900000
19/04/07 20:11:15 INFO region_mover: Moving 2 region(s) from sht-sgmhadoopdn-04,60020,1554638724252 during this cycle
19/04/07 20:11:15 INFO region_mover: Moving region 1028785192 (0 of 2) to server=sht-sgmhadoopdn-01,60020,1554638723581
19/04/07 20:11:16 INFO region_mover: Moving region d3a10ae012afde8e1e401a2e400accc8 (1 of 2) to server=sht-sgmhadoopdn-01,60020,1554638723581
19/04/07 20:11:17 INFO region_mover: Wrote list of moved regions to /tmp/sht-sgmhadoopdn-04
Unloaded sht-sgmhadoopdn-04 region(s)
sht-sgmhadoopdn-04: ********************************************************************
sht-sgmhadoopdn-04: * *
sht-sgmhadoopdn-04: * This system is for the use of authorized users only. Usage of *
sht-sgmhadoopdn-04: * this system may be monitored and recorded by system personnel. *
sht-sgmhadoopdn-04: * *
sht-sgmhadoopdn-04: * Anyone using this system expressly consents to such monitoring *
sht-sgmhadoopdn-04: * and they are advised that if such monitoring reveals possible *
sht-sgmhadoopdn-04: * evidence of criminal activity, system personnel may provide the *
sht-sgmhadoopdn-04: * evidence from such monitoring to law enforcement officials. *
sht-sgmhadoopdn-04: * *
sht-sgmhadoopdn-04: ********************************************************************
sht-sgmhadoopdn-04: stopping regionserver....
[tnuser@sht-sgmhadoopcm-01 hbase]$ echo "balance_switch true" | hbase shell
查看hbase节点状态
[tnuser@sht-sgmhadoopcm-01 hbase]$ echo "status" | hbase shell
3 servers, 1 dead, 1.3333 average load
[tnuser@sht-sgmhadoopdn-04 hbase]$ jps
23940 Jps
23375 DataNode
23487 TaskTracker
http://172.16.101.54:60010
再移除sht-sgmhadoopdn-04的datanode和TaskTracker节点
[tnuser@sht-sgmhadoopcm-01 hadoop-1.0.3]$ vim /usr/local/contentplatform/hadoop-1.0.3/conf/include
sht-sgmhadoopdn-01
sht-sgmhadoopdn-02
sht-sgmhadoopdn-03
[tnuser@sht-sgmhadoopcm-01 hadoop-1.0.3]$ vim /usr/local/contentplatform/hadoop-1.0.3/conf/excludes
sht-sgmhadoopdn-04
[tnuser@sht-sgmhadoopcm-01 conf]$ vim /usr/local/contentplatform/hadoop-1.0.3/conf/hdfs-site.xml
dfs.hosts/usr/local/contentplatform/hadoop-1.0.3/conf/includetruedfs.hosts.exclude/usr/local/contentplatform/hadoop-1.0.3/conf/excludestrue
[tnuser@sht-sgmhadoopcm-01 conf]$ vim /usr/local/contentplatform/hadoop-1.0.3/conf/mapred-site.xml
mapred.hosts/usr/local/contentplatform/hadoop-1.0.3/conf/includetruemapred.hosts.exclude/usr/local/contentplatform/hadoop-1.0.3/conf/excludestrue
重新加载配置,NameNode会检查并将数据复制到其它节点上以恢复副本数,但是不会删除sht-sgmhadoopdn-04把原本的数据,如果数据量比较大,这个过程比较耗时
-refreshNodes :Re-read the hosts and exclude files to update the set of Datanodes that are allowed to connect to the Namenode and those that should be decommissioned or recommissioned.
[tnuser@sht-sgmhadoopcm-01 hadoop-1.0.3]$ hadoop dfsadmin -refreshNodes
[tnuser@sht-sgmhadoopcm-01 hadoop-1.0.3]$ hadoop mradmin -refreshNodes
如果节点sht-sgmhadoopdn-04上DataNode和TaskTracker进程还存活,则使用下面命令关闭(正常情况在上一步中已经被关闭了)
[tnuser@sht-sgmhadoopdn-04 hbase]$ hadoop-daemon.sh stop datanode
[tnuser@sht-sgmhadoopdn-04 hbase]$ hadoop-daemon.sh stop tasktracker
[tnuser@sht-sgmhadoopcm-01 hadoop-1.0.3]$ hadoop dfsadmin -report
Warning: $HADOOP_HOME is deprecated.
Configured Capacity: 246328578048 (229.41 GB)
Present Capacity: 93446351917 (87.03 GB)
DFS Remaining: 93445607424 (87.03 GB)
DFS Used: 744493 (727.04 KB)
DFS Used%: 0%
Under replicated blocks: 0
Blocks with corrupt replicas: 0
Missing blocks: 0
-------------------------------------------------
Datanodes available: 3 (4 total, 1 dead)
Name: 172.16.101.58:50010
Decommission Status : Normal
Configured Capacity: 82109526016 (76.47 GB)
DFS Used: 259087 (253.01 KB)
Non DFS Used: 57951808497 (53.97 GB)
DFS Remaining: 24157458432(22.5 GB)
DFS Used%: 0%
DFS Remaining%: 29.42%
Last contact: Sun Apr 07 20:45:42 CST 2019
Name: 172.16.101.60:50010
Decommission Status : Normal
Configured Capacity: 82109526016 (76.47 GB)
DFS Used: 246799 (241.01 KB)
Non DFS Used: 45172382705 (42.07 GB)
DFS Remaining: 36936896512(34.4 GB)
DFS Used%: 0%
DFS Remaining%: 44.98%
Last contact: Sun Apr 07 20:45:43 CST 2019
Name: 172.16.101.59:50010
Decommission Status : Normal
Configured Capacity: 82109526016 (76.47 GB)
DFS Used: 238607 (233.01 KB)
Non DFS Used: 49758034929 (46.34 GB)
DFS Remaining: 32351252480(30.13 GB)
DFS Used%: 0%
DFS Remaining%: 39.4%
Last contact: Sun Apr 07 20:45:42 CST 2019
Name: 172.16.101.66:50010
Decommission Status : Decommissioned
Configured Capacity: 0 (0 KB)
DFS Used: 0 (0 KB)
Non DFS Used: 0 (0 KB)
DFS Remaining: 0(0 KB)
DFS Used%: 100%
DFS Remaining%: 0%
Last contact: Thu Jan 01 08:00:00 CST 1970
此时节点sht-sgmhadoopdn-04已经没有进程
[tnuser@sht-sgmhadoopdn-04 hbase]$ jps
23973 Jps
sht-sgmhadoopdn-04节点的数据仍然保留
[tnuser@sht-sgmhadoopdn-04 hbase]$ hadoop dfs -ls /hbase
Warning: $HADOOP_HOME is deprecated.
Found 8 items
drwxr-xr-x - tnuser supergroup 0 2019-04-07 17:46 /hbase/-ROOT-
drwxr-xr-x - tnuser supergroup 0 2019-04-07 18:23 /hbase/.META.
drwxr-xr-x - tnuser supergroup 0 2019-04-07 20:11 /hbase/.logs
drwxr-xr-x - tnuser supergroup 0 2019-04-07 20:45 /hbase/.oldlogs
drwxr-xr-x - tnuser supergroup 0 2019-04-07 18:50 /hbase/emp
-rw-r--r-- 3 tnuser supergroup 38 2019-04-06 22:41 /hbase/hbase.id
-rw-r--r-- 3 tnuser supergroup 3 2019-04-06 22:41 /hbase/hbase.version
drwxr-xr-x - tnuser supergroup 0 2019-04-07 18:51 /hbase/t1
平衡数据文件节点
[tnuser@sht-sgmhadoopcm-01 conf]$ start-balancer.sh -threshold 10
声明: 本文只为方便我个人查阅和理解,详细的分析以及源代码请移步 原作者的博客http://chjavach.iteye.com/
public class Singleton {
}
/*
* 懒汉模式。注意,getInstance如果在多线程环境中调用,需要加上synchronized,否则存在线程不安全问题
*/
class LazySingleton
这个月公司安排我一个人做iOS客户端开发,由于急着用,我先发布一个版本,由于第一次发布iOS应用,期间出了不少问题,记录于此。
1、使用Application Loader 发布时报错:Communication error.please use diagnostic mode to check connectivity.you need to have outbound acc
/*
2013年3月15日15:16:24
malloc 就memory(内存) allocate(分配)的缩写
本程序没有实际含义,只是理解使用
*/
# include <stdio.h>
# include <malloc.h>
int main(void)
{
int i = 5; //分配了4个字节 静态分配
int * p
http://wiki.sdn.sap.com/wiki/display/BOBJ/Optimize+query+with+Query+Stripping+in+Web+Intelligence
and a very straightfoward video
http://www.sdn.sap.com/irj/scn/events?rid=/library/uuid/40ec3a0c-936