Look into Constraint Equations.
Note that the equation is 0 = a X1 + b X2 so if you want X1 and X2 to have the same displacement along X, a = 1 , b = -1.
X1 is a node on the centerline, X2 is the node above it.
A much simpler approach is to use shell elements so there is only one layer of nodes on the center plane.