#include#include#includeusing namespace std; #define HASHSIZE 7#define NULLKEY -32768 struct HashTable{ int *elem; int count;};void init(HashTable* ha...
分类:
其他好文 时间:
2014-11-05 23:04:37
阅读次数:
153
1.安装heartbeat下载需要的源:wgetftp://mirror.switch.ch/pool/1/mirror/scientificlinux/6rolling/x86_64/os/Packages/epel-release-6-5.noarch.rpm2.安装heartbeat:yum-yinstallheartbeat*3.配置heartbeat3.1.拷贝模板配置文件:cp/usr/share/doc/heartbeat-3.0.4/ha.cf/e..
分类:
其他好文 时间:
2014-10-30 19:24:48
阅读次数:
177
【题目】
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-10-30 17:02:57
阅读次数:
249
本文接上文介绍atlas的安装配置,以及借助keepalive软件实现altas的ha,避免由于atlas故障,导致数据库服务中断的情况出现:一:环境介绍Atlas主:192.168.1.12/24Atlas从:192.168.1.81/24Atlasvip:192.168.1.230/24Atlaswrite:master:192.168.1.225/24Slave1:192.168.1.226..
分类:
数据库 时间:
2014-10-29 19:36:01
阅读次数:
853
本篇文档主要解决2个问题:1. centos5通过yum安装的master版本肯定低于centos6安装的minion,所以必须升级salt-master2. zeromq版本太低会报这个错2014-10-29 14:36:04,597 [salt.master ][WARNING ] You ha...
分类:
其他好文 时间:
2014-10-29 18:33:13
阅读次数:
197
前提:使用阿里巴巴的JSON包String json = ""; //JSON字符串Map map = JSON.parseObject(json, Map.class);//遍历 Map 使用迭代器Iterator it = map.keySet().iterator();while(it.ha....
分类:
Web程序 时间:
2014-10-29 10:47:19
阅读次数:
130
最近尝试了一下mysql的读写分离和高可用的搭建。搭好之后体验了一下,效果还不错。这里跟大家分享一下。1、首先介绍一下mysql-mmm这个工具是干嘛使的?众所周知,mysql自身提供了AB复制。我们也可以很轻松的实现master-master双向复制,同时再为其中的一个master节点搭建一个sl..
分类:
数据库 时间:
2014-10-29 02:02:02
阅读次数:
356
keepalived是一个用于做双机热备(HA)的软件,常和haproxy联合起来做热备+负载均衡,达到高可用。运行原理keepalived通过选举(看服务器设置的权重)挑选出一台热备服务器做MASTER机器,MASTER机器会被分配到一个指定的虚拟ip,外部程序可通过该ip访问这台服务器,如果这台...
分类:
其他好文 时间:
2014-10-28 17:39:06
阅读次数:
277
接着上篇来说,TaskTracker端的transmitHeartBeat()方法通过RPC调用JobTracker端的heartbeat()方法来接收心跳并返回心跳应答。还是先看看这张图,对它的大概流程有个了解。 下面来一段一段的分析该方法。 1 public synchronized He...
分类:
其他好文 时间:
2014-10-27 22:30:57
阅读次数:
360
【 声明:版权全部,欢迎转载,请勿用于商业用途。 联系信箱:feixiaoxing @163.com】 hash表,有时候也被称为散列表。个人觉得,hash表是介于链表和二叉树之间的一种中间结构。链表使用十分方便,可是数据查找十分麻烦;二叉树中的数据严格有序,可是这是以多一个指针作为代价的结果。ha...
分类:
编程语言 时间:
2014-10-26 21:13:30
阅读次数:
203