# ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
cc:6f:30:76:82:28:96:13:c8:e6:bc:d7:5b:2d:11:d7 root@images-upload
The key's randomart image is:
+--[ RSA 2048]----+
| |
|.. . |
|.o. . . E |
|+ o . +o |
| o= . ..S . |
| ..o. .o* |
| . . . o .o |
| . o .. |
| . |
+-----------------+
# ssh-copy-id root@datanode1.example.com
The authenticity of host 'datanode1.example.com (192.168.2.11)' can't be established.
RSA key fingerprint is f1:0b:b1:63:1a:f6:ac:a3:da:4f:14:b5:f0:cc:df:67.
Are you sure you want to continue connecting (yes/no)? yes 输入yes
Warning: Permanently added 'datanode1.example.com' (RSA) to the list of known hosts.
root@datanode1.example.com's password: 输入密码
Now try logging into the machine, with "ssh 'root@datanode1.example.com'", and check in:
.ssh/authorized_keys
to make sure we haven't added extra keys that you weren't expecting.
# ssh-copy-id root@datanode2.example.com
The authenticity of host 'datanode2.example.com (192.168.2.12)' can't be established.
RSA key fingerprint is f1:0b:b1:63:1a:f6:ac:a3:da:4f:14:b5:f0:cc:df:67.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'datanode2.example.com,192.168.2.12' (RSA) to the list of known hosts.
root@datanode2.example.com's password:
Now try logging into the machine, with "ssh 'root@datanode2.example.com'", and check in:
.ssh/authorized_keys
to make sure we haven't added extra keys that you weren't expecting.
# hadoop namenode -format
13/04/23 14:35:33 INFO namenode.NameNode: STARTUP_MSG:
/************************************************************
STARTUP_MSG: Starting NameNode
STARTUP_MSG: host = namenode.example.com/192.168.2.10
STARTUP_MSG: args = [-format]
STARTUP_MSG: version = 1.1.2
STARTUP_MSG: build = https://svn.apache.org/repos/asf/hadoop/common/branches/branch-1.1 -r 1440782; compiled by 'hortonfo' on Thu Jan 31 02:06:43 UTC 2013
************************************************************/
Re-format filesystem in /var/hadoop/name1 ? (Y or N) Y
13/04/23 14:35:37 INFO util.GSet: VM type = 64-bit
13/04/23 14:35:37 INFO util.GSet: 2% max memory = 2.475 MB
13/04/23 14:35:37 INFO util.GSet: capacity = 2^18 = 262144 entries
13/04/23 14:35:37 INFO util.GSet: recommended=262144, actual=262144
13/04/23 14:35:37 INFO namenode.FSNamesystem: fsOwner=root
13/04/23 14:35:37 INFO namenode.FSNamesystem: supergroup=supergroup
13/04/23 14:35:37 INFO namenode.FSNamesystem: isPermissionEnabled=true
13/04/23 14:35:37 INFO namenode.FSNamesystem: dfs.block.invalidate.limit=100
13/04/23 14:35:37 INFO namenode.FSNamesystem: isAccessTokenEnabled=false accessKeyUpdateInterval=0 min(s), accessTokenLifetime=0 min(s)
13/04/23 14:35:38 INFO namenode.NameNode: Caching file names occuring more than 10 times
13/04/23 14:35:38 INFO common.Storage: Image file of size 110 saved in 0 seconds.
13/04/23 14:35:38 INFO namenode.FSEditLog: closing edit log: position=4, editlog=/var/hadoop/name1/current/edits
13/04/23 14:35:38 INFO namenode.FSEditLog: close success: truncate to 4, editlog=/var/hadoop/name1/current/edits
13/04/23 14:35:38 INFO common.Storage: Storage directory /var/hadoop/name1 has been successfully formatted.
13/04/23 14:35:38 INFO common.Storage: Image file of size 110 saved in 0 seconds.
13/04/23 14:35:38 INFO namenode.FSEditLog: closing edit log: position=4, editlog= /var/hadoop/name2/current/edits
13/04/23 14:35:38 INFO namenode.FSEditLog: close success: truncate to 4, editlog= /var/hadoop/name2/current/edits
13/04/23 14:35:38 INFO common.Storage: Storage directory /var/hadoop/name2 has been successfully formatted.
13/04/23 14:35:38 INFO namenode.NameNode: SHUTDOWN_MSG:
/************************************************************
SHUTDOWN_MSG: Shutting down NameNode at namenode.example.com/192.168.2.10
************************************************************/