Jump to content

How to install Sphinx with IPB


Andrew.S.

Recommended Posts

Does anybody know, venture a guess, or whatever of why I might be getting this error?

Sphinx 0.9.8.1-release (r1533)
Copyright (c) 2001-2008, Andrew Aksyonoff

using config file '/correct_path/sphinx.conf'...
creating server socket on 127.0.0.1:3312
WARNING: index 'forums_search_posts_main': preload: mmap() failed: No space left on device (length=85288280); NOT SERVING
WARNING: munmap() failed: Invalid argument



Ever since IPB 3.0.1, it only worked on 3.0.0... I kill the search deamon. Then I rebuild the .conf file, place it in the path where it's supposed to go, rebuild the indexes (-all) with no error and then when I start the daemon I receive the error above. Then search doesn't work. I thought (hoped) this would solve itself with 3.0.2 but same thing keeps happening over again... :(

Link to comment
Share on other sites

I'd suggest deleting *all* the indexes (delta's, main's, everything) then rerun the primary indexer (the Cron job that runs once per day), then the other cron job (the "every 15 minute" one).

And verify that BOTH places which reference a Port in the conf file are changed to 3312. There's one at the top, and one near the bottom.

Link to comment
Share on other sites

Thanks for answering RP. :)


The one at the top, had sql_port = 3306, so I changed it to 3312... The one at the bottom was already 3312 so I left it alone.


I erased all the files in /var/sphinx, proceeded to recreate all the indexes and even the commands for the crontab... Still, same error. :(

Link to comment
Share on other sites

[quote name='Nimdock' date='14 August 2009 - 01:12 PM' timestamp='1250269935' post='1843710']
Does anybody know, venture a guess, or whatever of why I might be getting this error?

Sphinx 0.9.8.1-release (r1533)
Copyright (c) 2001-2008, Andrew Aksyonoff

using config file '/correct_path/sphinx.conf'...
creating server socket on 127.0.0.1:3312
WARNING: index 'forums_search_posts_main': preload: mmap() failed: No space left on device (length=85288280); NOT SERVING
WARNING: munmap() failed: Invalid argument



Ever since IPB 3.0.1, it only worked on 3.0.0... I kill the search deamon. Then I rebuild the .conf file, place it in the path where it's supposed to go, rebuild the indexes (-all) with no error and then when I start the daemon I receive the error above. Then search doesn't work. I thought (hoped) this would solve itself with 3.0.2 but same thing keeps happening over again... :(
[/quote]


[quote name='Nimdock' date='14 August 2009 - 01:40 PM' timestamp='1250271643' post='1843722']
Thanks for answering RP. :)


The one at the top, had sql_port = 3306, so I changed it to 3312... The one at the bottom was already 3312 so I left it alone.


I erased all the files in /var/sphinx, proceeded to recreate all the indexes and even the commands for the crontab... Still, same error. :(
[/quote]

Firstly, you need to change the port setting back. The sql_port is to connect to MySQL, so unless you switched the port mysql is listening on, it needs to be set to the default 3306. Sphinx listens on a different port (it would be akin to having email and your webserver both running on the same port on your server - when you tried to connect it wouldn't know which to server and would get confused).

But that's not related to your error. Your error says "No space left on device (length=85288280);"

Whatever mount you have the indexes building on doesn't have enough space. You'll have to move the indexes to another location on the disk that has sufficient space to build the indexes and start the daemon. If you have further trouble, use the peer to peer forums, or try posting on the sphinx forums (http://sphinxsearch.com/forum/) as it's not really feedback on how to improve IPB. :)

Link to comment
Share on other sites

Thank you for replying bfarber...

Definitely not a space issue. I already checked that, I even erased around 2 GB of apache log files and still same error (mounted in the same place)... Besides it would work fine with a 3.0.0 .conf file and as soon as I used a 3.0.1 or 3.0.2 .conf file that's when I would get the error, so it would be kind of strange that I would be ok space wise and all of the sudden after just changing the conf file I would not.

I do apologize about making my inquiry here. I was just trying to get advantage of the fact that there were a few people with sphinx knowledge hanging out here.



I will just submit a ticket then. :)

Link to comment
Share on other sites

OK, now I'm (more) confused.

Brandon, this came up before, and either that SQL Port number isn't actually being USED (possible?), or the statement about it being required to stay as-is, isn't completely correct.

I have the SQL port set the same as the Sphinx port in the .conf file, in both instances of the search daemon I'm running (one at port 3312, the other at 3313), for two installs on separate Domains, and it works perfectly.

I don't believe I ever left it at 3306, to test whether THAT would work, too, but it does work for me as I said. *shrug*

Link to comment
Share on other sites

http://sphinxsearch.com/docs/current.html#conf-sql-port

I mean, whatever works for you. But "sql_port" is the port to connect to the MySQL server on.

[code]source ipb_source_config
{
#setup
type = mysql
sql_host = localhost
sql_user = root
sql_pass =
sql_db = ipb3
sql_port = 3306
}[/code]

If you are referring to just "port" at the end of the file, then yes, you can change that (and update the setting in the ACP to reflect)

[code]searchd
{
address = 127.0.0.1
port = 3312
log = c:/temp/log/searchd.log
query_log = c:/temp/log/query.log
read_timeout = 5
max_children = 30
pid_file = c:/temp/log/searchd.pid
max_matches = 1000
seamless_rotate = 0
preopen_indexes = 0
unlink_old = 1
}[/code]

There are two different ports here - the sql_port should reflect the port to connect to MySQL at. That would be 3306 in most cases. The second port you can define to whatever you want (so long as it's not used).

Link to comment
Share on other sites

Yes, I know all that! :D

And still it works. I just checked my SQL install. Since I'm not overriding the default value of 3306, by specifying a different port in /etc/my.cnf, mysqld is using port 3306.

That's why I asked you if it was *possible* that IPB was somehow grabbing that default value from some place other than that file.

Because as I said, in my 2 conf files I have the sql_port (top of file) set to 3312 (or 3313), with the Sphinx port (bottom of file) set to 3312 (or 3313) as well.


When I first set up Sphinx, I just set the two port values the same (3312 or 3313) largely due to ignorance. Since it worked, I never bothered to look more closely.

If you're correct, it SHOULD throw an error SOMEWHERE along the line there, I would think.

And now that my curiosity is piqued I think I'll go change the SQL port to 3306, restart the daemons, reindex, and see if it makes a whit of difference.

Link to comment
Share on other sites

This wouldn't have anything to do with IPB. If Sphinx can't connect to mysql, you'd get the error in your console when running the indexer command at shell, completely outside/separate from IPB. Sphinx would have no way to get the info from IPB either.

Link to comment
Share on other sites

I just read over this topic and have a few questions.
If something happens and sphinx stops working, server goes crazy, gets broke in an update etc. Would searchs just stop working or would it default the on IPB version?
In the article about setting it up it says, " "View new content", "Active posts", and "Find posts/topics by member" still make use of internal searching and do not use Sphinx in 3.0.0".
Is there plans on making it work with them features?

Link to comment
Share on other sites

[quote name='Nervosa' date='15 August 2009 - 02:30 AM' timestamp='1250299815' post='1843903']
I just read over this topic and have a few questions.
If something happens and sphinx stops working, server goes crazy, gets broke in an update etc. Would searchs just stop working or would it default the on IPB version?
In the article about setting it up it says, " "View new content", "Active posts", and "Find posts/topics by member" still make use of internal searching and do not use Sphinx in 3.0.0".
Is there plans on making it work with them features?
[/quote]
AFAIK, that was pre-3.0.2 and is no longer the case. Based on what I was told, those *should* now use Sphinx as well, however I will yield that question to Brandon for 100% confirmation.

Link to comment
Share on other sites

hmm...I reinstalled sphinx from the beginning now...I rebuilt the indexes...but in the /var/sphinx directory...the indexes which are created have the name formatting something like this...notice the ".new" calendar_search_delta.new.spa...now when I am trying to launch searchd daemon its searching for calendar_search_delta.spa and as a result failing to serve

[code][root@server1 sphinx-0.9.8.1]# /usr/local/bin/searchd --config /usr/sphinx-0.9.8.1/sphinx.conf
Sphinx 0.9.8.1-release (r1533)
Copyright (c) 2001-2008, Andrew Aksyonoff

using config file '/usr/sphinx-0.9.8.1/sphinx.conf'...
creating server socket on 127.0.0.1:3312
WARNING: index 'core_search_main': preload: failed to open /var/sphinx/core_search_main.sph: No such file or directory; NOT SERVING
WARNING: index 'core_search_delta': preload: failed to open /var/sphinx/core_search_delta.sph: No such file or directory; NOT SERVING
WARNING: index 'members_search_main': preload: failed to open /var/sphinx/members_search_main.sph: No such file or directory; NOT SERVING
WARNING: index 'members_search_delta': preload: failed to open /var/sphinx/members_search_delta.sph: No such file or directory; NOT SERVING
WARNING: index 'forums_search_posts_main': preload: failed to open /var/sphinx/forums_search_posts_main.sph: No such file or directory; NOT SERVING
WARNING: index 'forums_search_posts_delta': preload: failed to open /var/sphinx/forums_search_posts_delta.sph: No such file or directory; NOT SERVING
WARNING: index 'forums_search_topics_main': preload: failed to open /var/sphinx/forums_search_topics_main.sph: No such file or directory; NOT SERVING
WARNING: index 'forums_search_topics_delta': preload: failed to open /var/sphinx/forums_search_topics_delta.sph: No such file or directory; NOT SERVING
WARNING: index 'calendar_search_main': preload: failed to open /var/sphinx/calendar_search_main.sph: No such file or directory; NOT SERVING
WARNING: index 'calendar_search_delta': preload: failed to open /var/sphinx/calendar_search_delta.sph: No such file or directory; NOT SERVING
WARNING: index 'downloads_search_main': preload: failed to open /var/sphinx/downloads_search_main.sph: No such file or directory; NOT SERVING
WARNING: index 'downloads_search_delta': preload: failed to open /var/sphinx/downloads_search_delta.sph: No such file or directory; NOT SERVING
[/code]


though the indexes are being built nicely

[code][root@server1 sphinx-0.9.8.1]# /usr/local/bin/indexer --config /usr/sphinx-0.9.8.1/sphinx.conf --all --rotate
Sphinx 0.9.8.1-release (r1533)
Copyright (c) 2001-2008, Andrew Aksyonoff

using config file '/usr/sphinx-0.9.8.1/sphinx.conf'...
indexing index 'core_search_main'...
collected 29 docs, 0.1 MB
sorted 0.0 Mhits, 100.0% done
total 29 docs, 65460 bytes
total 0.030 sec, 2175690.51 bytes/sec, 963.87 docs/sec
indexing index 'core_search_delta'...
collected 0 docs, 0.0 MB
total 0 docs, 0 bytes
total 0.010 sec, 0.00 bytes/sec, 0.00 docs/sec
indexing index 'members_search_main'...
collected 33954 docs, 1.3 MB
collected 0 attr values
sorted 0.1 Mvalues, 100.0% done
sorted 0.2 Mhits, 100.0% done
total 33954 docs, 1329332 bytes
total 8.837 sec, 150429.55 bytes/sec, 3842.29 docs/sec
indexing index 'members_search_delta'...
collected 0 docs, 0.0 MB
collected 0 attr values
sorted 0.0 Mvalues, nan% done
total 0 docs, 0 bytes
total 0.010 sec, 0.00 bytes/sec, 0.00 docs/sec
indexing index 'forums_search_posts_main'...
collected 438289 docs, 338.4 MB
collected 0 attr values
sorted 3.7 Mvalues, 100.0% done
sorted 49.9 Mhits, 100.0% done
total 438289 docs, 338404144 bytes
total 106.123 sec, 3188806.36 bytes/sec, 4130.03 docs/sec
indexing index 'forums_search_posts_delta'...
collected 0 docs, 0.0 MB
collected 0 attr values
sorted 0.0 Mvalues, nan% done
total 0 docs, 0 bytes
total 0.010 sec, 0.00 bytes/sec, 0.00 docs/sec
indexing index 'forums_search_topics_main'...
collected 113592 docs, 4.3 MB
collected 0 attr values
sorted 1.1 Mvalues, 100.0% done
sorted 0.7 Mhits, 100.0% done
total 113592 docs, 4268706 bytes
total 11.026 sec, 387134.57 bytes/sec, 10301.81 docs/sec
indexing index 'forums_search_topics_delta'...
collected 0 docs, 0.0 MB
collected 0 attr values
sorted 0.0 Mvalues, nan% done
total 0 docs, 0 bytes
total 0.010 sec, 0.00 bytes/sec, 0.00 docs/sec
indexing index 'calendar_search_main'...
collected 2 docs, 0.0 MB
collected 0 attr values
sorted 0.0 Mvalues, 100.0% done
sorted 0.0 Mhits, 100.0% done
total 2 docs, 132 bytes
total 0.010 sec, 13200.00 bytes/sec, 200.00 docs/sec
indexing index 'calendar_search_delta'...
collected 0 docs, 0.0 MB
collected 0 attr values
sorted 0.0 Mvalues, nan% done
total 0 docs, 0 bytes
total 0.010 sec, 0.00 bytes/sec, 0.00 docs/sec
indexing index 'downloads_search_main'...
collected 422 docs, 0.2 MB
collected 0 attr values
sorted 0.0 Mvalues, 100.0% done
sorted 0.0 Mhits, 100.0% done
total 422 docs, 170443 bytes
total 0.077 sec, 2205072.55 bytes/sec, 5459.54 docs/sec
indexing index 'downloads_search_delta'...
collected 0 docs, 0.0 MB
collected 0 attr values
sorted 0.0 Mvalues, nan% done
total 0 docs, 0 bytes
total 0.010 sec, 0.00 bytes/sec, 0.00 docs/sec
WARNING: failed to scanf pid from pid_file '/var/sphinx/log/searchd.pid'.
WARNING: indices NOT rotated.
[/code]

EDIT: Ok...I deleted all the indexes from /var/sphinx now and re ran the indexer...this time it built it correctly....I am able to start the searchd daemon now and search results show. Thanx RainbowViper and Brandon.

Link to comment
Share on other sites

[quote name='Nervosa' date='14 August 2009 - 09:30 PM' timestamp='1250299815' post='1843903']
I just read over this topic and have a few questions.
If something happens and sphinx stops working, server goes crazy, gets broke in an update etc. Would searchs just stop working or would it default the on IPB version?
In the article about setting it up it says, " "View new content", "Active posts", and "Find posts/topics by member" still make use of internal searching and do not use Sphinx in 3.0.0".
Is there plans on making it work with them features?
[/quote]

The search will fail.

Those other actions do not use Sphinx. Sphinx is a replacement for fulltext searching and was never really designed to use queries that don't make use of keywords. .9.8 or .9.9 finally added keyword-less searching, but it's not it's real intention so I don't know if we will make use of it yet or not.

[quote name='.om' date='15 August 2009 - 10:05 AM' timestamp='1250345142' post='1844069']
hmm...I reinstalled sphinx from the beginning now...I rebuilt the indexes...but in the /var/sphinx directory...the indexes which are created have the name formatting something like this...notice the ".new" calendar_search_delta.new.spa...now when I am trying to launch searchd daemon its searching for calendar_search_delta.spa and as a result failing to serve
...

though the indexes are being built nicely
...
EDIT: Ok...I deleted all the indexes from /var/sphinx now and re ran the indexer...this time it built it correctly....I am able to start the searchd daemon now and search results show. Thanx RainbowViper and Brandon.
[/quote]

Please use the peer to peer forum for actual "support" type questions regarding Sphinx. :)

Link to comment
Share on other sites

Finally had a chance to set this up today on my test 3.0.2 forum. I was able to setup a second Sphinx daemon on the same server without any problems (running on port 3313 instead of 3312). Seems to work well, but need to go through all the searches to make sure there are no issues. Certainly the searches I've done so far are much faster than with MySQL's engine.

I would very much like to see support added to the Messenger. I have over 20,000 PMs in my Inbox and A) it takes five seconds after I click on "Messenger" for it to appear and B) searching is fairly slow. I'm not sure the first issue could be resolved by Sphinx (since you always need current results when viewing your inbox), so that will probably need to be optimized another way. But the searching could certainly benefit from Sphinx. I'd really like to see an "Advanced Search" page for the Messenger. :)

Thanks again Brandon (and anyone else at IPB who's touched this) for your work on integrating this into IP.Board 3.

..Al

Link to comment
Share on other sites

  • 2 weeks later...

I am getting this error for the command below nonstop. *username is changed. I had to changed the make for sphinx to spx because my tmp directory is a noexec folder.

/home/username/spx/bin/indexer --config /home/username/www/forums/sphinx.conf --all


FATAL: failed to open /var/sphinx/core_search_main.spl: No such file or directory, will not index. Try --rotate option.

I cannot figure out what it is. Searched the sphinx site and it was fruitless.

[b]FIXED[/b]

Okay I figured out I had to put the FULL path to the /home/username/var/sphinx

Link to comment
Share on other sites

It sure is. I have members delighted they can find two letter words and the search results are also very accurate. I would definitely recommend this. I just wish it was tied in to the new content and regular search to further offload search overheard.

But overall a definite :wub:


Curious... since the two systems seem to actually be co-existing (mysql and sphinx) why can't we have a link to both when searching? Its accuracy might help with a certain sites usability (hint hint cough cough... wink wink)

Link to comment
Share on other sites

[quote name='bfarber' date='01 September 2009 - 08:38 AM' timestamp='1251812306' post='1851299']
Sphinx is night and day compared to MySQL fulltext searching. ;)
[/quote]
It sure is, I wish you guys would install it here so I could actually find things I'm looking for when searching.. :whistle:

..Al

Link to comment
Share on other sites

All installed, all seems to be working and nice and fast.

BTW - when I move the forum directory and create a new database - what do I need to delete and re-run?

I assume clear the logs and go from 'configuring IPB' - or is there anything else that has to be deleted?

Also if there are more than one IPB running on the server, will there be any clashes?

Thanks.

Link to comment
Share on other sites

You can deploy Sphinx in a multi-user configuration, but you have to have separate installations of the installation-specific files (in ./bin, ./etc, and ./var) for each install of IPB, and make sure each search daemon is running on a different port. I did this on my dedi server. Once I got it all sorted out, it worked great.

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...