My setup is as the following:
MaxScale 2.1.4 -> Master -> 2 slaves (both MariaDB 10.2). *CentOS 7
Most of my queries are prepared statements so the master basically handles 90% of the queries right now.
I've enabled the hintfilter and tried to add a hint to a query:
/* maxscale route to server server2 */
Unfortunately, it still ends up on the master.
I understood that MaxScale 2.2 should introduce some auto solution for prepared statements. However, I need some temp solution(I'll try to look into ProxySQL if none is found).
Any help would be highly appreciated.
If you used the mysql command line client to test it, remember to enable SQL comments by using the -c flag.
Since MaxScale 2.0.1, the hint mechanism will override any decisions taken by the router itself if the router supports hints. The readwritesplit and schemarouter routers are currently the only routers that support routing hints so make sure you are using one of these routers.
Related
I did a fresh install of Maxscale, and I was trying to set up a Read-Write-Split service on a master-slave mariadb cluster.
When I was trying to connect with DataGrip or DBeaver, I got the following error message:
[HY000][1927] Capability mismatch (bdd-master)
But when I use the mysql command line client, it works well.
Do you have any idea of what could be wrong?
MaxScale sends a Capability mismatch error when it detects that the client application requests a protocol capability that one of the backend databases cannot support. In general, this should not happen as MaxScale tries to mimic the backend database and calculates the capabilities so that these sort of mismatches do not happen.
There are some known bugs that can cause this, both in MaxScale as well as old versions of MariaDB and MySQL. Upgrading to the latest possible version of MaxScale should help solve any problems you might see.
Additionally, you should disable the query cache in the database if you are using MySQL as there is a bug in MySQL (and old MariaDB versions as well) that causes these sort of problems to appear.
It seems that is related to the router used (readwritesplit).
Datagrip send this command when it initiate the connection:
set autocommit=1, session_track_schema=1, sql_mode = concat(##sql_mode,',STRICT_TRANS_TABLES')
It seems that some of theses parameters are not supported by readwritesplit.
Is it possible to configure a read-only server that remains slave even though no more masters are available with MariaDB Maxscale 6.
I tried it with a readconroute router, but that one turned the slave eventually in to a master as well.
/Theo
If you are using the mariadbmon monitor, you can use the servers_no_promotion parameter to list the server you want to remain read-only.
For galeramon there should be no need to keep servers as read-only as all functioning nodes are capable of receiving writes.
I have setup symfony mysql site with mysql master slave configuration. How ever while testing with jmeter I observed that almost all load is going to master and 1-2% to the server.
Referred how to use master-slave but couldn't help. Is there any specific parameter to influence Server to pick slave connection?
PS- I am performing all read operations only
Doctrine will use the master for all queries after any kind of update.
You can tell doctrine to switch back to a slave after inserts/updates:
$em->flush();
$em->getConnection()->connect('slave');
You could also check whether you have a request listener doing inserts/updates, and apply that fix.
I'm new to RServe (and FastRWeb). I installed RServe 1.7.0 as I want to use its built-in webserver. As I already have apache running on this machine I want to run RServe/FastRWeb on a custom port.
I did cd /usr/local/lib/R/site-library/FastRWeb;sudo ./install.sh, which created /var/FastRWeb/ directory tree.
I'm not seeing any configuration file that mentions port. The default /var/FastRWeb/code/rserve.conf looks like this:
socket /var/FastRWeb/socket
sockmod 0666
source /var/FastRWeb/code/rserve.R
control enable
I'm guessing that means it uses unix sockets, by default? So I think my question is what exactly do I have to put in (and remove from) that file to, say, have it listen on TCP port 8888? And is there anything else I need to do? (I want to be able to connect from other machines, not just localhost.)
Possibly related, is I've looked at /var/FastRWeb/web/index.html and it contains javascript that is going to connect to /cgi-bin/R/ Is that path specific to when using Apache, or is it going to be fine, as-is, when using RServe?
There is an explanation of setting port in the Rserve 1.7.0 release announcement. Therefore, at the top of rserve.conf, I added this line: http.port 8888 Then I used the start script (as root), to start it.
This got me halfway as now http://127.0.0.1:8888/ works, but gives me a page that says:
Error in try(.http.request("/", NULL, NULL, c(48, 6f, 73, 74, 3a, 20, :
could not find function ".http.request"
The second half of the solution is to add this to the top of /var/FastRWeb/code/rserve.R:
library(FastRWeb)
.http.request <- FastRWeb:::.http.request
Then start things going by running /var/FastRWeb/code/start. There is no default handler, so you can test it with http://127.0.0.1:8888/info. Or a more interesting example is http://127.0.0.1:8888/example1.png (to view a chart) or http://127.0.0.1:8888/example2 (to view a mix of html and chart)
Note: I did not delete or edit any other configuration to get this working. That means we also have the unix socket listening. If that is not needed remove those two lines from the Rserve.conf file.
If you want it listening on all IP addresses, not just localhost, then add remote enable to your Rserve.conf file. NOTE: Make sure you understand the security consequences before opening your server to the world.
So, after those two changes, my /var/FastRWeb/code/Rserve.conf file looks like:
http.port 8888
remote enable
source /var/FastRWeb/code/rserve.R
control enable
Did you see Jay Emerson's write-up from a while back about how to use RServe as a backend for web-driven analysis? As I recall, one still uses Apache for the redirection, rather than an explicit port as you surmise here.
Jay's setup was very impressive. He used Rserve to provide mixed table/chart pages written via the grid package, all very slick and very fast, based of an immense data set (from a UN agency, or the World Bank, or something). But I can't find a link to that report right now...
I'm bored cause my development server is down and I'm running the command prompt to ping the server indefinitely so that I'll see when they stop timing out and know that I can work again. In the meantime I wanted to make an Air app that will do this for me, so I can have it chirp or alarm or do something when it starts to be able to connect to the server.
So I need to start with having AIR do the ping, does anyone know how to do this? I can't find any help on it. I can't use the HTTPService because whatever it is that is broken (think it's the VPN), our dev web site is still up.
Thanks
Otherwise you can use the NativeProcess class of the AIR 2.0 beta, and use the ping command of your operating system.
You can find informations on how to use it here.
According to the docs, SocketMonitor, descending from ServiceMonitor will check basic availability, but not a true ping. If you want to truly "ping" the server, you would need to use a socket an implement the protocol, This link to the Wikipedia article might help.
The AIR SDK offers some classes (URLMonitor, SocketMonitor) to handle this:
http://livedocs.adobe.com/flex/3/html/help.html?content=network_connectivity_1.html