Jump to content

IPS4 - Help with sphinx - stop / starting and configuring the config location


tekguru

Recommended Posts

Okay some 'newbie' help needed here with getting sphinx working. My host has installed sphinx on the server, but we seem to have two instances of it running:

580(searchd)/usr/bin/searchd/usr/local/etc/usr/bin/searchd --config /etc/sphinx/sphinx.conf
581(searchd)/usr/bin/searchd/usr/local/etc/usr/bin/searchd --config /etc/sphinx/sphinx.conf

and my host has commented:

Unfortunately, since it is 3rd-party software, I am not familiar with sphinx at all. I can simply tell you what I see and implement any changes you specify, but there is little I can do to troubleshoot this for you.

I see two configuration files for sphinx:

# ls -al /usr/local/etc/sphinx.conf /etc/sphinx/sphinx.conf
-rw-r--r-- 1 root root 1165 Jul 26 2013 /etc/sphinx/sphinx.conf
-rw-r--r-- 1 root root 1145 Jun 14 14:15 /usr/local/etc/sphinx.conf

I see the dual process for sphinx as well; however, I'm not even sure how to stop/restart sphinx.

So we need to know how to stop both instances, and how to restart it preferably with it looking in the  '/public_html/sphinx_conf/' folder for the sphinx.conf file so that I can alter it myself.

Q's: So how does my host stop / start it and how do we set / reconfigure the location of the config file?

I have looked on the sphinx web site and unless I'm going mad I can't find answers to those questions. Dead in the water until some kind soul can advise.

Link to comment
Share on other sites

I think that having the two searchd's running is normal. I just checked my server and have 2 as well. 

When you implement Sphinx in IPB, you will need to install the sphinx.conf file somewhere on your system.  I have mine in my forum root directory.  From there stop sphinx: searchd --stop and start it using the proper config file downloaded from your ACP: searchd --config /path/to/your/sphinx.conf

Then rebuild your index and should be set.

Link to comment
Share on other sites

Yeah two may be likely but are your pointing at two different shpinx.conf files like that?

Thanks for the info on stopping, starting!

Nope, pointing to just one like yours (first example) 

After installing Sphinx at the OS layer, in the ACP enable it, download the config file, start Sphinx using that config then you have to initially build the index.  Once the index is built, you shouldn't need to build it again or have any other cron jobs like the 3.4 series installation.  There is a bug which should be fixed with 4.0.8 when the datastore gets cleared, you may need to rebuild your search.  I have a patch on my site, and it's working perfectly!

Link to comment
Share on other sites

Thanks, so are you issuing a command to start that initial index build, or is it automatic?

I may pick your brains again later as I'm having trouble with my host getting Sphinx to work without them changing the configuration to one that IPS4 can't use.

Which version of sphinx are you using?

 

 

Link to comment
Share on other sites

Right, thanks. Makes sense. Same version I have.

My config is as:

searchd
{
	listen                  = vps2.description.com:3312:mysql41
	max_children            = 30
	pid_file                = /var/sphinx/buildsearchd.pid
	preopen_indexes         = 0
	collation_server        = utf8_general_ci
	workers                 = threads
}

index ips
{
	type                    = rt
	path                    = /var/sphinx/index
	
	rt_field                = index_title
	rt_field                = index_content
	rt_field                = index_tags
	rt_attr_bigint          = index_object_id
	rt_attr_bigint          = index_item_id
	rt_attr_bigint          = index_container_id
	rt_attr_bigint          = index_author
	rt_attr_bigint          = index_views
	rt_attr_bigint          = index_num_comments
	rt_attr_bigint          = index_num_reviews
	rt_attr_json            = index_permissions
	rt_attr_timestamp       = index_date_created
	rt_attr_timestamp       = index_date_updated
	rt_attr_string          = index_class
	rt_attr_uint            = index_class_id
	rt_attr_uint            = index_hidden
}

Does that look okay to you, as ISP407 will still not accept it as working.

In  /var/lib/sphinx I have:

drwxr-xr-x 2 sphinx sphinx 4096 Jun 15 06:14 ./
drwxr-xr-x 24 root root 4096 Jun 14 12:18 ../
-rw------- 1 root root 10 Jun 15 06:14 binlog.meta
-rw------- 1 root root 4 Jun 15 06:14 index.kill
-rw------- 1 root root 0 Jun 15 06:27 index.lock
-rw------- 1 root root 794 Jun 15 06:14 index.meta
-rw------- 1 root root 12 Jun 15 06:14 index.ram
-rw------- 1 root root 1855 Jun 15 05:44 searchd.log
-rw------- 1 sphinx sphinx 4 Jun 15 05:06 testrt.kill
-rw------- 1 sphinx sphinx 0 Jun 15 04:24 testrt.lock
-rw------- 1 root root 308 Jun 15 05:06 testrt.meta
-rw------- 1 root root 12 Jun 15 05:06 testrt.ram

In /var/sphinx:

-rw------- 1 root root 0 Jun 15 08:00 buildsearchd.pid
-rw------- 1 root root 0 Jun 15 08:00 index.lock

In /var/run/sphinx

-rw------- 1 sphinx sphinx 6 Jun 15 08:02 searchd.pid

My host also advised:

/var/sphinx/index/ did not exist so I have created it, changed its ownership to sphinx.sphinx, and restarted searchd.

Yet every time I try to activate sphinx in ACP I get:

Could not connect to the Sphinx server. Verify that the details provided are correct, that the correct configuration file was uploaded to the server and to the right location and that the Sphinx searchd application is running. If you need assistance, contact your hosting provider or server administrator.

I think my host is getting tired of me asking them for details of what is where :) Any further ideas as this is driving me insane!

Link to comment
Share on other sites

My host has switched the configuration file to /home/guru/public_html/sphinx_conf/sphinx.conf.use (correct file) and is getting this error:

FATAL: failed to open log file 'searchd.log': Permission denied

They have changed the ownership of both /var/log/sphinx/searchd.log and /var/lib/sphinx/searchd.log, but the error persists

So approaching giving up on ever getting Sphinx working now....... Did you have any of these issues?

Link to comment
Share on other sites

Problem Determination.  If they're getting an error trying to open or write to a file, they'll need to determine what the issue is.  I didn't have this issue, but then again I have been running Sphinx for years, so my logs and directories are all existing.

 

Link to comment
Share on other sites

Okay, can you advise in which location your searchd.log is saved as we're getting 'FATAL: failed to open log file 'searchd.log': Permission denied' error message?

We've deleted all old incarnations of that file from when we used sphinx year ago and it still can't write the file so we're trying to work out where it wants to write to.

Link to comment
Share on other sites

Okay latest feedback from my host:

The indexer program was located in /usr/bin instead of /usr/local/bin and resulted in an error:

/usr/bin/indexer --config /home/xxx/public_html/sphinx_conf/sphinx.conf.use --all
Sphinx 2.2.9-id64-release (rel22-r5006)
Copyright (c) 2001-2015, Andrew Aksyonoff
Copyright (c) 2008-2015, Sphinx Technologies Inc (http://sphinxsearch.com)

using config file '/home/xxx/public_html/sphinx_conf/sphinx.conf.use'...
FATAL: no indexes found in config file '/home/guru/public_html/sphinx_conf/sphinx.conf.use'

The same is true of searchd:

/usr/bin/searchd --config /home/xxx/public_html/sphinx_conf/sphinx.conf.use --all
Sphinx 2.2.9-id64-release (rel22-r5006)
Copyright (c) 2001-2015, Andrew Aksyonoff
Copyright (c) 2008-2015, Sphinx Technologies Inc (http://sphinxsearch.com)

FATAL: malformed or unknown option near '--all'; use '-h' or '--help' to see available options.

The sphinx.conf.use file is:

searchd
{
	listen                  = 127.0.0.1:3312:mysql41
	max_children            = 30
	pid_file                = /var/sphinx/buildsearchd.pid
	preopen_indexes         = 0
	collation_server        = utf8_general_ci
	workers                 = threads
        log                     = /var/log/sphinx/searchd.log
}

index ips
{
	type                    = rt
	path                    = /var/sphinx/index
	
	rt_field                = index_title
	rt_field                = index_content
	rt_field                = index_tags
	rt_attr_bigint          = index_object_id
	rt_attr_bigint          = index_item_id
	rt_attr_bigint          = index_container_id
	rt_attr_bigint          = index_author
	rt_attr_bigint          = index_views
	rt_attr_bigint          = index_num_comments
	rt_attr_bigint          = index_num_reviews
	rt_attr_json            = index_permissions
	rt_attr_timestamp       = index_date_created
	rt_attr_timestamp       = index_date_updated
	rt_attr_string          = index_class
	rt_attr_uint            = index_class_id
	rt_attr_uint            = index_hidden
}

Any ideas why we are getting "FATAL: no indexes found in config file '/home/xxx/public_html/sphinx_conf/sphinx.conf.use'" as the index settings seem to be there?

I assume the second error is due to the --all parameter being added for running?

Link to comment
Share on other sites

On the first I've told them not to use the original file and to delete it and replace it with 'sphinx.conf.use', however they seem to want to leave it in place and use the 'sphinx.conf.use' file. The gods only know why.

Should the '--all' not be used at all then either for the config setting or the running on the daemon??

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...