摘要:安裝前的檢查安裝之前,你需要先安裝一個(gè)較新的版本的,最好的選擇是,你可以從獲得官方提供的最新版本的。
安裝前的檢查
安裝 Elasticsearch 之前,你需要先安裝一個(gè)較新的版本的 Java,最好的選擇是,你可以從 www.java.com 獲得官方提供的最新版本的 Java。
安裝JDK
sudo yum install java-1.8.0-openjdk.x86_64
測(cè)試
[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
執(zhí)行以下命令
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
測(cè)試是否安裝成功
[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" }安裝報(bào)錯(cuò)處理
Vagrant內(nèi)存不足報(bào)錯(cuò)
[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 啟動(dòng)報(bào)錯(cuò)
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 # 添加如下信息: # [當(dāng)前用戶名] hard nofile 65536 # [當(dāng)前用戶名] 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 安裝報(bào)錯(cuò)處理
vm.max_map_count 報(bào)錯(cuò)
grep vm.max_map_count /etc/sysctl.conf # 如果找不到,則在該文件中添加 vm.max_map_count=262144 然后執(zhí)行 sysctl -p # 臨時(shí)改變輕執(zhí)行 sysctl -w vm.max_map_count=262144
不能以root權(quán)限運(yùn)行問題
請(qǐng)檢查Elasticsearch掛載的目錄是否是root用戶創(chuàng)建的
Kibana鏈接問題
直接通過docker-compose server name鏈接即可
kibana無法登陸問題
# 添加以下選項(xiàng): XPACK_SECURITY_ENABLED: "false"
文章版權(quán)歸作者所有,未經(jīng)允許請(qǐng)勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。
轉(zhuǎn)載請(qǐng)注明本文地址:http://specialneedsforspecialkids.com/yun/27266.html
一、前言我們常常見到很多比較棒的開源項(xiàng)目,但在本地安裝運(yùn)行的話就會(huì)很復(fù)雜,要配置不同的環(huán)境,安裝不同的依賴,好一點(diǎn)的會(huì)用docker直接拉取,或者打包好。這些無疑都會(huì)增加初學(xué)者上手的成本,所以這篇文章總結(jié)了下目前比較常用的解決方法之一:使用docker-compose同時(shí)管理多個(gè)服務(wù),只需要一行命令docker compose up -d,就可以啟動(dòng)一個(gè)包含后端項(xiàng)目、前端項(xiàng)目、數(shù)據(jù)庫(kù)的完整服務(wù)。而...
我們?cè)谑褂胐ocker-compose的時(shí)候,應(yīng)該都會(huì)有速度太慢的問題,今天我們就來了解下怎么加快docker-compose速度。解決辦法只有一個(gè),就是換源。怎么換源呢?我們可以用下面這行程序換源一 換源執(zhí)行sudochmod+x/usr/local/bin/docker-compose為了要防止報(bào)錯(cuò),我們要修改權(quán)限執(zhí)行sudochmod+x/usr/local/bin/docker-compo...
使用docker安裝Mariadb過程中出現(xiàn)了很多問題,這里匯總下啟動(dòng)環(huán)境 centos7一、使用docker-compose啟動(dòng)1、數(shù)據(jù)庫(kù)配置文件新建mysql/my.cnf文件,作為mysql的配置文件skip-name-resolveuser=mysql#user為root,會(huì)導(dǎo)致下面的報(bào)錯(cuò)character-set-server=utf8default_authentication_plu...
閱讀 2066·2021-09-22 15:54
閱讀 1830·2021-09-04 16:40
閱讀 854·2019-08-30 15:56
閱讀 2623·2019-08-30 15:44
閱讀 2150·2019-08-30 13:52
閱讀 1120·2019-08-29 16:35
閱讀 3340·2019-08-29 16:31
閱讀 2562·2019-08-29 13:48