Backgroud: Mastitis is the most serious disease endangering animal husbandry, especially dairy farming. Clinical investigations indicated that cows suffering from ketosis have a higher probability of mastitis. Rumen microbiota is closely related to ruminant health. However, it is not clear what role it plays in this process.Results: The microbiota in rumen fluid and milk from ketosis cows were determined by 16S rRNA gene sequencing. The results showed that the richness of bacterial community both in rumen and milk were changed in ketosis cows. The abundance of genus Prevotella, Ruminococcus, Succinivibrionaceae_UCG-001 and Streptococcus in rumen fluid from ketosis cows decreased significantly and were negatively correlated with blood BHBA and milk SCC. In contrast, the abundance of genus Luteimonas, Thermomonas, Christensenellaceae_R-7_group, Rikenellaceae_RC9_gut_group, NK4A214_group, Paracoccus, Acetitomaculum, Prevotellaceae_UCG-003, Deinococcus, Saccharofermentans and Butyrivibrio in rumen fluid from ketosis cows increased significantly and were positively correlated with blood BHBA and milk SCC. In addition, the abundance of F082 and Thermomonas were increased, while the abundance of genus Acinetobacter and UCG-005 were reduced both in milk and rumen fluid in ketosis cows than healthy cows. Conclusions: Ketosis in dairy cows is capable of inducing mastitis. The rumen microbiota of ketotic cows changed significantly and is associated with the development of mastitis. Targeting rumen microbiota regulation may be a promising strategy to prevent metabolism disorder and its secondary diseases in dairy cows.