在root用户下
1.
vim /etc/init.d/elasticsearch
#!/bin/sh
#chkconfig: 2345 80 05
#description: elasticsearch
export JAVA_HOME=/usr/java/jdk
export JAVA_BIN=/usr/java/jdk/bin
export PATH=$PATH:$JAVA_HOME
在root用户下
1.
vim /etc/init.d/elasticsearch
#!/bin/sh
#chkconfig: 2345 80 05
#description: elasticsearch
export JAVA_HOME=/usr/java/jdk
export JAVA_BIN=/usr/java/jdk/bin
export PATH=$PATH:$JAVA_HOME