We believe that you can start the cluster service in the following way by setting up a distributed Hadoop environment in the previous article.

[root@localhost mmcc]# hadoop-daemon.sh start namenode
[root@localhost mmcc]Sh start datanode // slave nodes slave1, slave2
Copy the code

But you might say, well, a cluster a cluster must be a group of servers and you don’t have to start up or shut down one by one every time you start up, that’s not muddleheaded. This article will teach you how to configure centerOS7 for secure login and cluster-free startup.

One-click start/stop cluster services

start/stop-dfs.sh
Copy the code

This command enables namenode and secondaryNameNode on the master node and Datanodes on all slave nodes in the cluster. But at this point you may find a button to start the cluster by the way, each node needs to login password (including the master node itself also want to enter the password, so the back also to master configuration public key nodes), if the server too much would be very complicated, so we will give each from dense login server configuration, In this way, the subsequent startup can be started with one key

Avoid close to start

Go to the SSH directory

cd ~/.ssh
Copy the code

Execute the following command

ssh-keygen -t rsa
Copy the code

Generate public and private keys using RSA asymmetric encryption algorithm. Second, the public key is copied to the master and other slave slave nodes. You can log in to all nodes on the master node without password

Ssh-copy-id master/ IP address ssh-copy-id slave1/ IP address ssh-copy-id slave2/ IP addressCopy the code

In this case, shut down the Namenode and Datanode nodes that have been started. Performed again

start/stop-dfs.sh
Copy the code

You can find that you do not need to enter the password again, started all the nodes