Flash floods and landslides have killed at least nine people and forced thousands into temporary shelters on Indonesia's Sumatra island.