Apache Mahout implements many clustering algorithms, via Hadoop. It's a little heavy for what you want, but: http://cwiki.apache.org/MAHOUT/syntheticcontroldata.html
Also you might be able to dig out and adapt the user clustering code from Mahout's TreeClusteringRecommender class, which uses clustering for recommender engine purposes.