This paper considers capacity-achieving coding for the clustered form of distributed storage that reflects practical storage networks. To reflect the clustered structure with limited cross-cluster communication bandwidths, nodes in the same cluster are set to communicate βI symbols, while nodes in other clusters can communicate βc ≤ βI symbols with one another. We provide two types of exact regenerating codes which achieve the capacity of clustered distributed storage: the minimum-bandwidth-regenerating (MBR) codes and the minimum-storage-regenerating (MSR) codes. First, we construct MBR codes for general parameter settings of clustered distributed storage. The suggested MBR code is a generalization of an existing code proposed by Rashmi et al., for scenarios where storage nodes are dispersed into L > 1 clusters. The proposed MBR code for the βc = 0 case requires a much smaller field size compared to existing local MBR codes. Secondly, we devise MSR codes for clustered distributed storage. Focus is given on two important cases: = 0 and ∈ [ 1 n−k , 1], where = βc/βI is the ratio of the available cross-to intra-cluster repair bandwidths, n is the total number of distributed nodes and k is the number of contact nodes in data retrieval. The former represents the scenario where cross-cluster communication is not allowed, while the latter corresponds to the case of minimum node storage overhead. For = 0, two existing locally repairable codes are proven to be MSR codes for the clustered model. For ∈ [ 1 n−k , 1], existing MSR codes for the non-clustered model are applicable to clustered scenarios with a simple modification. Finally, under the settings of = 1 n−k and n = kL, an MSR code is suggested which is based on simple MDS codes and requires a smaller field size for symbols than the existing code for L ≥ 3.