For online speaker diarization, samples arrive incremen tally, and the overall distribution of the samples is invisible. Moreover, in most existing clustering-based methods, the train ing objective of the embedding extractor is not designed spe cially for clustering. To improve online speaker diarization per formance, we propose a unified online clustering framework, which provides an interactive manner between embedding ex tractors and clustering algorithms. Specifically, the framework consists of two highly coupled parts: clustering-guided recur rent training (CGRT) and paths truncated beam search (PTBS). The CGRT introduces the clustering algorithm into the training process of embedding extractors, which could provide not only cluster-aware information for the embedding extractor, but also crucial parameters for the clustering process afterward. And with these parameters, which contain preliminary information of the metric space, the PTBS penalizes the probability score of each cluster, in order to output more accurate clustering re sults in online fashion with low latency. With the above innova tions, our proposed online clustering system achieves 14.48% DER with collar 0.25 at 2.5s latency on the AISHELL-4, while the DER of the offline agglomerative hierarchical clustering is 14.57%.