sh 在CentOS 6.4上安装ElasticSearch的命令

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh 在CentOS 6.4上安装ElasticSearch的命令相关的知识,希望对你有一定的参考价值。

# install missing libraries (if any)
cd ~
sudo yum update
yum install java-1.7.0-openjdk.x86_64
yum install unzip
yum install mc
yum install wget
yum install curl

# get and unpack elasticsearch zip file
cd /etc
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.90.5.zip
unzip elasticsearch-0.90.5.zip
rm elasticsearch-0.90.5.zip
mv elasticsearch-0.90.5 elasticsearch

# install elasticsearch plugins
cd elasticsearch/bin
./plugin -install mobz/elasticsearch-head
./plugin -install karmi/elasticsearch-paramedic
./plugin -url http://bit.ly/GMYV9l -install river-jdbc
cd /etc/elasticsearch/lib
wget http://qiiip.org/mysql-connector-java-5.1.26-bin.jar

# make elasticsearch runnable as a service
cd ~
curl -L http://github.com/elasticsearch/elasticsearch-servicewrapper/tarball/master | tar -xz
mv *servicewrapper*/service /etc/elasticsearch/bin/
rm -Rf *servicewrapper*
sudo /etc/elasticsearch/bin/service/elasticsearch install

# set elasticsearch to run on boot
sudo /sbin/chkconfig elasticsearch on
sudo /sbin/chkconfig --list

# open port 9200 (for http) and 9300 (for tcp)
sudo iptables -L -n
iptables -A INPUT -p tcp -m tcp --dport 9200 -j ACCEPT
iptables -A INPUT -p tcp -m tcp --dport 9300 -j ACCEPT
service iptables save

# set min max memory variables
export ES_MIN_MEM=5G
export ES_MAX_MEM=5G

# restart server
service elasticsearch restart
tail -f /etc/elasticsearch/logs/elasticsearch.log

######################################################

#To find your elasticsearch home directory & install plugin(s) follow these steps below.

#Locate your home directory ( Look for Settings -> Path -> Home for value )
curl "localhost:9200/_nodes/settings?pretty=true"

#Goto Location (Example settings.path.home value: /usr/local/Cellar/elasticsearch/1.5.0)
cd /usr/local/Cellar/elasticsearch/1.5.0

#Install Plugin (Example plugin: mobz/elasticsearch-head)
bin/plugin -install mobz/elasticsearch-head

以上是关于sh 在CentOS 6.4上安装ElasticSearch的命令的主要内容,如果未能解决你的问题,请参考以下文章

sh 在CentOS 6.4上安装ElasticSearch的命令

CentOS 6.4_64下安装LANMP_WDCP2.5以及升级PHPMYSQL版本流程

无法在 Centos 6.4 上安装 php 5.5 opcache

在 Centos 6.4 上安装 MySQL 5.6 的最佳方法

Mongodb安装(Centos 6.4 32位)

CentOS 6.4安装Puppet