Is it necessary for the Gym Leaders of a region to know each other? As far as I remember from the anime series and the games, after beating one of eight Gym Leaders in a region, some leader said something about the next Gym Leader.  

Like they know who, where, or what specialist-type the next Gym Leader is.

But, I watched the current XY series, Clemont, the Gym Leader of Lumiose City's Gym who travels with Ash, always wonders about the kind of next Gym Leader that Ash will face.

UPDATE

Each region has 8 Gym Leaders, and they give a badge after being defeated. We need all 8 badges to enter the Pokemon League to beat the Elite Four and the Champion. 

I just want to know if they, as Gym Leaders, must have known each other or not?
No there is no reason to. As some of the strongest trainers of the region, gym leaders may know each other but there is no necessity. 

Case in point, Misty didn't know Brock was Petalburg's gym leader even though she was at that time not the Cerulean's leader. But throughout the journey Brock doesn't recognise most of the gym leaders. On the other hand several leaders know each other as well as the Elite Four. The reason for this is probably gyms are taken over strong trainers who went to the league or the Elite Four.

The reason why this is not a necessity that there is no set order for you to fight the gym leaders. There is no prescribed order to fight the gyms in an order. Even in the first generation games you could possibly battle Fuchsia, Celadon and Saffron gyms in different orders. In future games the HMs can only be used by defeating a gym and that HM is usually required to reach that next gym and thus the need of order of a particular gym. Or sometimes its locked, gym leader missing etc. other side quests.

In the anime, the current gym leader would realistically know which gym is the closest and leaders are usually helpful enough to pass it on to the trainer. But he is not required to fight the gym and may chose to proceed to another. Example: Ash skipped the Petalburg gym because Vigoroth was too powerful for his team and came back later. (As I remember, been a long time since I last saw Pokemon)

Also it is conclusive there are more than 8 gyms in any region of pokemon.
Refer to: 
Does each Region only have 8 gyms in pokemon?