集群启动/运维常用指令

613 阅读1分钟

CDH

hd start/stauts/stop

#主
/opt/cm-5.15.0/etc/init.d/cloudera-scm-server start
#所有
/opt/cm-5.15.0/etc/init.d/cloudera-scm-agent start


# 查询状态
/opt/cm-5.15.0/etc/init.d/cloudera-scm-agent status
/opt/cm-5.15.0/etc/init.d/cloudera-scm-server status


# 查询日志
tail -f /opt/cm-5.15.0/log/cloudera-scm-agent/cloudera-scm-agent.log
tail -f /opt/cm-5.15.0/log/cloudera-scm-agent/cloudera-scm-server.log


# 关闭
/opt/cm-5.15.0/etc/init.d/cloudera-scm-agent stop
/opt/cm-5.15.0/etc/init.d/cloudera-scm-server stop


# 退出安全模式
sudo -uhdfs hdfs dfsadmin -safemode leave


# Datanode健康状况
hdfs datanode


#清空回收站
hdfs dfs -expunge


#clock off set,查询时间差
ntpdc -np


#批量中止
ps -ef | grep spark | grep -v grep | awk '{print $2}' | xargs 

airflow

登陆airflow用户

/root/bin/af

cd /home/airflow/
rm -rf *.pid
# 删除所有pid,然后
airflow webserver -D
airflow scheduler -D
airflow worker -D
airflow flower -D

Linux

查找文件

find / -name hive-site.xml

Hive

查询表的最后修改时间

时间转换

tool.chinaz.com/tools/unixt…

或者

SELECT CAST(from_unixtime(your_transient_lastDdlTime_value) AS timestamp);