摘要:安装前的检查安装之前,你需要先安装一个较新的版本的,最好的选择是,你可以从获得官方提供的最新版本的。
安装前的检查
安装 Elasticsearch 之前,你需要先安装一个较新的版本的 Java,最好的选择是,你可以从 www.java.com 获得官方提供的最新版本的 Java。
安装JDK
sudo yum install java-1.8.0-openjdk.x86_64
测试
[vagrant@localhost vagrant_data]$ java -version openjdk version "1.8.0_161" OpenJDK Runtime Environment (build 1.8.0_161-b14) OpenJDK 64-Bit Server VM (build 25.161-b14, mixed mode)安装Elasticsearch
执行以下命令
curl -L -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.6.8.tar.gz tar -xvf elasticsearch-5.6.8.tar.gz cd elasticsearch-5.6.8/bin ./elasticsearch
测试是否安装成功
[vagrant@localhost elasticsearch-5.6.8]$ curl "http://localhost:9200/?pretty" { "name" : "Lx20sHw", "cluster_name" : "elasticsearch", "cluster_uuid" : "gnYSlRb9TUqpVnBscm1-GQ", "version" : { "number" : "5.6.8", "build_hash" : "688ecce", "build_date" : "2018-02-16T16:46:30.010Z", "build_snapshot" : false, "lucene_version" : "6.6.1" }, "tagline" : "You Know, for Search" }安装报错处理
Vagrant内存不足报错
[vagrant@localhost elasticsearch-5.6.8]$ ./bin/elasticsearch OpenJDK 64-Bit Server VM warning: If the number of processors is expected to increase from one, then you should configure the number of parallel GC threads appropriately using -XX:ParallelGCThreads=N OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x0000000085330000, 2060255232, 0) failed; error="Cannot allocate memory" (errno=12) # # There is insufficient memory for the Java Runtime Environment to continue. # Native memory allocation (mmap) failed to map 2060255232 bytes for committing reserved memory. # An error report file with more information is saved as: # /vagrant_data/elasticsearch-5.6.8/hs_err_pid22178.log [vagrant@localhost elasticsearch-5.6.8]$ free -m total used free shared buff/cache available Mem: 488 101 88 3 297 340 Swap: 1535 1 1534
解决方法:
打开Vagrantfile
添加如下信息:
config.vm.provider "virtualbox" do |v| v.memory = 2048 v.cpus = 2 end
重启Vagrant vagrant reload
ElasticSearch 启动报错
ERROR: [2] bootstrap checks failed [1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536] [2]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
解决方法:
sudo vim /etc/security/limits.conf # 添加如下信息: # [当前用户名] hard nofile 65536 # [当前用户名] soft nofile 65536 # 保存退出 ******************************************************************* sysctl -w vm.max_map_count=655360 sysctl -a | grep "vm.max_map_count"docker-compose 安装
version: "3" services: php_pc: image: php:7.2-cli container_name: pcsoft_php ports : - "9000:9000" volumes: - ./phpcli:/var/www/html/ db_pc: image: mysql:5.7 container_name: pcsoft_db volumes: - ./dbdata:/var/lib/mysql/ ports: - "3306:3306" environment: MYSQL_USER: root MYSQL_PASSWORD: root MYSQL_ROOT_PASSWORD: root elasticsearch_soft: image: registry.cn-hangzhou.aliyuncs.com/amor/elastic:6.2.3 container_name: es_pc_soft environment: - cluster.name=docker-cluster - bootstrap.memory_lock=true - xpack.security.enabled=false - "ES_JAVA_OPTS=-Xms2g -Xmx2g" ulimits: memlock: soft: -1 hard: -1 volumes: - ./docker_es/esdata_soft:/usr/share/elasticsearch/data ports: - 9200:9200 elasticsearch_game: image: registry.cn-hangzhou.aliyuncs.com/amor/elastic:6.2.3 container_name: es_pc_game environment: - cluster.name=docker-cluster - bootstrap.memory_lock=true - xpack.security.enabled=false - "ES_JAVA_OPTS=-Xms2g -Xmx2g" - "discovery.zen.ping.unicast.hosts=es_pc_soft" ulimits: memlock: soft: -1 hard: -1 volumes: - ./docker_es/esdata_game:/usr/share/elasticsearch/data kibana: image: registry.cn-hangzhou.aliyuncs.com/amor/kibana:6.2.3 container_name: es_pc_kibana environment: SERVER_NAME: kibana.pc_amor.com ELASTICSEARCH_URL: http://elasticsearch_soft:9200 XPACK_SECURITY_ENABLED: "false"docker-compose 安装报错处理
vm.max_map_count 报错
grep vm.max_map_count /etc/sysctl.conf # 如果找不到,则在该文件中添加 vm.max_map_count=262144 然后执行 sysctl -p # 临时改变轻执行 sysctl -w vm.max_map_count=262144
不能以root权限运行问题
请检查Elasticsearch挂载的目录是否是root用户创建的
Kibana链接问题
直接通过docker-compose server name链接即可
kibana无法登陆问题
# 添加以下选项: XPACK_SECURITY_ENABLED: "false"
文章版权归作者所有,未经允许请勿转载,若此文章存在违规行为,您可以联系管理员删除。
转载请注明本文地址:https://www.ucloud.cn/yun/27266.html
一、前言我们常常见到很多比较棒的开源项目,但在本地安装运行的话就会很复杂,要配置不同的环境,安装不同的依赖,好一点的会用docker直接拉取,或者打包好。这些无疑都会增加初学者上手的成本,所以这篇文章总结了下目前比较常用的解决方法之一:使用docker-compose同时管理多个服务,只需要一行命令docker compose up -d,就可以启动一个包含后端项目、前端项目、数据库的完整服务。而...
我们在使用docker-compose的时候,应该都会有速度太慢的问题,今天我们就来了解下怎么加快docker-compose速度。解决办法只有一个,就是换源。怎么换源呢?我们可以用下面这行程序换源一 换源执行sudochmod+x/usr/local/bin/docker-compose为了要防止报错,我们要修改权限执行sudochmod+x/usr/local/bin/docker-compo...
使用docker安装Mariadb过程中出现了很多问题,这里汇总下启动环境 centos7一、使用docker-compose启动1、数据库配置文件新建mysql/my.cnf文件,作为mysql的配置文件skip-name-resolveuser=mysql#user为root,会导致下面的报错character-set-server=utf8default_authentication_plu...
阅读 2007·2021-09-22 15:54
阅读 1800·2021-09-04 16:40
阅读 829·2019-08-30 15:56
阅读 2594·2019-08-30 15:44
阅读 2098·2019-08-30 13:52
阅读 1068·2019-08-29 16:35
阅读 3304·2019-08-29 16:31
阅读 2532·2019-08-29 13:48