ES安装避坑-Windows成功安装ES实战
创始人
2025-06-01 04:19:44
0

一、下载地址

https://www.elastic.co/cn/elasticsearch

选择对应版本即可

二、配置操作

# ======================== Elasticsearch Configuration =========================
#
# NOTE: Elasticsearch comes with reasonable defaults for most settings.
#       Before you set out to tweak and tune the configuration, make sure you
#       understand what are you trying to accomplish and the consequences.
#
# The primary way of configuring a node is via this file. This template lists
# the most important settings you may want to configure for a production cluster.
#
# Please consult the documentation for further information on configuration options:
# https://www.elastic.co/guide/en/elasticsearch/reference/index.html
#
# ---------------------------------- Cluster -----------------------------------
#
# Use a descriptive name for your cluster:
#
#cluster.name: my-application
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
#node.name: node-1
#
# Add custom attributes to the node:
#
#node.attr.rack: r1
#
# ----------------------------------- Paths ------------------------------------
#
# Path to directory where to store the data (separate multiple locations by comma):
#
#path.data: /path/to/data
#
# Path to log files:
#
#path.logs: /path/to/logs
#
# ----------------------------------- Memory -----------------------------------
#
# Lock the memory on startup:
#
#bootstrap.memory_lock: true
#
# Make sure that the heap size is set to about half the memory available
# on the system and that the owner of the process is allowed to use this
# limit.
#
# Elasticsearch performs poorly when the system is swapping the memory.
#
# ---------------------------------- Network -----------------------------------
#
# By default Elasticsearch is only accessible on localhost. Set a different
# address here to expose this node on the network:
#
#network.host: 192.168.0.1
#
# By default Elasticsearch listens for HTTP traffic on the first free port it
# finds starting at 9200. Set a specific HTTP port here:
#
http.port: 9200
#
# For more information, consult the network module documentation.
#
# --------------------------------- Discovery ----------------------------------
#
# Pass an initial list of hosts to perform discovery when this node is started:
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
#discovery.seed_hosts: ["host1", "host2"]
#
# Bootstrap the cluster using an initial set of master-eligible nodes:
#
#cluster.initial_master_nodes: ["node-1", "node-2"]
#
# For more information, consult the discovery and cluster formation module documentation.
#
# --------------------------------- Readiness ----------------------------------
#
# Enable an unauthenticated TCP readiness endpoint on localhost
#
#readiness.port: 9399
#
# ---------------------------------- Various -----------------------------------
#
# Allow wildcard deletion of indices:
#
#action.destructive_requires_name: false#----------------------- BEGIN SECURITY AUTO CONFIGURATION -----------------------
#
# The following settings, TLS certificates, and keys have been automatically      
# generated to configure Elasticsearch security features on 21-03-2023 07:44:21
#
# --------------------------------------------------------------------------------# Enable security features
xpack.security.enabled: false xpack.security.enrollment.enabled: true# Enable encryption for HTTP API client connections, such as Kibana, Logstash, and Agents
xpack.security.http.ssl:enabled: falsekeystore.path: certs/http.p12# Enable encryption and mutual authentication between cluster nodes
xpack.security.transport.ssl:enabled: trueverification_mode: certificatekeystore.path: certs/transport.p12truststore.path: certs/transport.p12
# Create a new cluster with the current node only
# Additional nodes can still join the cluster later
cluster.initial_master_nodes: ["ZB-PF2G5QX1"]# Allow HTTP API connections from anywhere
# Connections are encrypted and require user authentication
http.host: 0.0.0.0# Allow other nodes to join the cluster from anywhere
# Connections are encrypted and mutually authenticated
#transport.host: 0.0.0.0#----------------------- END SECURITY AUTO CONFIGURATION -------------------------

其中注意点:

关闭密码验证:xpack.security.enabled: false

关闭SSL验证:

xpack.security.http.ssl:

enabled: false

keystore.path: certs/http.p12

三、验证

http://127.0.0.1:9200/

出现如下界面即可:

四、Python ES Demo示例

遍历Dataframe:

import pandas as pd

persons={'number':['小花','狗蛋','二狗','小草'],'crmFinalTag':[17,20,30,20],'crmFinalTagDesc':['女','男','男','女']}

df=pd.DataFrame(persons)

存入ES:

es.indices.create(index="tmp_crm_grade", ignore=400)

for index,row in df.iterrows():

data = {

"number": row['number'],

"crmFinalTag": row['crmFinalTag'],

"crmFinalTagDesc": row['crmFinalTagDesc']

} # 构建插入数据的结构

相关内容

热门资讯

“每天要加十几个,完不成扣钱或... 临近年末,银行人再次为指标“疯狂”,这次不是存贷款、信用卡等司空见惯的任务,而是企业微信添加考核。 ...
专题:金融支持企业出海实践 编者按:当前,全球经济面临从失序走向秩序,将引发全球贸易格局变革、全球供应链和产业链重置,并重塑全球...
茅台2025收官战:1499元... 蓝鲸新闻12月31日讯(记者 朱欣悦)站在2025年的终点回望,白酒行业这一年走过的路,充满了调整的...
三年半亏160亿,被告了!国投... 被投资者告了的百亿基金经理施成,在管的6只基金,过去三年业绩惨不忍睹,管理费却收了7.5亿元。 ...
最新!深耕长沙再下一城!招商蛇... 12月30日,招商蛇口长沙公司成功竞得[2025]长沙市082号地块(鼓风机厂西地块),成交价为4....
ST路通股东吴爱军拟减持不超过... 12月31日晚间,ST路通(SZ300555,股价14.66元,市值29.32亿元)公告称,持股5%...
原创 存... 财经摆渡人 精研出品 破浪前行,共探财富新局 大家好欢迎收看【古今财鉴】 中国不少银行网点的员工还在...
中国版SpaceX,新一轮融资... 据国家企业信用信息公示系统及企查查,近日,上海垣信卫星科技有限公司(以下简称“垣信卫星”)发生投资人...
全球第四DRAMㄏ商冲击科创板... 瑞财经 王敏 12月31日,据上交所官网,长鑫科技集团股份有限公司(以下简称“长鑫科技”)科创板IP...
两天两家企业上市,宝安境内外上... 深圳商报·读创客户端记者 李丹 资本市场年末收官战,宝安上演“加速度”。 继12月30日卧安机器人登...
原创 老... 2025年7月7日,中国最大中式快餐品牌老乡鸡(LXJ International Holdings...
山西新晋商酒庄集团汾杏股份董事... 新晋商酒庄集团的全体员工及家人们: 日征月迈,岁序更新。当时光的指针划过2025,我们共同站上了新岁...
和讯投顾盖祎楠:2026年A股... 大年能长几个月?15年是半年。19年20年两年的时间走了超强形态,19年是4个月,然后回拨一拨三个月...
年终大手笔!大卖将给员工发约3... 年底跨境圈的关键词只有一个:反差。 安克那边“裁员30%”传闻刚被官方回应为不实,话题还没完全降温,...
中国人民银行发布《非银行支付机... 中国人民银行12月31日对外发布《非银行支付机构分类评级管理办法》,进一步加强非银行支付机构监管,完...
探访潍坊综合保税区:链接全球 ... 站在“十四五”收官与“十五五”开局的历史交汇点,山东潍坊正朝着万亿级城市迈进,勇挑发展大梁,努力成为...
A股收官,黄金ETF全年爆涨!... 潮新闻客户端 记者 吴恩慧 12月31日A股刚收盘,杭州90后投资者周先生看了看他的黄金ETF,“真...
2025全球@中国:制造业繁荣... 2025年,中国在全球变局中书写出稳健增长与深度转型的新篇章。《华尔街日报》以“制造业繁荣与创新爆发...
京基智农6.5亿出售酒店资产,... 12月30日晚,京基智农(000048.SZ)连发两则公告,一卖一买之间勾勒出公司战略转型的新轮廓。...
Kimi账上100亿,杨植麟:... 2025年最后一天,依然令人震撼。 投资界获悉,月之暗面(Kimi)已完成5亿美元C轮融资,且大幅超...