外部访问
修改配置使其可以从外部访问
network.host 可以绑定IP到主机IP,也可以对所有 0.0.0.0 打开
代码语言:javascript复制[root@h102 elasticsearch]# vim elasticsearch.yml
[root@h102 elasticsearch]# grep host elasticsearch.yml | grep -v "^#"
network.host: 0.0.0.0
[root@h102 elasticsearch]# /etc/init.d/elasticsearch restart
Stopping elasticsearch: [ OK ]
Starting elasticsearch: [ OK ]
[root@h102 elasticsearch]#
打开防火墙
代码语言:javascript复制[root@h102 ~]# grep 9200 /etc/sysconfig/iptables
-A INPUT -p tcp -m state --state NEW -m tcp --dport 9200 -j ACCEPT
[root@h102 ~]# /etc/init.d/iptables reload
iptables: Trying to reload firewall rules: [ OK ]
[root@h102 ~]# iptables -L -nv | grep 9200
0 0 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:9200
[root@h102 ~]#
现在可以从外面进行访问了
命令汇总
rpm -ql elasticsearch-2.1.1-1.noarch | grep plugin
/usr/share/elasticsearch/bin/plugin -h
/usr/share/elasticsearch/bin/plugin list -h
/usr/share/elasticsearch/bin/plugin remove -h
/usr/share/elasticsearch/bin/plugin list
ll /usr/share/elasticsearch/plugins
/usr/share/elasticsearch/bin/plugin install -h
/usr/share/elasticsearch/bin/plugin install mobz/elasticsearch-head
echo $?
/usr/share/elasticsearch/bin/plugin list
ll /usr/share/elasticsearch/plugins
vim elasticsearch.yml
grep host elasticsearch.yml | grep -v "^#"
/etc/init.d/elasticsearch restart
grep 9200 /etc/sysconfig/iptables
/etc/init.d/iptables reload
iptables -L -nv | grep 9200
原文地址