企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
1.下载文件 wget https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/rpm/elasticsearch/2.4.1/elasticsearch-2.4.1.rpm 2.安装 yum -y install elasticsearch-2.4.1.rpm 3.修改配置文件 vim /etc/elasticsearch/elasticsearch.yml cluster.name: yl_shop node.name: yl_master network.host: 127.0.0.1 http.port: 9200 4.升级java版本到1.8,不要使用yum安装,jdk包不能用wget下载,本地下载后上传 https://www.cnblogs.com/yjlch1016/p/8900841.html 5.启动 service elasticsearch start 6.启动成功,访问api是否成功,注意开放9200端口 http://127.0.0.1:9200/ 7.安装maven yum install maven 8.安装中文分词插件ik 把下载包里面的ik复制到 /usr/share/elasticsearch/plugins/ 重启 service elasticsearch restart https://github.com/medcl/elasticsearch-analysis-ik 8.测试 curl -XPOST "http://127.0.0.1:9200/_analyze?analyzer=ik&pretty" -d '这是一个商品的标题' 8.导入数据库插件 解压 unzip elasticsearch-jdbc-2.3.4.0-dist.zip cd elasticsearch-jdbc-2.3.4.0/bin cp mysql-blog.sh import-goods.sh 修改import-goods.sh https://github.com/jprante/elasticsearch-jdbc 插件下载地址 http://xbib.org/repository/org/xbib/elasticsearch/importer/elasticsearch-jdbc/2.3.4.0/elasticsearch-jdbc-2.3.4.0-dist.zip 9.创建索引命令 curl -XPUT "http://127.0.0.1:9200/yl_shop" -d '@createGoodsIndex.json'