我尝试在linux服务器上运行hive,但一直收到以下错误:
Caused by: ERROR XSDB6: Another instance of Derby may have already booted the database /home/usr/metastore_db
怎么了?我试着这样做:
ps aux | grep spark-shell
ps aux | grep metastore
ps aux | grep derby
但都没有显示任何进程。可能的原因是什么?
我使用以下代码来获取系统中运行的所有进程的详细信息:
Process p = Runtime.getRuntime().exec("ps aux");
BufferedReader stdInput = new BufferedReader(new
InputStreamReader(p.getInputStream()));
BufferedReader stdError = new BufferedReader(new
InputStreamReader(p.getErrorStream()));
我想用管道符号过滤p
我有一个bash脚本(bash,ScreamDaemon.sh),其中添加了一个它的示例未运行的检查。
numscr=`ps aux | grep ScreamDaemon.sh | wc -l`;
if [ "${numscr}" -gt "2" ]; then
echo "an instance of ScreamDaemon still running";
exit 0;
fi
通常,如果没有运行脚本的另一个副本,ps aux \ grep ScreamDaemon.sh ScreamDaemon.sh wc -l应该返回2 (它应
当我为某个进程执行topas时,在CPU%列中显示43%,并跳转到85%。
当我执行:
"ps aux | grep processName"
同样的工艺为5%。
更准确的是什么?我还做了一个类似于Linux "watch“命令的循环,我看到它在%5。
托帕斯和ps有什么区别,谁是对的?
ps的输出:
[ttfai231:root]/root>ps aux | head -1; ps aux | sort -rn +2 | head -10
USER PID %CPU %MEM SZ RSS TTY STAT STIME
现在,我用这个:
ps aux | grep (Example_Process_1) -c
这将返回:
221
这很好,它给了我一个数字,但我必须这样做的100个不同的项目,我们有:
例如,
ps aux | grep (Example_Process_1) -c
ps aux | grep (Example_Process_2) -c
ps aux | grep (Example_Process_3) -c
以此类推。我想要的是一个运行一次的命令,但是输出类似于:
Example Process 1 - 221
Example Process 2 - 360
Example Process
我需要一个单行命令,该命令给定端口号,返回启动在该端口上运行的进程的命令的信息。
通常,我通过运行sudo netstat来获取这些信息。
sudo netstat -antpv | grep PORT_NUMBER
,它返回第4列的PID_NUMBER,列字符(:)之后,然后使用PID_NUMBER作为ps aux的输入。
ps aux | grep PID_NUMBER
它返回第11列上的“启动命令”的信息。
例如:
# use the port number to get the process id
my_machine:~$ sudo netstat -antpv | grep 30
我是linux的新手,我正在努力学习更多,我就是在这种情况下遇到的。
我尝试过使用ps命令和grep来捕获"ca“,但它返回"ca”的每一个实例,无论它来自什么,它实际上对我没有帮助。
我试过这个办法,但行不通。
ps aux | grep ca
find out the process id
and issue kill <process number>
但是grep将捕获所有的"ca“,不管它在哪里,在进程名,目录和任何东西中。
我应该做些什么来实现我所需要的。提前感谢