文档章节

run as service Elasticsearch Not Working

 大东家
发布于 2015/08/27 13:20
字数 848
阅读 15
收藏 0

url:http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/setup-service.html#setup-service

running as a service on linux

In order to run elasticsearch as a service on your operating system, the provided packages try to make it as easy as possible for you to start and stop elasticsearch during reboot and upgrades.

linuxedit

Currently our build automatically creates a debian package and an RPM package, which is available on the download page. The package itself does not have any dependencies, but you have to make sure that you installed a JDK.

Each package features a configuration file, which allows you to set the following parameters

ES_USER

The user to run as, defaults to elasticsearch

ES_GROUP

The group to run as, defaults to elasticsearch

ES_HEAP_SIZE

The heap size to start with

ES_HEAP_NEWSIZE

The size of the new generation heap

ES_DIRECT_SIZE

The maximum size of the direct memory

MAX_OPEN_FILES

Maximum number of open files, defaults to 65535

MAX_LOCKED_MEMORY

Maximum locked memory size. Set to "unlimited" if you use the bootstrap.mlockall option in elasticsearch.yml. You must also set ES_HEAP_SIZE.

MAX_MAP_COUNT

Maximum number of memory map areas a process may have. If you use mmapfs as index store type, make sure this is set to a high value. For more information, check the linux kernel documentation about max_map_count. This is set via sysctl before starting elasticsearch. Defaults to 65535

LOG_DIR

Log directory, defaults to /var/log/elasticsearch

DATA_DIR

Data directory, defaults to /var/lib/elasticsearch

WORK_DIR

Work directory, defaults to /tmp/elasticsearch

CONF_DIR

Configuration file directory (which needs to include elasticsearch.ymland logging.yml files), defaults to /etc/elasticsearch

CONF_FILE

Path to configuration file, defaults to /etc/elasticsearch/elasticsearch.yml

ES_JAVA_OPTS

Any additional java options you may want to apply. This may be useful, if you need to set the node.name property, but do not want to change the elasticsearch.yml configuration file, because it is distributed via a provisioning system like puppet or chef. Example: ES_JAVA_OPTS="-Des.node.name=search-01"

RESTART_ON_UPGRADE

Configure restart on package upgrade, defaults to false. This means you will have to restart your elasticsearch instance after installing a package manually. The reason for this is to ensure, that upgrades in a cluster do not result in a continuous shard reallocation resulting in high network traffic and reducing the response times of your cluster.

debian/ubuntuedit

The debian package ships with everything you need as it uses standard debian tools like update update-rc.d to define the runlevels it runs on. The init script is placed at /etc/init.d/elasticsearch as you would expect it. The configuration file is placed at /etc/default/elasticsearch.

The debian package does not start up the service by default. The reason for this is to prevent the instance to accidentally join a cluster, without being configured appropriately. After installing using dpkg -i you can use the following commands to ensure, that elasticsearch starts when the system is booted and then start up elasticsearch:

sudo update-rc.d elasticsearch defaults 95 10
sudo
/etc/init.d/elasticsearch start
installing the oracle jdkedit

The usual recommendation is to run the Oracle JDK with elasticsearch. However Ubuntu and Debian only ship the OpenJDK due to license issues. You can easily install the oracle installer package though. In case you are missing the add-apt-repository command under Debian GNU/Linux, make sure have at least Debian Wheezy and the package python-software-properties installed

sudo add-apt-repository ppa:webupd8team/java
sudo apt
-get update
sudo apt
-get install oracle-java7-installer
java
-version

The last command should verify a successful installation of the Oracle JDK.

rpm based distributionsedit

using chkconfigedit

Some RPM based distributions are using chkconfig to enable and disable services. The init script is located at /etc/init.d/elasticsearch, where as the configuration file is placed at /etc/sysconfig/elasticsearch. Like the debian package the RPM package is not started by default after installation, you have to do this manually by entering the following commands

sudo /sbin/chkconfig --add elasticsearch
sudo service elasticsearch start
using systemdedit

Distributions like SUSE do not use the chkconfig tool to register services, but rather systemd and its command /bin/systemctl to start and stop services (at least in newer versions, otherwise use the chkconfig commands above). The configuration file is also placed at /etc/sysconfig/elasticsearch. After installing the RPM, you have to change the systemd configuration and then start up elasticsearch

sudo /bin/systemctl daemon-reload
sudo
/bin/systemctl enable elasticsearch.service
sudo
/bin/systemctl start elasticsearch.service

Also note that changing the MAX_MAP_COUNT setting in /etc/sysconfig/elasticsearch does not have any effect, you will have to change it in /usr/lib/sysctl.d/elasticsearch.conf in order to have it applied at startup.


解决Elasticsearch service elasticsearch start 失败的问题

Hi,

Here is the way to solve it:

You have to set the variables in /etc/elasticsearch/elasticsearch.yml:
path.data:  path/to/data
path.work:  path/to/work
path.logs:  /var/log/elasticsearch
path.conf: /etc/elasticsearch

And remember to give access to user "elasticsearch" for folder that elasticsearch uses:
chown -R elasticsearch /path/to/data
chown -R elasticsearch /path/to/work

Regards. 


SRC URL:http://elasticsearch-users.115913.n3.nabble.com/Elasticsearch-Not-Working-td4059398.html


本文转载自:http://blog.csdn.net/xiaohelong2005/article/details/43489801

粉丝 22
博文 255
码字总数 111936
作品 0
长沙
项目经理
私信 提问
Hibernate Search 5.6.0.Beta4 和 5.7.0.Beta1 发布

Hibernate Search 5.6.0.Beta4 和 5.7.0.Beta1 发布了,Hibernate Search的作用是对数据库中的数据进行检索的。它是hibernate对著名的全文检索系统Lucene的一个集成方案,作用在于对数据表中...

两味真火
2016/11/30
1K
11
乞丐亦异/ansible-elk-deploy

Deploy ELK stack, ready for production. Note All settings are use default value. I re-command you to have at least 3 nodes(8CPUs, 16GB memory, 128GB free disk space) to deploy y......

乞丐亦异
2018/07/16
0
0
elasticsearch6.X 及head插件部署(完整版)-开机自启动脚本

本文介绍了elasticsearch集群及head插件部署流程,包括后台启动脚本、开机自启动,面向生产环境的部署方式供大家参考。 因工作环境问题,几乎所有内容都是手打的,自己边部署边记录问题及步骤...

jxlgzwh
05/01
48
0
Grafana、elasticsearch、kafka、logstash和pinpoint结合

一、Grafana 1)下载安装 wget https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-4.2.0-1.x8664.rpm sudo yum localinstall grafana-4.2.0-1.x86_64.rpm 2)启动 serv......

半船水
2017/10/25
262
0
Docker 部署ELK 日志分析

Docker 部署ELK 日志分析 elk集成镜像包 名字是 sebp/elk 安装 docke、启动 yum install docke service docker start Docker至少得分配3GB的内存;不然得加参数 -e ESMINMEM=128m -e ESMAXM...

yikayi
2018/06/08
0
0

没有更多内容

加载失败,请刷新页面

加载更多

分布式协调服务zookeeper

ps.本文为《从Paxos到Zookeeper 分布式一致性原理与实践》笔记之一 ZooKeeper ZooKeeper曾是Apache Hadoop的一个子项目,是一个典型的分布式数据一致性的解决方案,分布式应用程序可以基于它...

ls_cherish
今天
4
0
redis 学习2

网站 启动 服务端 启动redis 服务端 在redis 安装目录下 src 里面 ./redis-server & 可以指定 配置文件或者端口 客户端 在 redis 的安装目录里面的 src 里面 ./redis-cli 可以指定 指定 连接...

之渊
昨天
2
0
Spring boot 静态资源访问

0. 两个配置 spring.mvc.static-path-patternspring.resources.static-locations 1. application中需要先行的两个配置项 1.1 spring.mvc.static-path-pattern 这个配置项是告诉springboo......

moon888
昨天
4
0
hash slot(虚拟桶)

在分布式集群中,如何保证相同请求落到相同的机器上,并且后面的集群机器可以尽可能的均分请求,并且当扩容或down机的情况下能对原有集群影响最小。 round robin算法:是把数据mod后直接映射...

李朝强
昨天
4
0
Kafka 原理和实战

本文首发于 vivo互联网技术 微信公众号 https://mp.weixin.qq.com/s/bV8AhqAjQp4a_iXRfobkCQ 作者简介:郑志彬,毕业于华南理工大学计算机科学与技术(双语班)。先后从事过电子商务、开放平...

vivo互联网技术
昨天
24
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部