月度归档:2016年01月

深入探讨在集群环境中使用 EhCache 缓存系统

face9686a126c31e936870d7c956b970EhCache 是一个纯 Java 的进程内缓存框架,具有快速、精干等特点,是 Hibernate 中默认的 CacheProvider。本文充分的介绍了 EhCache 缓存系统对集群环境的支持以及使用方法。

EhCache 缓存系统简介

EhCache 是一个纯 Java 的进程内缓存框架,具有快速、精干等特点,是 Hibernate 中默认的 CacheProvider。

下图是 EhCache 在应用程序中的位置:

图 1. EhCache 应用架构图

图 1. EhCache 应用架构图

EhCache 的主要特性有:

  1. 快速;
  2. 简单;
  3. 多种缓存策略;
  4. 缓存数据有两级:内存和磁盘,因此无需担心容量问题;
  5. 缓存数据会在虚拟机重启的过程中写入磁盘;
  6. 可以通过 RMI、可插入 API 等方式进行分布式缓存;
  7. 具有缓存和缓存管理器的侦听接口;
  8. 支持多缓存管理器实例,以及一个实例的多个缓存区域;
  9. 提供 Hibernate 的缓存实现;
  10. 等等 …

继续阅读

Wireshark抓包实例诊断TCP连接问题

TCP进程通讯时,双方打开连接,发送数据,最后关闭连接。当TCP打开连接时,从源端口到目的端口发送一个请求。在应用建立或关闭时可能发生一些问题。本文讨论用Wireshark网络抓包的方法来定位及解决这一问题。
 
问题的表现形式:
 

问题可能有多种表现类型:

  • 尝试运行应用程序但发现应用程序无法工作。尝试浏览网络但无法获得响应。
  • 尝试发送邮件但无法连接到邮件服务器。
  • 问题可能由简单原因引起,如服务器宕机,服务器上没有运行应用程序,或在客户端到服务器的某一处网络断开。
  • 问题也可能由复杂原因引起,如DNS问题,服务器内存不足无法连接(例如某一应用占用高内存空间),重复IP,以及其他原因。

处理方法: 继续阅读

MySQL Cluster fault tolerance – impact of deployment decisions

MySQL Cluster fault tolerance – impact of deployment decisions

Typical management configuration

Fig 1. Typical management configuration

MySQL Cluster is designed to be a High Availability, Fault Tolerant database where no single failure results in any loss of service.

This is however dependent on how the user chooses to architect the configuration – in terms of which nodes are placed on which physical hosts, and which physical resources each physical host is dependent on (for example if the two blades containing the data nodes making up a particular node group are cooled by the same fan then the failure of that fan could result in the loss of the whole database).

Of course, there’s always the possibility of an entire data center being lost due to earthquake, sabotage etc. and so for a fully available system, you should consider using asynchronous replication to a geographically remote Cluster.

Fig 1. illustrates a typical small configuration with one or more data nodes from different node groups being stored on two different physical hosts and a management node on an independent machines (probably co-located with other applications as its resource requirements are minimal. If any single node (process) or physical host is lost then service can continue.

继续阅读