This paper studies two types of 3-Lie bialgebras whose compatibility conditions between the multiplication and comultiplication are given by local cocycles and double constructions respectively, and are therefore called the local cocycle 3-Lie bialgebra and the double construction 3-Lie bialgebra. They can be regarded as suitable extensions of the well-known Lie bialgebra in the context of 3-Lie algebras, in two different directions. The local cocycle 3-Lie bialgebra is introduced to extend the connection between Lie bialgebras and the classical Yang-Baxter equation. Its relationship with a ternary variation of the classical Yang-Baxter equation, called the 3-Lie classical Yang-Baxter equation, a ternary $\mathcal{O}$-operator and a 3-pre-Lie algebra is established. In particular, it is shown that solutions of the 3-Lie classical Yang-Baxter equation give (coboundary) local cocycle 3-Lie bialgebras, whereas 3-pre-Lie algebras give rise to solutions of the 3-Lie classical Yang-Baxter equation. The double construction 3-Lie bialgebra is introduced to extend to the 3-Lie algebra context the connection between Lie bialgebras and double constructions of Lie algebras. Their related Manin triples give a natural construction of pseudo-metric 3-Lie algebras with neutral signature. Moreover, the double construction 3-Lie bialgebra can be regarded as a special class of the local cocycle 3-Lie bialgebra. Explicit examples of double construction 3-Lie bialgebras are provided.