Hey guys,
I've been using ssl connections to the database for a little while now
thanks to some of the help I've gotten on the list. Works great!
Here's the settings I'm using to do that:
## Database settings
$wgDBtype = "mysql";
$wgDBservers = '';
$wgDBserver = "db.example.com";
$wgDBssl = true;
$wgDBname = "jfwiki";
$wgDBuser = "admin_ssl";
$wgDBpassword = "secret";
$wgDBprefix = "";
$wgDBTableOptions = "ENGINE=InnoDB, DEFAULT CHARSET=utf8";
$wgDBmysql5 = false;
$wgShowDBErrorBacktrace = true;
Well I actually have a 4 node database cluster. With 2 masters slaving off
each other, and 2 slaves running in read only mode.
The db.example.com that you see above is actually a VIP that that controls
the two masters via HA/Proxy.
What I'd like to do is accomplish the same thing, SSL db connections, but
splitting off the reads to the two slaves and send only writes to the
masters.
So I found this mediawiki database manual:
https://www.mediawiki.org/wiki/Manual:$wgDBservers
And I tried adapting the example to get what I'm after in terms of sending
only writes to the master VIP and read from the two slaves.
What I find is if I use a non-ssl user this does actually work well:
$wgDBservers = array(
array(
'host' => "db.example.com",
'dbname' => "jfwiki",
'user' => "admin",
'password' => "secret",
'type' => "mysql",
'flags' => DBO_DEFAULT,
'load' => 0,
),
array(
'host' => "db3.example.com",
'dbname' => "jfwiki",
'user' => "admin",
'password' => "secret",
'type' => "mysql",
'flags' => DBO_DEFAULT,
'load' => 1,
),
array(
'host' => "db4.example.com",
'dbname' => "jfwiki",
'user' => "admin",
'password' => "secret",
'type' => "mysql",
'flags' => DBO_DEFAULT,
'load' => 1,
),
);
No problems there. The wiki comes right up!! However if I try the same
thing, but using an SSL user with the SSL flag in the options section,
that's where it all falls apart.
If I use this setup:
## Database settings
$wgDBtype = "mysql";
$wgDBservers = '';
$wgDBservers = array(
array(
'host' => "db.example.com",
'dbname' => "jfwiki",
'user' => "admin_ssl",
'password' => "secret",
'type' => "mysql",
'flags' => DBO_SSL,
'load' => 0,
),
array(
'host' => "db3.example.com",
'dbname' => "jfwiki",
'user' => "admin_ssl",
'password' => "secret",
'type' => "mysql",
'flags' => DBO_SSL,
'load' => 1,
),
array(
'host' => "db4.example.com",
'dbname' => "jfwiki",
'user' => "admin_ssl",
'password' => "secret",
'type' => "mysql",
'flags' => DBO_SSL,
'load' => 1,
),
);
#$wgDBssl = true;
$wgDBprefix = "";
$wgDBTableOptions = "ENGINE=InnoDB, DEFAULT CHARSET=utf8";
$wgDBmysql5 = false;
$wgShowDBErrorBacktrace = true;
With that set in my LocalSettings.php, I get the following error in the
browser:
Sorry! This site is experiencing technical difficulties.
Try waiting a few minutes and reloading.
(Cannot access the database)
Backtrace:
#0 /var/www/jf/mediawiki-1.25.2/includes/db/LoadBalancer.php(807):
DatabaseBase->reportConnectionError('No working slav...')
#1 /var/www/jf/mediawiki-1.25.2/includes/db/LoadBalancer.php(501):
LoadBalancer->reportConnectionError()
#2 /var/www/jf/mediawiki-1.25.2/includes/GlobalFunctions.php(3594):
LoadBalancer->getConnection(-1, Array, false)
#3 /var/www/jf/mediawiki-1.25.2/includes/page/WikiPage.php(369): wfGetDB(-1)
#4 /var/www/jf/mediawiki-1.25.2/includes/page/WikiPage.php(449):
WikiPage->loadPageData()
#5 /var/www/jf/mediawiki-1.25.2/includes/page/WikiPage.php(491):
WikiPage->exists()
#6 /var/www/jf/mediawiki-1.25.2/includes/page/WikiPage.php(215):
WikiPage->getContentModel()
#7 /var/www/jf/mediawiki-1.25.2/includes/page/WikiPage.php(201):
WikiPage->getContentHandler()
#8 /var/www/jf/mediawiki-1.25.2/includes/actions/Action.php(96):
WikiPage->getActionOverrides()
#9 /var/www/jf/mediawiki-1.25.2/includes/actions/Action.php(151):
Action::factory('view', Object(WikiPage), Object(RequestContext))
#10 /var/www/jf/mediawiki-1.25.2/includes/MediaWiki.php(139):
Action::getActionName(Object(RequestContext))
#11 /var/www/jf/mediawiki-1.25.2/includes/MediaWiki.php(481):
MediaWiki->getAction()
#12 /var/www/jf/mediawiki-1.25.2/includes/MediaWiki.php(414):
MediaWiki->main()
#13 /var/www/jf/mediawiki-1.25.2/index.php(41): MediaWiki->run()
#14 {main}
The error seems to be complaining that it can't read from the slaves.
However I've verified that I can connect as the SSL user to both read only
slaves from the command line on each of the 3 web servers I"m using to run
the wiki:
1st web server
[root@ops1:~] #mysql -uadmin_ssl -p -h db3.example.com -e "show databases"
Enter password:
+--------------------+
| Database |
+--------------------+
| bacula |
| information_schema |
| jfwiki |
| jokefire |
| mysql |
| performance_schema |
+--------------------+
[root@ops1:~] #mysql -uadmin_ssl -p -h db3.example.com -e "show databases"
Enter password:
+--------------------+
| Database |
+--------------------+
| bacula |
| information_schema |
| jfwiki |
| jokefire |
| mysql |
| performance_schema |
+--------------------+
2nd web server:
[root@ops2:~] #mysql -uadmin_ssl -p -h db3.example.com -e "show databases"
Enter password:
+--------------------+
| Database |
+--------------------+
| bacula |
| information_schema |
| jfwiki |
| jokefire |
| mysql |
| performance_schema |
+--------------------+
[root@ops2:~] #mysql -uadmin_ssl -p -h db4.example.com -e "show databases"
Enter password:
+--------------------+
| Database |
+--------------------+
| bacula |
| information_schema |
| jfwiki |
| jokefire |
| mysql |
| performance_schema |
+--------------------+
>From the 3rd web server:
[root@ops3:~] #mysql -uadmin_ssl -p -h db3.example.com -e "show databases"
Enter password:
+--------------------+
| Database |
+--------------------+
| bacula |
| information_schema |
| jfwiki |
| jokefire |
| mysql |
| performance_schema |
+--------------------+
[root@ops3:~] #mysql -uadmin_ssl -p -h db4.example.com -e "show databases"
Enter password:
+--------------------+
| Database |
+--------------------+
| bacula |
| information_schema |
| jfwiki |
| jokefire |
| mysql |
| performance_schema |
+--------------------+
And of course I can connect to the database master VIP from all 3 web
servers:
>From 1st web server:
[root@ops1:~] #mysql -uadmin_ssl -p -h db.example.com -e "show databases"
Enter password:
+--------------------+
| Database |
+--------------------+
| bacula |
| certs |
| information_schema |
| jf_wiki |
| jfwiki |
| jokefire |
| mysql |
| performance_schema |
+--------------------+
2nd web server:
[root@ops2:~] #mysql -uadmin_ssl -p -h db.example.com -e "show databases"
Enter password:
+--------------------+
| Database |
+--------------------+
| bacula |
| certs |
| information_schema |
| jf_wiki |
| jfwiki |
| jokefire |
| mysql |
| performance_schema |
+--------------------+
3rd web server:
[root@ops3:~] #mysql -uadmin_ssl -p -h db.example.com -e "show databases"
Enter password:
+--------------------+
| Database |
+--------------------+
| bacula |
| information_schema |
| jfwiki |
| jokefire |
| mysql |
| performance_schema |
+--------------------+
So what can I do to contact my database via an SSL server using the array?
Thanks,
Tim
--
GPG me!!
gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B
> Remember that this is a mailing list for an open source project.
>Community members provide answers to questions when and if they are
>able, for free, on their own time.
I realize that, I have given support on other email lists (even
though no open source project)
>Sometimes questions slip through the cracks as people get busy with
>other things, particularly their day jobs.
Yes I understand all that too.
>Have patience, and do your best to research your problem as best as possible.
:-) I think I tried to do that, and patience is something I have (I
heard that I am the most patient man they know :-)
>For what it's worth, I've also posted questions here that have gone
>unanswered. In every case, I simply didn't ask the question clearly enough.
I am not sure how I could make the question clearer. I understand the
principle but then I should know more myself. Thanks for the help in
the other mail
_ _
(o) (o)
oOOO----(_)----OOOo---
Henny (Lee Hae Kang)
-----------------------------
http://www.henny-savenije.pe.kr Portal to all my sites
http://www.hendrick-hamel.henny-savenije.pe.kr (in English) Feel free
to discover Korea with Hendrick Hamel (1653-1666)
http://www.hendrick-hamel.henny-savenije.pe.kr/indexk2.htm In Korean
http://www.hendrick-hamel.henny-savenije.pe.kr/Dutch In Dutch
http://www.vos.henny-savenije.pe.kr Frits Vos Article about Witsen
and Eibokken and his first Korean-Dutch dictionary
http://www.cartography.henny-savenije.pe.kr (in English) Korea
through Western Cartographic eyes
http://www.hwasong.henny-savenije.pe.kr Hwasong the fortress in Suwon
http://www.oldKorea.henny-savenije.pe.kr Old Korea in pictures
http://www.british.henny-savenije.pe.kr A British encounter in Pusan (1797)
http://www.henny-savenije.com/tng/ Genealogy
http://www.henny-savenije.pe.kr/phorum Bulletin board for Korean studies
---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
>After the installatron was used, did you run
>../maintenance/update.php? Try that and see what happens.
I did that just before you sent this email, it fixes the redirects to
the main page but the login is still not possible.
>Make sure error reporting is turned on in LocalSettings.php with:
>error_reporting(E_ALL); ini_set("display_errors", 1);
I did that too, which makes the error message for the login
[739517fa]
/mediawiki/index.php?title=Speciaal:Aanmelden&returnto=Hoofdpagina
MWException from line 373 of
/home/hennysav/domains/henny-savenije.com/public_html/mediawiki/includes/SpecialPage.php:
Call to undefined method LoginForm::getPageTitle
Backtrace:
#0
/home/hennysav/domains/henny-savenije.com/public_html/mediawiki/includes/specialpage/SpecialPageFactory.php(572):
SpecialPage->__call(string, array)
#1
/home/hennysav/domains/henny-savenije.com/public_html/mediawiki/includes/specialpage/SpecialPageFactory.php(572):
LoginForm->getPageTitle(NULL)
#2
/home/hennysav/domains/henny-savenije.com/public_html/mediawiki/includes/MediaWiki.php(267):
SpecialPageFactory::executePath(Title, RequestContext)
#3
/home/hennysav/domains/henny-savenije.com/public_html/mediawiki/includes/MediaWiki.php(566):
MediaWiki->performRequest()
#4
/home/hennysav/domains/henny-savenije.com/public_html/mediawiki/includes/MediaWiki.php(414):
MediaWiki->main()
#5
/home/hennysav/domains/henny-savenije.com/public_html/mediawiki/index.php(41):
MediaWiki->run()
#6 {main}
That's the only problem now. I tried to google for it, and I found this
https://www.mediawiki.org/wiki/Topic:Rmqdhtfgjenboaj0
but that doesn't really help me, I am still at a loss.
>What is installatron? Is that a script provided by your hosting provider?
That is a script provided by a company with that name. (I am my own
provider) it installs and updates automatically a wide range of
scripts and till this last malfunction their support was good, but I
guess they didn't know what to do either.
_ _
(o) (o)
oOOO----(_)----OOOo---
Henny (Lee Hae Kang)
-----------------------------
http://www.henny-savenije.pe.kr Portal to all my sites
http://www.hendrick-hamel.henny-savenije.pe.kr (in English) Feel free
to discover Korea with Hendrick Hamel (1653-1666)
http://www.hendrick-hamel.henny-savenije.pe.kr/indexk2.htm In Korean
http://www.hendrick-hamel.henny-savenije.pe.kr/Dutch In Dutch
http://www.vos.henny-savenije.pe.kr Frits Vos Article about Witsen
and Eibokken and his first Korean-Dutch dictionary
http://www.cartography.henny-savenije.pe.kr (in English) Korea
through Western Cartographic eyes
http://www.hwasong.henny-savenije.pe.kr Hwasong the fortress in Suwon
http://www.oldKorea.henny-savenije.pe.kr Old Korea in pictures
http://www.british.henny-savenije.pe.kr A British encounter in Pusan (1797)
http://www.henny-savenije.com/tng/ Genealogy
http://www.henny-savenije.pe.kr/phorum Bulletin board for Korean studies
---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
You are not going to like my suggestion, but I think it's your best
approach. Backup your database, images and files and remove what the
package manager installed. Then start over and install it per the guide.
On Wednesday, September 16, 2015, Henny Savenije <
webmaster(a)henny-savenije.pe.kr> wrote:
>
> I'd suggest installing the latest stable version of MediaWiki using the
>> instructions on MediaWiki.org. That is, manually move the core files into
>> your wiki root one by one over writing the old files. Don't forget NOT to
>> overwrite your images and extensions directories, or the LocalSettings.php
>> and any other customizations you've made. Make sure a vendor and skins
>> directory exist and they match the core MediaWiki version. I typically do
>> this using Git, but I assume the MediaWiki tarball includes these already.
>> Also make sure each extension matches the MediaWiki core version. After all
>> of that, run update.php again. I'd suggest NOT using installatron in the
>> future.
>>
>
> I tried that, but that made the situation worse, the whole installation
> didn't work anymore (probably I did something wrong). So I put back the
> backup and did the same in SSH which worked but to no avail, the problem of
> not being able to login still exists.
>
>
> _ _
> (o) (o)
> oOOO----(_)----OOOo---
> Henny (Lee Hae Kang)
> -----------------------------
> http://www.henny-savenije.pe.kr Portal to all my sites
> http://www.hendrick-hamel.henny-savenije.pe.kr (in English) Feel free to
> discover Korea with Hendrick Hamel (1653-1666)
> http://www.hendrick-hamel.henny-savenije.pe.kr/indexk2.htm In Korean
> http://www.hendrick-hamel.henny-savenije.pe.kr/Dutch In Dutch
> http://www.vos.henny-savenije.pe.kr Frits Vos Article about Witsen and
> Eibokken and his first Korean-Dutch dictionary
> http://www.cartography.henny-savenije.pe.kr (in English) Korea through
> Western Cartographic eyes
> http://www.hwasong.henny-savenije.pe.kr Hwasong the fortress in Suwon
> http://www.oldKorea.henny-savenije.pe.kr Old Korea in pictures
> http://www.british.henny-savenije.pe.kr A British encounter in Pusan
> (1797)
> http://www.henny-savenije.com/tng/ Genealogy
> http://www.henny-savenije.pe.kr/phorum Bulletin board for Korean studies
>
>
>
>
> ---
> This email has been checked for viruses by Avast antivirus software.
> https://www.avast.com/antivirus
> _______________________________________________
> MediaWiki-l mailing list
> To unsubscribe, go to:
> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>
Hi, the MediaWiki Stakeholders Group, the MediaWiki Farmers User Group, and
just anybody involved in MediaWiki development is invited to participate at
the Wikimedia Developer Summit 2016. See the details and deadlines below,
and please help spreading the word.
---------- Forwarded message ----------
From: Rachel Farrand <rfarrand(a)wikimedia.org>
Date: Mon, Sep 14, 2015 at 8:05 PM
Subject: [Wikitech-l] Join the Wikimedia Developer Summit 2016
To: Wikimedia developers <wikitech-l(a)lists.wikimedia.org>
Hello!
The Wikimedia Developer Summit 2016 will be taking place in San Francisco,
CA between January 4th and January 6th, 2016.
Registration is open along with the call for participation.
*Deadline for travel sponsorship requests and the call for participation is
October 2, 2015.*
https://www.mediawiki.org/wiki/Wikimedia_Developer_Summit_2016
Hope to see you in San Francisco!
_______________________________________________
Wikitech-l mailing list
Wikitech-l(a)lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
--
Quim Gil
Engineering Community Manager @ Wikimedia Foundation
http://www.mediawiki.org/wiki/User:Qgil
On Tue, Sep 15, 2015 at 9:12 PM, Henny Savenije
<webmaster(a)henny-savenije.pe.kr> wrote:
>
>
>> After the installatron was used, did you run ../maintenance/update.php?
>> Try that and see what happens.
>
>
>
> I did that just before you sent this email, it fixes the redirects to the
> main page but the login is still not possible.
>
>> Make sure error reporting is turned on in LocalSettings.php with:
>> error_reporting(E_ALL); ini_set("display_errors", 1);
>
>
> I did that too, which makes the error message for the login
>
>
> [739517fa]
> /mediawiki/index.php?title=Speciaal:Aanmelden&returnto=Hoofdpagina
> MWException from line 373 of
> /home/hennysav/domains/henny-savenije.com/public_html/mediawiki/includes/SpecialPage.php:
> Call to undefined method LoginForm::getPageTitle
>
> Backtrace:
>
> #0
> /home/hennysav/domains/henny-savenije.com/public_html/mediawiki/includes/specialpage/SpecialPageFactory.php(572):
> SpecialPage->__call(string, array)
> #1
> /home/hennysav/domains/henny-savenije.com/public_html/mediawiki/includes/specialpage/SpecialPageFactory.php(572):
> LoginForm->getPageTitle(NULL)
> #2
> /home/hennysav/domains/henny-savenije.com/public_html/mediawiki/includes/MediaWiki.php(267):
> SpecialPageFactory::executePath(Title, RequestContext)
> #3
> /home/hennysav/domains/henny-savenije.com/public_html/mediawiki/includes/MediaWiki.php(566):
> MediaWiki->performRequest()
> #4
> /home/hennysav/domains/henny-savenije.com/public_html/mediawiki/includes/MediaWiki.php(414):
> MediaWiki->main()
> #5
> /home/hennysav/domains/henny-savenije.com/public_html/mediawiki/index.php(41):
> MediaWiki->run()
> #6 {main}
>
> That's the only problem now. I tried to google for it, and I found this
>
> https://www.mediawiki.org/wiki/Topic:Rmqdhtfgjenboaj0
>
> but that doesn't really help me, I am still at a loss.
>
>> What is installatron? Is that a script provided by your hosting provider?
>
>
> That is a script provided by a company with that name. (I am my own
> provider) it installs and updates automatically a wide range of scripts and
> till this last malfunction their support was good, but I guess they didn't
> know what to do either.
>
>
I'd suggest installing the latest stable version of MediaWiki using
the instructions on MediaWiki.org. That is, manually move the core
files into your wiki root one by one over writing the old files.
Don't forget NOT to overwrite your images and extensions directories,
or the LocalSettings.php and any other customizations you've made.
Make sure a vendor and skins directory exist and they match the core
MediaWiki version. I typically do this using Git, but I assume the
MediaWiki tarball includes these already.
Also make sure each extension matches the MediaWiki core version.
After all of that, run update.php again.
I'd suggest NOT using installatron in the future.
>
> _ _
> (o) (o)
> oOOO----(_)----OOOo---
> Henny (Lee Hae Kang)
> -----------------------------
> http://www.henny-savenije.pe.kr Portal to all my sites
> http://www.hendrick-hamel.henny-savenije.pe.kr (in English) Feel free to
> discover Korea with Hendrick Hamel (1653-1666)
> http://www.hendrick-hamel.henny-savenije.pe.kr/indexk2.htm In Korean
> http://www.hendrick-hamel.henny-savenije.pe.kr/Dutch In Dutch
> http://www.vos.henny-savenije.pe.kr Frits Vos Article about Witsen and
> Eibokken and his first Korean-Dutch dictionary
> http://www.cartography.henny-savenije.pe.kr (in English) Korea through
> Western Cartographic eyes
> http://www.hwasong.henny-savenije.pe.kr Hwasong the fortress in Suwon
> http://www.oldKorea.henny-savenije.pe.kr Old Korea in pictures
> http://www.british.henny-savenije.pe.kr A British encounter in Pusan (1797)
> http://www.henny-savenije.com/tng/ Genealogy
> http://www.henny-savenije.pe.kr/phorum Bulletin board for Korean studies
>
>
>
>
> ---
> This email has been checked for viruses by Avast antivirus software.
> https://www.avast.com/antivirus
> _______________________________________________
> MediaWiki-l mailing list
> To unsubscribe, go to:
> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l