当前位置: 首页 > news >正文

网站建设的系统分析官网网页制作

网站建设的系统分析,官网网页制作,wordpress 小工具 调用,助君网络本文主要介绍linux下elasticsearch的部署。通过在一台linux服务器中分别对elasticsearch-6.7.2版本,elasticsearch-7.3.0版本来进行安装,记录在安装elasticsearch-7.3.0版本时出现的异常情况,以及elasticsearch-head的安装。 基础环境 本机已…

本文主要介绍linux下elasticsearch的部署。通过在一台linux服务器中分别对elasticsearch-6.7.2版本,elasticsearch-7.3.0版本来进行安装,记录在安装elasticsearch-7.3.0版本时出现的异常情况,以及elasticsearch-head的安装。

基础环境

本机已经安装、配置了jdk 1.8 版本的继续环境,nodejs环境(elasticsearch-head安装需要)。

使用以下网盘地址,下载需要版本的elasticsearch包

通过网盘分享的文件:elasticsearch-7.3.0-linux-x86_64.tar.gz
链接: https://pan.baidu.com/s/1hSRQgoOvz-aOj1MqcGgMow 提取码: xiao
通过网盘分享的文件:elasticsearch-6.7.2.tar.gz
链接: https://pan.baidu.com/s/1uoHF70mqxB2o_sjx3WzsUA 提取码: xiao

在github中,下载最新的elasticsearch-head包

源码地址:https://github.com/mobz/elasticsearch-head/
安装包地址:https://github.com/mobz/elasticsearch-head/releases/tag/v5.0.0

启动elasticsearch服务不能使用root账号,所以需要新建一个用户,用来启动elasticsearch服务

adduser es
passwd es

安装6.7.2版本

  • 解压压缩文件

    cd /data2
    tar -zxvf elasticsearch-6.7.2.tar.gz
    
  • 更改配置文件elasticsearch.yml

    path.data: /data2/elasticsearch-6.7.2/data
    path.logs: /data2/elasticsearch-6.7.2/logs
    network.host: 0.0.0.0
    http.port: 8099
    
  • 切换es用户启动

    su es
    cd /data2/elasticsearch-6.7.2
    # 后台启动elasticsearch服务
    ./bin/elasticsearch -d
    
  • 查看是否启动成功

    1. 查看日志

      cd /data2/elasticsearch-6.7.2/logs
      # 查看日志是否正常启动
      tail -f elasticsearch.log
      
    2. 查看进程

      ps -ef |grep elasticsearch
      
    3. 查看api:http://10.10.87.20:8099/

      {"name" : "6W3MY3q","cluster_name" : "elasticsearch","cluster_uuid" : "Obz1OlM9S4KcLEKN6SYkdg","version" : {"number" : "6.7.2","build_flavor" : "default","build_type" : "tar","build_hash" : "56c6e48","build_date" : "2019-04-29T09:05:50.290371Z","build_snapshot" : false,"lucene_version" : "7.7.0","minimum_wire_compatibility_version" : "5.6.0","minimum_index_compatibility_version" : "5.0.0"},"tagline" : "You Know, for Search"
      }
      

安装7.3.0版本

elasticsearch 7以上版本开始内置了jdk,如本文中部署的7.3.0版本就内置了jdk 11,如果使用的服务器已经安装配置了jdk 1.8的话,可以直接使用elasticsearch-7.3.0自带的jdk。

  • 解压压缩文件

    cd /data2
    tar -zxvf elasticsearch-7.3.0-linux-x86_64.tar.gz
    
  • 更改配置文件elasticsearch.yml

    path.data: /data2/elasticsearch-7.3.0/data
    path.logs: /data2/elasticsearch-7.3.0/logs
    network.host: 0.0.0.0
    http.port: 19200
    #  以下配置都是出现异常后的,新增的配置 一台服务器中部署两个elasticsearch不同版本的服务
    #  注:node.name 的值要与 cluster.initial_master_nodes 的值保持一致
    node.name: node-2
    discovery.seed_hosts: ["127.0.0.1"]
    cluster.initial_master_nodes: ["node-2"]
    
  • 更改配置文件jvm.options

    # 由于在启动时,出现了异常,需要更换GC算法
    #-XX:+UseConcMarkSweepGC
    -XX:+UseG1GC
    
  • 更换脚本文件elasticsearch-env

    #if [ ! -z "$JAVA_HOME" ]; then
    #  JAVA="$JAVA_HOME/bin/java"
    #else
    #  if [ "$(uname -s)" = "Darwin" ]; then
    #    # OSX has a different structure
    #    JAVA="$ES_HOME/jdk/Contents/Home/bin/java"
    #  else
    #    JAVA="$ES_HOME/jdk/bin/java"
    #  fi
    #fi
    # 将以上原始的脚本段注释掉,使用以下内容;JAVA 为 elasticsearch自带的jdk的路径
    if [ ! -z "$JAVA_HOME" ]; thenJAVA="/data2/elasticsearch-7.3.0/jdk/bin/java"
    elseif [ "$(uname -s)" = "Darwin" ]; then# OSX has a different structureJAVA="/data2/elasticsearch-7.3.0/jdk/bin/java"elseJAVA="/data2/elasticsearch-7.3.0/jdk/bin/java"fi
    fi
    
  • 切换es用户启动

    su es
    cd /data2/elasticsearch-7.3.0
    # 后台启动elasticsearch服务
    ./bin/elasticsearch -d
    
  • 查看是否启动成功

    1. 查看日志

      cd /data2/elasticsearch-7.3.0/logs
      # 查看日志是否正常启动
      tail -f elasticsearch.log
      
    2. 查看进程

      ps -ef |grep elasticsearch
      
    3. 查看api:http://10.10.87.20:19200/

      {"name" : "centos74-0.novalocal","cluster_name" : "elasticsearch","cluster_uuid" : "_na_","version" : {"number" : "7.3.0","build_flavor" : "default","build_type" : "tar","build_hash" : "de777fa","build_date" : "2019-07-24T18:30:11.767338Z","build_snapshot" : false,"lucene_version" : "8.1.0","minimum_wire_compatibility_version" : "6.8.0","minimum_index_compatibility_version" : "6.0.0-beta1"},"tagline" : "You Know, for Search"
      }
      

安装elasticsearch异常情况

  • 出现以下错误,说明默认走的内置的jdk 11的,便需要更改启动脚本elasticsearch-env中的配置信息

    bash-4.2$ ./bin/elasticsearch -d
    future versions of Elasticsearch will require Java 11; your Java version from [/usr/local/java/jdk1.8.0_73/jre] does not meet this requirement
    
    vim elasticsearch-env# 注释以下 内容
    # now set the path to java
    #if [ ! -z "$JAVA_HOME" ]; then
    #  JAVA="$JAVA_HOME/bin/java"
    #else
    #  if [ "$(uname -s)" = "Darwin" ]; then
    #    # OSX has a different structure
    #    JAVA="$ES_HOME/jdk/Contents/Home/bin/java"
    #  else
    #    JAVA="$ES_HOME/jdk/bin/java"
    #  fi
    #fi
    # 将被注释的配置块,复制一份,将JAVA的信息更给为 elasticsearch自带的jdk的路径
    if [ ! -z "$JAVA_HOME" ]; thenJAVA="/data2/elasticsearch-7.3.0/jdk/bin/java"
    elseif [ "$(uname -s)" = "Darwin" ]; then# OSX has a different structureJAVA="/data2/elasticsearch-7.3.0/jdk/bin/java"elseJAVA="/data2/elasticsearch-7.3.0/jdk/bin/java"fi
    fi
  • 出现以下错误,说明需要更换GC算法,便需要更改jvm.options中的配置信息

    OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
    
    cd jvm.options
    # 从ConcMarkSweepGC切换到G1GC
    #-XX:+UseConcMarkSweepGC
    -XX:+UseG1GC
    
  • 当启动时出现以下异常信息时,需要更给配置文件elasticsearch.yml中的配置信息

    [2024-11-04T16:58:51,926][ERROR][o.e.b.Bootstrap          ] [centos74-0.novalocal] node validation exception
    [1] bootstrap checks failed
    [1]: the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured
    [2024-11-04T16:58:51,929][INFO ][o.e.n.Node               ] [centos74-0.novalocal] stopping ...
    [2024-11-04T16:58:51,951][INFO ][o.e.n.Node               ] [centos74-0.novalocal] stopped
    [2024-11-04T16:58:51,951][INFO ][o.e.n.Node               ] [centos74-0.novalocal] closing ...
    [2024-11-04T16:58:51,965][INFO ][o.e.n.Node               ] [centos74-0.novalocal] closed
    [2024-11-04T16:58:51,968][INFO ][o.e.x.m.p.NativeController] [centos74-0.novalocal] Native controller process has stopped - no new native processes can be started
    
    discovery.seed_hosts: ["127.0.0.1"]
    cluster.initial_master_nodes: ["node-1"]
    

安装elasticsearch-head

  • 解压压缩文件

    cd /data2
    tar -zxvf elasticsearch-head-5.0.0.tar.gz
    
  • 编辑Gruntfile.js,添加hostname

    vim Gruntfile.jshostname: '*',
    port: 9100,
    base: '.',
    keepalive: true
    
  • 更改配置文件elasticsearch.yml

    # 进入安装目录
    cd elasticsearch-head-5.0.0
    # 安装
    npm install --registry=https://registry.npmmirror.com/
    
  • 启动服务

    #前台启动
    npm run start
    # 后台启动:
    nohup npm run-script start & 
    
  • 查看是否启动成功,访问http://10.10.87.20:9100/

    image-20241104224919622

安装elasticsearch-head异常情况

当elasticsearch-head启动正常,elasticsearch也启动正常,但是无法通过elasticsearch-head连接elasticsearch服务。

image-20241105102608216

需要更改elasticsearch的配置文件elasticsearch.yml,进行跨域访问。

# 在配置文件末尾添加以下配置
http.cors.enabled: true
http.cors.allow-origin: "*"

重启elasticsearch后,访问http://10.10.87.20:9100/

image-20241105110454437

http://www.yayakq.cn/news/22780/

相关文章:

  • 怎么自己建立公司网站北京市市场监督管理局官网
  • 网站死链接扫描精选网页设计
  • 摄影师网站做原型的网站
  • 有哪个网站做策划方案的做教育网站有什么好处
  • 沈阳网页建站模板四年级的简短新闻播报
  • 途牛旅游网站建设背景简单网站制作成品
  • 自己做的网页怎么连接到网站福州做网站设计公司
  • wordpress网站管理员插件合肥网站建设公司哪家好
  • 让建站公司做网站需要什么seo技术中心
  • 购物网站的前台功能国内4大现货交易所
  • 建德网站制作公司厦门seo传播
  • 网站不备案有什么后果网站建设方案机构
  • 上海网站建设排名公司哪家好曙光建设有限公司网站
  • ps怎样做网站大图公司网站怎么免费建
  • 网站内部链接的策略多语言网站开发公司
  • seo网站建设及扩词淘宝网页设计招聘
  • 网站功能设计怎么写大连做网站哪家便宜
  • 玩客云做网站咸阳市建设工程信息网
  • 山东德州网站建设哪家最好wordpress 每页文章数量
  • 做网站空间哪家好seo学徒
  • 小米wifi设置网址入口网站淄博网站建设多少钱
  • php网站开发心得3500字如何出售自己的域名
  • 国内大型网站制作网站正在建设中 页面
  • 合肥网站建衡水网站公司
  • 丰台网站建设多少钱武昌网站建设制作
  • h5企业网站开发做洗化的网站
  • 西宁市城乡规划建设局网站wordpress花园网站
  • 多大的服务器可以做视频网站保险代理公司
  • 网站长尾关键词排名软件wordpress开发者文档
  • 网站图片多 如何优化vps怎么做多个网站