I am getting an error when I tried to restart elasticsearch service

You are absolutely right. The permissions on elasticsearch UID and GID were set as 755 and they couldn't write to the nodes directory. I changed permissions to 777 and that fixed it.