How to install and setup x-pack on two node with one cluster?

Step 1: install elasticsearch on master and data node
Step 2: install x-pack on Master node
Step 3: Master Node - Restart elasticsearch and set up x-pack password

D:\ELK\elasticsearch-6.2.3\bin\x-pack>setup-passwords auto
Initiating the setup of passwords for reserved users elastic,kibana,logstash_system.
The passwords will be randomly generated and printed to the console.
Please confirm that you would like to continue [y/N]y
Connection failure to: http://34.xx.xx.xx:9200/_xpack/security/user/kibana/_password?pretty failed: Read timed out 
ERROR: Failed to set password for user [kibana].

Step 4: Data Node - Restart elasticsearch and install x-pack, again restart elasticsearch and setup password

D:\ELK\elasticsearch-6.2.3\bin\x-pack>setup-passwords auto
Initiating the setup of passwords for reserved users elastic,kibana,logstash_system.

Changed password for user kibana
PASSWORD kibana = LIXWOpQvVXRAsSjwe8ob

Changed password for user logstash_system
PASSWORD logstash_system = dJLYCTi9ZrHT34azxmms

Changed password for user elastic
PASSWORD elastic = C7hOKNU4Kol1hGc0DmRj

Reffered from here and point 1 to 4, How do i fix step 3 issue?