Неправильно работает Sphinx

Настроил Sphinx по инструкции, теперь при searchd выдается
Sphinx 2.0.7-id64-release (r3759)
Copyright © 2001-2012, Andrew Aksyonoff
Copyright © 2008-2012, Sphinx Technologies Inc (http://sphinxsearch.com)

using config file '/etc/sphinxsearch/sphinx.conf'...
listening on UNIX socket /var/run/sphinx.socket
precaching index 'entityprefixtopicsIndex'
WARNING: index 'entityprefixtopicsIndex': preload: failed to open /var/lib/sphinxsearch/data/entityprefix/topicsIndex.sph: No such file or directory; NOT SERVING
precaching index 'entityprefixcommentsIndex'
WARNING: index 'entityprefixcommentsIndex': preload: failed to open /var/lib/sphinxsearch/data/entityprefix/commentsIndex.sph: No such file or directory; NOT SERVING
FATAL: no valid indexes to serve


при searchd --stop
Sphinx 2.0.7-id64-release (r3759)
Copyright © 2001-2012, Andrew Aksyonoff
Copyright © 2008-2012, Sphinx Technologies Inc (http://sphinxsearch.com)

using config file '/etc/sphinxsearch/sphinx.conf'...
FATAL: stop: failed to read valid pid from '/var/run/searchd.pid'


при indexer --all
Sphinx 2.0.7-id64-release (r3759)
Copyright © 2001-2012, Andrew Aksyonoff
Copyright © 2008-2012, Sphinx Technologies Inc (http://sphinxsearch.com)

using config file '/etc/sphinxsearch/sphinx.conf'...
indexing index 'entityprefixtopicsIndex'...
ERROR: index 'entityprefixtopicsIndex': sql_connect: Access denied for user 'test'@'localhost' (using password: YES) (DSN=mysql://test:***@localhost:3306/testbase).
total 0 docs, 0 bytes
total 0.114 sec, 0 bytes/sec, 0.00 docs/sec
indexing index 'entityprefixcommentsIndex'...
ERROR: index 'entityprefixcommentsIndex': sql_connect: Access denied for user 'test'@'localhost' (using password: YES) (DSN=mysql://test:***@localhost:3306/testbase).
total 0 docs, 0 bytes
total 0.000 sec, 0 bytes/sec, 0.00 docs/sec
total 0 reads, 0.000 sec, 0.0 kb/call avg, 0.0 msec/call avg
total 0 writes, 0.000 sec, 0.0 kb/call avg, 0.0 msec/call avg


Как можно это исправить?

14 комментариев

avatar
ERROR: index 'entityprefixtopicsIndex': sql_connect: Access denied for user 'test'@'localhost' (using password: YES) (DSN=mysql://test:***@localhost:3306/testbase).
Говорит о том что вы в настройках указали неправильный пароль для доступа к БД
avatar
Видел это, все перепроверил — в настройках стоит такой же пароль как и в config.local.php
avatar
Киньте сюда config.local.php
avatar
<?php
/**
 * Настройка базы данных
 */
$config['db']['params']['host'] = 'localhost';
$config['db']['params']['port'] = '3306';
$config['db']['params']['user'] = 'test';
$config['db']['params']['pass'] = 'пароль';
$config['db']['params']['type']   = 'mysql';
$config['db']['params']['dbname'] = 'testbase';
$config['db']['table']['prefix'] = 'prefix_';

$config['path']['root']['web'] = 'домен';
$config['path']['root']['server'] = 'путь';
$config['path']['offset_request_url'] = '0';
$config['db']['tables']['engine'] = 'InnoDB';
$config['view']['name'] = 'Your Site';
$config['view']['description'] = 'Description your site';
$config['view']['keywords'] = 'site, google, internet';
$config['view']['skin'] = 'synio';
$config['sys']['mail']['from_email'] = 'почта';
$config['sys']['mail']['from_name'] = 'Почтовик Your Site';
$config['general']['close'] = false;
$config['general']['reg']['activation'] = false;
$config['general']['reg']['invite'] = false;
$config['lang']['current'] = 'russian';
$config['lang']['default'] = 'russian';
/**
 * Настройка memcached
 */
$config['memcache']['servers'][0]['host'] = 'unix:///var/run/memcached.socket';
$config['memcache']['servers'][0]['port'] = '0';
 
/**
 * Настройки кеширования
 */
// Устанавливаем настройки кеширования
$config['sys']['cache']['use']    = true;               // использовать кеширование или нет
$config['sys']['cache']['type']   = 'memory';           // тип кеширования: file, xcache и memory. memory использует мемкеш, xcache - использует XCache
$config['sys']['cache']['prefix'] = 'mypre';            // произвольный префикс кэша, должен быть уникальным для каждого сайта
return $config;
?>
avatar
sphinx.conf тоже
avatar
#############################################################################
## data source definition
#############################################################################

source entityprefixSource
{                                                                     
type = mysql

sql_host = localhost
sql_user = test
sql_pass = пароль
sql_db = testbase
sql_port = 3306

sql_sock = /var/run/mysqld/mysqld.sock

mysql_connect_flags = 32 # enable compression
	
sql_query_pre = SET NAMES utf8
sql_query_pre = SET SESSION query_cache_type=OFF	
}

source entityprefixTopicsSource : entityprefixSource
{                                                               
sql_query = \
SELECT t.topic_id, t.topic_title, UNIX_TIMESTAMP(t.topic_date_add) as topic_date_add, \
tc.topic_text, t.topic_publish, b.blog_title, u.user_login \
FROM prefix_topic t, prefix_topic_content tc, prefix_blog b, prefix_user u \
WHERE t.topic_id=tc.topic_id AND t.topic_publish=1 \
AND b.blog_id=t.blog_id AND t.user_id=u.user_id \
AND t.topic_id>=$start AND t.topic_id<=$end
 
sql_joined_field = tags from query; select topic_id, topic_tag_text \
from prefix_topic_tag order by topic_id ASC

sql_query_range = SELECT MIN(topic_id),MAX(topic_id) FROM prefix_topic
        
sql_range_step = 1000

sql_attr_bool = topic_publish

sql_attr_timestamp = topic_date_add

sql_attr_multi = uint tag from query; SELECT topic_id, topic_tag_id FROM prefix_topic_tag
}

source entityprefixCommentsSource : entityprefixSource
{
sql_query = \
SELECT m.comment_id, m.comment_text, UNIX_TIMESTAMP(m.comment_date) as comment_date, \
m.comment_delete, u.user_login \
FROM prefix_comment m, prefix_user u \
WHERE m.target_type='topic' AND m.comment_delete=0 AND m.comment_publish=1 AND m.user_id=u.user_id \
AND m.comment_id>=$start AND m.comment_id<=$end

sql_query_range = SELECT MIN(comment_id),MAX(comment_id) FROM prefix_comment

sql_range_step = 5000

sql_attr_bool = comment_delete

sql_attr_timestamp = comment_date
}

#############################################################################
## index definition
#############################################################################

index entityprefixtopicsIndex
{
source = entityprefixTopicsSource

path = /var/lib/sphinxsearch/data/entityprefix/topicsIndex

docinfo = extern

morphology = stem_enru
        
charset_type = utf-8

html_strip = 1

html_remove_elements = style, script, code
}

index entityprefixcommentsIndex : entityprefixtopicsIndex
{
source = entityprefixCommentsSource

path = /var/lib/sphinxsearch/data/entityprefix/commentsIndex
}

#############################################################################
## indexer settings
#############################################################################

indexer
{
mem_limit = 256M
}

#############################################################################
## searchd settings
#############################################################################

searchd
{	
listen = /var/run/sphinx.socket
	
log = /var/log/sphinxsearch/searchd.log

query_log = /var/log/sphinxsearch/query.log
                                     
read_timeout = 5
                                        
client_timeout = 300
                                           
max_children = 100
                   
pid_file = /var/run/searchd.pid
                                            
workers	= threads

compat_sphinxql_magics = 0
}

# --eof--
avatar
Так, а просто через «mysql -u test -h localhost testbase»… с тем паролем получается зайти?
avatar
Да, заходит.
avatar
Прописать рута в конфиг пробовали?
avatar
Подскажите, пожалуйста, как прописать?
avatar
ну рутовский к mysql логин\пароль — root\…
в настройках
sql_host = localhost
sql_user = test <==========
sql_pass = пароль <========
sql_db = testbase
sql_port = 3306
avatar
А вот так заработало. Это нормально? Можно оставить с root паролем?
avatar
у вас точно нехватает прав для простого логина.
оставить то конечно можно, но лучше еще раз посмотреть и глянуть на права юзера под которым хотите заходить.
В Идеале — можно сделать отдельного юзера и дать ему доступ к базе
avatar
Хорошо. Спасибо большое.
Только зарегистрированные и авторизованные пользователи могут оставлять комментарии.