This paper proposes novel pilot optimization and channel estimation algorithm for the downlink multiuser massive multiple input multiple output (MIMO) system with $K$ decentralized single antenna mobile stations (MSs), and time division duplex (TDD) channel estimation which is performed by utilizing $N$ pilot symbols. The proposed algorithm is explained as follows. First, we formulate the channel estimation problem as a weighted sum mean square error (WSMSE) minimization problem containing pilot symbols and introduced variables. Second, for fixed pilot symbols, the introduced variables are optimized using minimum mean square error (MMSE) and generalized Rayleigh quotient methods. Finally, for $N=1$ and $N=K$ settings, the pilot symbols of all MSs are optimized using semi definite programming (SDP) convex optimization approach, and for the other settings of $N$ and $K$, the pilot symbols of all MSs are optimized by applying simple iterative algorithm. When $N=K$, it is shown that the latter iterative algorithm gives the optimal pilot symbols achieved by the SDP method. Simulation results confirm that the proposed algorithm achieves less WSMSE compared to that of the conventional semi-orthogonal pilot symbol and MMSE channel estimation algorithm which creates pilot contamination.