我正在尝试在 Ubuntu 12.04 上安装 Elasticsearch 1.0.1。到目前为止,我已经完成了:
首先,我删除了旧的 elasticsearch 0.90 包
sudo dpkg -r elasticsearch
然后
cd ~
sudo apt-get update
sudo apt-get install openjdk-7-jre-headless -y
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.0.1.deb
sudo dpkg -i elasticsearch-1.0.1.deb
最后一步结果如下
(Reading database ... 57341 files and directories currently installed.)
Preparing to replace elasticsearch 1.0.1 (using elasticsearch-1.0.1.deb) ...
Unpacking replacement elasticsearch ...
Setting up elasticsearch (1.0.1) ...
chown: cannot access `/etc/elasticsearch/*': No such file or directory
所以我创建了/etc/elasticsearch ,里面有一个虚拟文件,然后做了
sudo chmod 777 /etc/elasticsearch
现在当我跑
sudo dpkg -i elasticsearch-1.0.1.deb
我明白了
(Reading database ... 57341 files and directories currently installed.)
Preparing to replace elasticsearch 1.0.1 (using elasticsearch-1.0.1.deb) ...
Unpacking replacement elasticsearch ...
Setting up elasticsearch (1.0.1) ...
Processing triggers for ureadahead ...
但是/etc/elasticsearch 中什么也没有出现
但是我确实有一个文件夹出现在
/usr/share/elasticsearch
有以下内容
bin core-signatures.txt lib NOTICE.txt README.textile
从这里如果我跑
sudo bin/elasticsearch
我明白了
log4j:WARN 找不到记录器(节点)的附加程序。
log4j:WARN 请正确初始化 log4j 系统。
log4j:警告见 http://logging.apache.org/log4j/1.2/faq.html#noconfig了解更多信息。
并继续运行
如果我打开一个新窗口并运行
curl -XGET 'localhost:9200'
我明白了
{
"status" : 200,
"name" : "Volstagg",
"version" : {
"number" : "1.0.1",
"build_hash" : "5c03844e1978e5cc924dab2a423dc63ce881c42b",
"build_timestamp" : "2014-02-25T15:52:53Z",
"build_snapshot" : false,
"lucene_version" : "4.6"
},
"tagline" : "You Know, for Search"
}
所以它似乎正在运行,我可以填充搜索(symfony2 FOSElasticaBundle)
php app/console fos:elastica:populate
但是,如果我进行搜索,则找不到任何结果。
所以问题是,它是否安装了,为什么它不能正常工作?
我正在使用 github.com/FriendsOfSymfony/FOSElasticaBundle 和 Symfony2 PHP 框架。捆绑包的配置是这样的:
fos_elastica:
clients:
default: { host: localhost, port: 9200 }
indexes:
products:
client: default
types:
product:
mappings:
name: { boost: 5 }
commonName: { boost: 5 }
sku: { boost: 3 }
description:
isRemedy:
countries:
type: "nested"
properties:
code: ~
book:
type: "nested"
properties:
author: ~
isbn: ~
persistence:
driver: orm
model: Helios\CoreBundle\Entity\Product
provider: ~
finder: ~
listener: ~
elastica_to_model_transformer:
ignore_missing: true
当我填充时,我没有收到任何错误,但搜索仍然不起作用。
谢谢
最佳答案
不知道为什么你不能搜索,但你可以检查一些事情。在本页面
提到了配置文件的路径。
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/setup-service.html
The init script is placed at /etc/init.d/elasticsearch is you would expect it. The configuration file is placed at /etc/default/elasticsearch.
通过运行以下查询来检查一切是否正常:
/_cluster/健康
/_nodes/统计
希望有帮助
关于ubuntu - 在 Ubuntu 12.04 上安装 Elasticsearch 1.0.1 失败并显示 sudo dpkg -i elasticsearch-1.0.1.deb,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22574386/