A magnitude 6.2 earthquake hit off the coast of Indonesia's North Maluku, the geophysics agency said on Wednesday.