我在码头的CMD里指定了它。它如预期的那样工作。
start-all.sh
#!/usr/bin/env bash
echo "It's Me Dear"
/etc/init.d/hadoop-hdfs-namenode start
/etc/init.d/hadoop-hdfs-datanode start
/etc/init.d/hadoop-hdfs-secondarynamenode start
/etc/init.d/hadoop-0.20-mapreduce-tasktracker start
sudo -u hdfs hadoop fs -chmod 777 /
/etc/init.d/hadoop-0.20-mapreduce-jobtracker start
/etc/init.d/flume-ng-agent start
/bin/bash
我无法在supervisord中指定同一个文件。我试过了
[program:long_script]
command=bash /usr/local/start-all.sh
以模式777出现在同一个文件中的start-all.sh。我该怎么解决这个问题?
[program:job_tracker]
command=bash -c "/etc/init.d/hadoop-0.20-mapreduce-jobtracker start"
它开始并退出。我查了日志文件。上面说拒绝了许可。我必须在同一个命令中添加sudo -u hdfs hadoop fs -chmod 777 /
。
command=bash -c "sudo -u hdfs hadoop fs -chmod 777 /;/etc/init.d/hadoop-0.20-mapreduce-jobtracker start"
它不起作用。我指定了两个命令,但这也不起作用。有什么想法吗?
编辑
我的文件存在于/usr/local/start-all.sh,如何确保主管是否查看正确的目录?
发布于 2015-02-03 09:52:20
http://supervisord.org/configuration.html#program-x-section-settings
如果您查看示例文件(几个屏幕向下,它们没有那个点的锚),您将看到如下内容:
directory=/tmp
可以指定要从哪个目录运行命令。
还有一个用于监督的用户选项。
user=hdfs
If supervisord runs as root, this UNIX user account will be used as the account which runs the program. If supervisord can’t switch to the specified user, the program will not be started.
https://stackoverflow.com/questions/28299022
复制