Skip to content

Latest commit

 

History

History
71 lines (53 loc) · 1.63 KB

klaster-polecenia.md

File metadata and controls

71 lines (53 loc) · 1.63 KB

Usuwanie poprzednich wpisów

for i in {1..5..1}; do ssh-keygen -f "/home/radek/.ssh/known_hosts" -R hdp${i}; done
for i in {1..5..1}; do ssh-keygen -f "/home/radek/.ssh/known_hosts" -R hdpoc${i}; done
for i in {1..5..1}; do ssh-keygen -f "/home/radek/.ssh/known_hosts" -R aws${i}; done

Uptime

for i in {1..5..1}; do ssh hdp${i} uptime; done
for i in {1..5..1}; do ssh aws${i} uptime; done

Usuwanie adresów ip z known hosts

ssh-keygen -R 176.119.46.247

Połączenie się do maszyn

cssh hdp{1..5}
cssh aws{1..5}

Lista użytkowników

for i in `cat /tmp/users.txt`; do echo ${i}; done

Tworzenie użytkownika

for i in `cat /tmp/users.txt`; do adduser ${i} ; done
for i in `cat /tmp/users.txt`; do echo "${i}:${i}" | chpasswd ; done

HDFS - create

for i in `cat /tmp/users.txt`; do hdfs dfs -mkdir /user/${i}; done
for i in `cat /tmp/users.txt`; do hdfs dfs -chown ${i} /user/${i}; done

HDFS - snapshot

for i in `cat /tmp/users.txt`; do hdfs dfsadmin -allowsnapshot /user/${i}/snap; done

HDFS - delete

for i in `cat /tmp/users.txt`; do hdfs dfs -rm -r -skipTrash /user/${i}; done

Usuwanie użytkowników

for i in `cat /tmp/users.txt`; do userdel -r  ${i} ; done

Czyszczenie Hive'a

hdfs dfs -ls /warehouse/tablespace/managed/hive
hdfs dfs -ls /warehouse/tablespace/external/hive

for i in `cat /tmp/users.txt`; do hdfs dfs -rm -r -skipTrash /warehouse/tablespace/external/hive/${i}; done
for i in `cat /tmp/users.txt`; do hdfs dfs -rm -r -skipTrash /warehouse/tablespace/external/hive/${i}.db; done