Try the fastest and simplest way to install ONLYOFFICE

Problem to connect Sphinx service to OnlyOffice

Issues during installation and related to database

Problem to connect Sphinx service to OnlyOffice

Postby domcom » Fri Feb 17, 2017 9:06 am

Hello all.

I'm trying to set up a full text search for OnlyOffice whith the help of Sphinx, but i can't get OnlyOffice to connect to the Sphinx Service that is running on the same Server. I'm new to OpenOffice and Sphinx so it could be, that I do something wrong in the configuration so i hope you could help me.

A little bit about my setup and how i configured the Shpinx:
I'm run the Community Version on a Ubuntu Server 16.04.1 that is running on a Hyper-V Cluster.

I installed the OnlyOffice as described in the helpcenter, and it workes.
Then I installed the Sphinxsearch whith the ppa:builds/sphinxsearch-rel22 Repository and configured it like this:

Code: Select all
source src1
{
        type                    = mysql

        sql_host                = localhost
        sql_user                = root
        sql_pass                = rootpw
        sql_db                  = searchdb
        sql_port                = 3306  # optional, default is 3306

        sql_query               = \
                SELECT id, group_id, UNIX_TIMESTAMP(date_added) AS date_added, title, content \
                FROM documents

        sql_attr_uint           = group_id
        sql_attr_timestamp      = date_added
}


index searchdb
{
        source                  = src1
        path                    = /var/lib/sphinxsearch/data/searchdb
}


index searchdbrt
{
        type                    = rt
        rt_mem_limit            = 128M

        path                    = /var/lib/sphinxsearch/data/searchdbrt

        rt_field                = title
        rt_field                = content
        rt_attr_uint            = gid
}
indexer
{
        mem_limit               = 128M
}


searchd
{
#       listen                  = localhost:9312
        listen                  = 9306:mysql41
        log                     = /var/log/sphinxsearch/searchd.log
        query_log               = /var/log/sphinxsearch/query.log
        read_timeout            = 5
        max_children            = 30
        pid_file                = /var/run/sphinxsearch/searchd.pid
        seamless_rotate         = 1
        preopen_indexes         = 1
        unlink_old              = 1
        workers                 = threads # for RT to work
        binlog_path             = /var/lib/sphinxsearch/data
}

Then I created the Mysql Database with the example.sql from sphinxsearch, that I have changed that it creates the DB searchdb.

After that I used the indexer to index the DB and restarted the sphinx searvice.
The service started without any errors:

Code: Select all
sudo systemctl status sphinxsearch.service
● sphinxsearch.service - SphinxSearch Search Engine
   Loaded: loaded (/lib/systemd/system/sphinxsearch.service; disabled; vendor preset: enabled)
   Active: active (running) since Fre 2017-02-17 09:01:04 CET; 5s ago
  Process: 1184 ExecStart=/usr/bin/searchd --config /etc/sphinxsearch/sphinx.conf (code=exited, status=0/SUCCESS)
  Process: 1181 ExecStartPre=/bin/chown sphinxsearch.sphinxsearch /var/run/sphinxsearch (code=exited, status=0/SUCCESS)
  Process: 1177 ExecStartPre=/bin/mkdir -p /var/run/sphinxsearch (code=exited, status=0/SUCCESS)
 Main PID: 1191 (searchd)
    Tasks: 8
   Memory: 4.2M
      CPU: 19ms
   CGroup: /system.slice/sphinxsearch.service
           ├─1190 /usr/bin/searchd --config /etc/sphinxsearch/sphinx.conf
           └─1191 /usr/bin/searchd --config /etc/sphinxsearch/sphinx.conf

Feb 17 09:01:03 bsap04 searchd[1184]: Sphinx 2.2.11-id64-release (95ae9a6)
Feb 17 09:01:03 bsap04 searchd[1184]: Copyright (c) 2001-2016, Andrew Aksyonoff
Feb 17 09:01:03 bsap04 searchd[1184]: Copyright (c) 2008-2016, Sphinx Technologies Inc (http://sphinxsearch.com)
Feb 17 09:01:03 bsap04 searchd[1184]: precaching index 'searchdb'
Feb 17 09:01:03 bsap04 searchd[1184]: [216B blob data]
Feb 17 09:01:04 bsap04 searchd[1184]: Sphinx 2.2.11-id64-release (95ae9a6)
Feb 17 09:01:04 bsap04 searchd[1184]: Copyright (c) 2001-2016, Andrew Aksyonoff
Feb 17 09:01:04 bsap04 searchd[1184]: Copyright (c) 2008-2016, Sphinx Technologies Inc (http://sphinxsearch.com)
Feb 17 09:01:04 bsap04 systemd[1]: sphinxsearch.service: Supervising process 1191 which is not our child. We'll most like
Feb 17 09:01:04 bsap04 systemd[1]: Started SphinxSearch Search Engine.


Now when I try to connect the OnlyOffice to the Sphinx service, OnlyOffice tells me that "Full text search service is not running".
I tried the troubleshooting solution from the helpcenter, that says that I should stop the Sphinx service and then restart the OnyOfficeIndexer and start the sphinx service after that, but it didn't work.
I also used the tool zenmap to scan the Ports of the server to look if the Port is up, and it is

Code: Select all
9306/tcp open  sphinxql?

| fingerprint-strings:

|   DNSStatusRequest, DNSVersionBindReq, GenericLines, GetRequest, HTTPOptions, Help, NULL, RPCCheck, RTSPRequest, SSLSessionReq, TLSSessionReq:

|_    2.2.11-id64-release (95ae9a6)


I can't find any enteries in this forum or else were so i'm now pretty lost, because i don't know what i could do to resolve this problem.
Am I doing something wrong, or am I encountering a bug?

Greetings
DomCom
domcom
 
Posts: 3
Joined: Wed Feb 15, 2017 8:03 am

Re: Problem to connect Sphinx service to OnlyOffice

Postby Maxim » Fri Feb 17, 2017 11:34 am

Hello domcom!
There is one important moment - DO NOT run Sphinx after installation! There "Start=No" as you can see.
Code: Select all
add-apt-repository -y ppa:builds/sphinxsearch-rel22
apt-get update
echo "Start=No" >> /etc/default/sphinxsearch
apt-get install -y sphinxsearch

There are no additional settings or actions with Database. You should stop Sphnix service and restart our Index, but DO NOT start Sphnix service. It will be started automatically by our service as a process.
To check Sphinx enable/disable you should run following command
Code: Select all
ps aux | grep sphin

There are must be 2 processes that Index service runs itself.
So stop Sphinx service =>restart our Index (do not run Sphinx!) = > run ps aux | grep sphinx
Maxim
 
Posts: 381
Joined: Tue Oct 11, 2016 2:34 pm

Re: Problem to connect Sphinx service to OnlyOffice

Postby domcom » Fri Feb 17, 2017 1:01 pm

Thank you very much for the fast aswer, it worked!
I don't know why I assumed that I have to start the sphinx servie again, even it didn't stand there.
Greetings
DomCom
domcom
 
Posts: 3
Joined: Wed Feb 15, 2017 8:03 am


Return to Installation issues

Who is online

Users browsing this forum: No registered users and 2 guests