In this paper, first we introduce the notion of a relative Rota-Baxter operator of nonzero weights on a 3-Lie algebra with respect to an action on another 3-Lie algebra, which can be characterized by graphs of the semidirect product 3-Lie algebra constructed from the action. Then we introduce a new algebraic structure, which is called a 3-post-Lie algebra. A 3-post-Lie algebra consists of a 3-Lie algebra structure and a ternary operation such that some compatibility conditions are satisfied. We show that a relative Rota-Baxter operator of nonzero weights induces a 3-post-Lie algebra naturally. Thus 3-post-Lie algebras can be viewed as the underlying algebraic structures of relative Rota-Baxter operators of nonzero weights on 3-Lie algebras. Moreover, a 3-post-Lie algebra also gives rise to a new 3-Lie algebra, which is called the subadjacent 3-Lie algebra, and an action on the original 3-Lie algebra. Next we construct an L ∞ -algebra from an action of 3-Lie algebras whose Maurer-Cartan elements are relative Rota-Baxter operators of nonzero weights. Consequently, we obtain the twisted L ∞ -algebra that controls deformations of a given relative Rota-Baxter operator of nonzero weights on 3-Lie algebras. Finally, we construct a cohomology theory for a relative Rota-Baxter operator of nonzero weights on 3-Lie algebras and use the second cohomology group to classify infinitesimal deformations.