sphinx

admin
Site Admin
Posts: 24468
Joined: Wed Sep 10, 2008 11:43 am

Re: sphinx

Post by admin » Mon Jan 15, 2018 2:30 am

Some more questions if you don't mind:
1) I see that there is a possibility to automatically translate the entire site with google cloud. But I cannot get in with personal account, it trying to force me to register a business account. Do you have any workaround for this?
hm at the point when we tested it google didn't require business account to use translation services. Are you sure?
2) if I set up lets say 10 different languages and set "different stats for languages" that means the rot_gallery_stats1...x size would be defaultsize*languages?
Sure, we need to store that stats somewhere
3) for the master/slave setup: if I add a new slave and the slave shows "Connecting..." as far as I see its doing database processes like adding a new rot_gallery_stats21 and so on. What would happen, if the server crashes while its working?
Well, it won't be good ) In fact this should be a transaction but it would lock up the DB while coping this data .. are you having any problems adding slaves?

4) do you have anything in your mind about mysql replication in this SCJ context? I'd like to setup a different server for grabbing the galleries and another for processing the websites so I can avoid to slow down the website server also it won'T generate duplicated key issue when adding new slaves. Should I hotcopy just certain tables? or its not a good idea here?
I would start with a basic master-slave for mysql, don't overengineer thing from the very beginning.
5) I'm creating my scj sites with vagrant+chef-solo so I can automate literally everything. Are there any command line things which can automatically bind a slave to a master? thanks again!
I didn't use chef-solo but can you do a post request with it?
I mean you can POST data as if you would do it in admin area.
If it won't work for you we can come up with kind of an API for this.
Have you done script update ?

diszk
Posts: 55
Joined: Tue Jan 17, 2012 12:07 am

Re: sphinx

Post by diszk » Mon Jan 15, 2018 3:09 pm

Thanks for the answers, so there are no problems adding new slave, just wondered what could happen if server crashes but if thats a transaction then no prob, however, I think I have to re-enable binlogs.

if you can do the translation thing with a personal account, then it must be working, so I'll try harder:)

also yes I can make a post request from chef-solo, I'll play around your idea, thanks.

However I found a so-called bug(I know its not a bug, I just can't express myself better). I'm using mysql 5.7 but the ALTER IGNORE TABLE has changed and the IGNORE command was dropped so the description separation module for master/slave is generating mysql error:

2018-01-15 09:29:27 :: 1064 :: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IGNORE TABLE `rot_tags` ADD `tag_name25` VARCHAR( 100 ) NOT NULL DEFAULT '' AFTE' at line 1 :: ALTER IGNORE TABLE `rot_tags` ADD `tag_name25` VARCHAR( 100 ) NOT NULL DEFAULT '' AFTER `tag_replace`

I guess this problem didn't come up yet as most of the people using mysql 5.5. Can I solve this issue if I remove the IGNORE and just run the query in the mysql terminal? thank you in advance!

admin
Site Admin
Posts: 24468
Joined: Wed Sep 10, 2008 11:43 am

Re: sphinx

Post by admin » Tue Jan 16, 2018 5:38 am

I removed IGNORE from those queries, please, run update )
Have you done script update ?

diszk
Posts: 55
Joined: Tue Jan 17, 2012 12:07 am

Re: sphinx

Post by diszk » Tue Jan 16, 2018 12:38 pm

many thanks, its working perfectly!
I see at the master site that the separated site's sphinx has changed from "Uses master's index" to "generate code". Am I have to use a different sphinx config for the separated one or its just a possibility?

admin
Site Admin
Posts: 24468
Joined: Wed Sep 10, 2008 11:43 am

Re: sphinx

Post by admin » Tue Jan 16, 2018 4:27 pm

It's possibility
If you have separate descriptions at a slave site but use the same master's index (you can do it) you can get unexpected results when you do searches
Have you done script update ?

diszk
Posts: 55
Joined: Tue Jan 17, 2012 12:07 am

Re: sphinx

Post by diszk » Wed Jan 17, 2018 4:10 pm

Many thanks,and sorry, but I have 2 more (I hope last) questions:

1) as I see there is only one rot_settings field for sphinx delta counter (sphinx_max_gallery_id). I guess there is no point of use delta for slaves as only the master grabbing new galleries, so for slaves I should use only main indexes just as your app outputs it in the master/slave page, is that right?

2) could you please tell me if are there any ways to modify the sorting method for "date"? I mean as I see its now sorting by creation date but I'd like to sort by activation date. Is that possible? thank you in advance!

admin
Site Admin
Posts: 24468
Joined: Wed Sep 10, 2008 11:43 am

Re: sphinx

Post by admin » Thu Jan 18, 2018 6:57 am

1. thank you , you brought it up to my attantion, it's a mistake , gonna fix it

2. actually it should sort by activation_date
if you see that it doesnt do it this way - send admin area plz and how to check it
Have you done script update ?

admin
Site Admin
Posts: 24468
Joined: Wed Sep 10, 2008 11:43 am

Re: sphinx

Post by admin » Thu Jan 18, 2018 3:12 pm

It's good you brought this question up
As I see we were wasting resources making separate indexes for language slaves
I've updated the script

so now we can create 1 index for all sites using the same DB
Check out rotation settings - sphinx - Sphinx config (example)

it's still able to use old style configs but this one should be an improvement )

Please, let me know if everything's ok here
Have you done script update ?

diszk
Posts: 55
Joined: Tue Jan 17, 2012 12:07 am

Re: sphinx

Post by diszk » Thu Jan 18, 2018 4:03 pm

Huhh, you are so fast:) I'm sorry I wasn't at home today, did not try yet, but updated the script and clicked through the new things just for testing and there is a small UI issue:

arrive to the master/slave page(everything ok, but the columns seems a bit odd - ops column): https://i.imgur.com/sRBtCAs.png
and clicked the "generate conde btn" (UI messed up and no generated code): https://i.imgur.com/oMrPosQ.png
clicked outside of the modal window (messed up UI): https://i.imgur.com/O3M0fU6.png

in 2 hours I'll test the functionality as well, many thanks!

diszk
Posts: 55
Joined: Tue Jan 17, 2012 12:07 am

Re: sphinx

Post by diszk » Thu Jan 18, 2018 4:37 pm

and also after the update without modifying anything, both master and slaves shows error:

'Exception' with message 'Mysql error:: 1054 (Unknown column 'sphinx_delta_index' in 'field list') (db_link) in query SELECT rot_linked_id, separate_vars, translation_lng, translation_source, separate_category_stats, separate_thumb_stats, sphinx_index, sphinx_delta_index FROM rot_linked_db WHERE translation_source = '1'

I can send you the url in prv if you wish, thanks in advance!

Post Reply