User Management
Recently I have been setting up a CDH cluster of about 10 nodes. The cluster uses 10 CentOS 6.7 servers, so I frequently need to use Linux user management commands.
Change password
1passwdEnter the new password and confirm it. For security, the password should include uppercase and lowercase letters, numbers, and special characters. Linux will also remind you of the password rules.
Switch user
1su hdfsThis switches to the hdfs user.
Alternatively, without switching users, you can execute a command or access a file with a specific user’s permissions:1su hdfs hadoop fs -mkdir /user/hdfs/testThis creates a test directory at
/user/hdfs/on the cluster using hdfs user permissions.
File Management
Create a directory
| |
Create a file
| |
Timezone Selection
Follow the prompts to select a timezone, then enter the suggested command.
1tzselectModify the timezone in the clock file.
1 2vi /etc/sysconfig/clock ZONE="Asia/Shanghai"Delete the existing localtime and create a new one.
1 2rm /etc/localtime ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
Run Commands at Startup
Edit the rc.local file
| |
Start the NTP Service to Sync with a Time Server on the LAN
| |
[To be continued…]