Laravel Homestead:安装 Elasticsearch 搜索引擎
在Laravel Homestead环境中安装Elasticsearch可以通过以下步骤进行:
更新系统包:
sudo apt-get update sudo apt-get upgrade
添加Elasticsearch PPA(Personal Package Archive):
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add - sudo apt-get install apt-transport-https software-properties-common echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-7.x.list
安装Elasticsearch:
sudo apt-get update sudo apt-get install elasticsearch
启动并使Elasticsearch随系统启动:
sudo systemctl start elasticsearch.service sudo systemctl enable elasticsearch.service
验证Elasticsearch是否正在运行:
curl -X GET "localhost:9200/"
以上步骤会在Homestead虚拟机中安装Elasticsearch,并确保它随系统启动。请注意,Elasticsearch可能需要较多的内存和存储资源,建议在具有足够资源的环境中进行安装。
评论已关闭