题目
Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the
three integers. You may assume that each input would ha...
分类:
其他好文 时间:
2014-12-14 17:19:15
阅读次数:
158
本文在《Hadoop2.0的安装和基本配置》(见http://www.linuxidc.com/Linux/2014-05/101173.htm)一文的基础上继续介绍hadoop2.0 QJM(Quorum Journal Manager)方式的HA的配置(hadoop2.0架构,具体版本是hado...
分类:
其他好文 时间:
2014-12-14 15:50:08
阅读次数:
243
节点名:myNode1 192.168.1.77myNode2 192.168.1.88VIP 192.168.1.234带下划线的不允许作为节点名修改节点名字gvim /etc/hostsgvim /etc/hostname修改之前最好先用hostname命令测试下,免得启动不了机器安装heart...
分类:
其他好文 时间:
2014-12-13 17:36:39
阅读次数:
168
A. Twins
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output
Imagine that you have a twin brother or sister. Ha...
Find the contiguous subarray within an array (containing at least one number) which has the largest sum.
For example, given the array [?2,1,?3,4,?1,2,1,?5,4],
the contiguous subarray [4,?1,2,1] ha...
分类:
其他好文 时间:
2014-12-12 19:12:27
阅读次数:
205
heartbeat实现热备原理:
与keepalived运用vrrp协议不同,heartbeat利用串口和ip实现心跳监控,节点会检查配置文件中的网络联通性,如果网络不通,则主节点的ipfail会执行切换,关闭主节点上的
nginx并释放虚拟ip;此时备用节点将接管虚拟ip,并将此节点上的nginx启动,这样就实现了nginx的热备。
虚拟ip:192.168.3.233
主节点:...
分类:
其他好文 时间:
2014-12-12 14:57:44
阅读次数:
410
今天某导师联系我说:"There will be an allhand"搞不懂allhand是啥意思……他口头跟我解释的是就是个茶话会性质的小会~我在网上查了一下,这个用法很少见……一个可能的解释如下:hands可以用来表示水手,比如有个用法就是"All hands abandon ship!"ha...
分类:
其他好文 时间:
2014-12-12 14:50:40
阅读次数:
228
1、程序代码结构如下makefile/|-- Makefile|-- haha.c`-- hehe.c 1.1、需要被编译的源代码如下$ cat haha.c #include "stdio.h"int main(){ printf("ha ! ha !\n"); return 0;}...
分类:
系统相关 时间:
2014-12-11 17:07:47
阅读次数:
142
用途:解决mfsmaster的单点问题,同样可以作为其他需要高可用环境的标准配置方法规划:使用drbd实现主备机的灾容,Heartbeat做心跳监测,Pacemaker实现服务(资源)的切换及控制等描述:drbd双主模式对网络和配置要求比较高,在此结构下不采用;drbd需要清空一个分区,并且不能..
分类:
其他好文 时间:
2014-12-11 16:01:38
阅读次数:
297
理论基础:User → HA → Lb → web → sql →分布式filesystem ->磁盘I/O用户 高可用 负载均衡 应用 数据库mfs/hadoop磁盘I/O是硬伤,前面的各个厂商基本都可以做到最好,虽然可以考虑换成固态硬盘,但是固态的价格就目前来看相对比较昂贵,实际情况下显然...
分类:
其他好文 时间:
2014-12-11 14:00:28
阅读次数:
394