A tsunami warning has been issued for eight Indonesian cities after a 6.9-magnitude earthquake struck near Sulawesi.