Archive for the ‘service’ Category

Oracle Blamed for Laws of Nature

Ноябрь 5th, 2010

A catchy headline, and I believe more accurate than Oracle Puts the Squeeze on SMBs with MySQL Price Hike (Network World) and MySQL price hikes reveal depth of Oracle’s wallet love [MySQL Jacking up MySQL Prices] (The Register). Slightly more realistic is Oracle kills low-priced MySQL support (again The Register).

First, let’s review what Oracle has actually done: they ditched the MySQL enterprise Basic and Silver offerings. For Oracle, that makes sense. Their intended client base is “enterprise” (high end, think big corporates) and their MySQL sales and cost structure reflects this. It’s not a new thing that came with MySQL at Oracle, because MySQL at Sun Microsystems and MySQL AB before it had the same approach.

A company simply cannot operate below its market – that is not simply a matter of choice, instead it is dictated by their processes and cost structure. Smart people like Clayton Christensen at Harvard Business School have done ample research on this, here I’ll just give one simple example:

If you hire a sales person on commission and their quarterly quota is $100k, then they have to talk with clients that have at least a $10k-$20k potential (qualified leads), and they need to close (sign contract) with at least 10 within the period. They simply cannot spend any time on talking with potential $1k customers.

We may lament this state of affairs, but you can see how, given the choices made (sales person hired, commission system, quota), it’s as inevitable as an apple falling when you drop it. The way I describe this at Upstarta: if a company wants different results, they need to make sure that their business processes and cost structure lead them in that direction. But the simple fact is that most companies don’t have an internal feedback cycle that keeps an eye on these things, so they just go with the flow of consequences of common choices: aim for large(r) clients, grow turnover, get higher operational costs along the way – that in itself is a cycle and the only direction this particular one can go is up. As a natural consequence, over time old low-end offerings and clients need to be jettisoned – one way or another.

I say horay for Oracle to finally acknowledge this, since Sun Microsystems and MySQL AB before it did not (for whatever reason). This is years overdue. Whether the original MySQL company should have aimed to also serve smaller clients also is an entirely separate topic – and one which I covered at length previously (including internally in my time at MySQL AB), but it’s very much a station long passed. Once you float upward in the market, you can’t operate or move downward.

Now, are SMBs using MySQL actually getting squeezed by Oracle? They are not. There is no lock-in. This is about service contracts, not licensing. As we all know, MySQL is GPL licensed and internal use (even on a website or SaaS offering) is well within GPL parameters. There are a number of different companies offering service for MySQL, different types of service and delivery models and a corresponding wide range of pricing. So SMBs and anyone else has a choice, each can pick the type of service most suited to their needs. Let us celebrate and promote that freedom within the MySQL ecosystem, rather than being outraged about dropped apples falling!


PlanetMySQL Voting: Vote UP / Vote DOWN

Syntax for Creating a Windows Service for MySQL (when there are 2 paths which both contain spaces)

Сентябрь 28th, 2010

Numerous times now, I’ve seen people have troubles creating MySQL services on Windows manually (using ’sc’), whether it be for mysqld itself, MySQL Proxy, or the MySQL Enterprise Monitor and/or Agent.

The proper syntax for ’sc’ can get tricky when you have spaces in pathnames, which is very common in Windows, and the need for –defaults-file (which means two paths each potentially containing spaces).

So, if you have spaces in both your binpath and your path to –defaults-file, then the following syntax will work for you (all on a single line):

sc create MySQLEnterpriseMonitorAgent
binpath= "\"C:\Program Files\MySQL\Enterprise\Agent\bin\mysql-monitor-agent.exe\"
--defaults-file=\"C:\Program Files\MySQL\Enterprise\Agent\etc\mysql-monitor-agent.ini\""
DisplayName= "MySQL Enterprise Monitor Agent" start= "auto"

Note that you could easily use the exact same syntax to install a Windows service for the MySQL server itself (using mysqld.exe and my.ini instead, along with their correct paths). Similarly, this could be also used to create a Windows service for MySQL Proxy too. Just point binpath to mysql-proxy-svc.exe, and instead of –defaults-file=, use –proxy-lua-script= (in fact, I actually had a post on this close to a year ago, but my example only had one path that contained a space, so the above syntax was not necessary).

At any rate, the above command should output somthing similar to the following:

[SC] CreateService SUCCESS

For reference, here is my terminal session:

C:\Users\Chris>sc create MySQLEnterpriseMonitorAgent
binpath= "\"C:\Program Files\MySQL\Enterprise\Agent\bin\mysql-monitor-agent.exe\"
--defaults-file=\"C:\Program Files\MySQL\Enterprise\Agent\etc\mysql-monitor-agent.ini\""
DisplayName= "MySQL Enterprise Monitor Agent" start= "auto"
[SC] CreateService SUCCESS

Hope this helps.


PlanetMySQL Voting: Vote UP / Vote DOWN

Running MySQL Cluster as a Service on Windows

Июнь 20th, 2010
The MySQL Cluster daemon for MySQL Cluster (ndbd and ndb_mgmd) doesn't by themselves yet let them run as a service (apparently ndb_mgmd does, but I haven't seen it documented anywhere on how to do that). But there are ways to fix this, using some simple Windows tools and some registry hacking.

What you need to find is the Windows Resource Kit from some version of Windows that includes instsrv.exe and srvany.exe. It is not too picky with the actual version of Windows you run it seems, I used the Windows NT 32-bit versions of these on a 64-bit Windows 7 box, and it works just fine.

These two programs are simple and are easy to use:
  • instsrv allows you to install a service, it's real simple, just run the program and it will show the options (and these are few).
  • srvany allows you to run any odd program, that is not intended run as a service, do do this anyway.
Now, Google a bit and download these two puppies and open a DOS Window and change directory to where you installed these guys. Now we are realy to install three services (1 for the mgm and two datanodes), so they will run the srvany program:
F:>ResKit> instsrv mgm1 F:\ResKit\srvany.exe
F:>ResKit> instsrv ndbd1 F:\ResKit\srvany.exe
F:>ResKit> instsrv ndbd2 F:\ResKit\srvany.exe

These three services are rather boring now, they do not do anything, really. To fix this, open the registry editor (regedit) and open:
HKEY_LOCAL_MACHINE\System\CurrentControlset\services\mgm1
Now, we need to define what srvany.exe should run. In the key above, create a new key called Parameters. In this key then, create two values:
  • Application - The full path to the program srvany should run.
  • AppParameters - The parameters to pass to the program srvany will run.
In my case, I set these to, for the mgm service:
Application: F:\MySQL714\bin\ndb_mgmd.exe
AppParams: --config-file=F:\MySQL714\mgm1\config.ini --configdir=F:\MySQL714\mgm1

I think you see where I'm going with this, but just to be sure, this is what I set for the ndbd1 service:
Application: F:\MySQL714\bin\ndbd.exe
AppParams: --ndb_connectstring=nodeid=2;host=localhost:1186

And that's it, folks! Well, one more thing I guess, we want to install the MySQL Server as a serive also, but this knows how to install itself as a service and can also run nicely as a service, so this is easy:
F:\ResKit>F:\MySQL714\bin\mysqld --install MySQL714 --defaults-file=F:\MySQL714\my.ini

Make sure that the ini-file for the MySQL server is configured to access the cluster we just set up, and to have the ndbcluster engine enabled (for some reason, the latter is not enabled by default). Do this by editing the my.ini file used by the server (and referenced above) and add the following two lines to the [mysqld] section:
ndb-connectstring=host=localhost:1186
ndbcluster

Now we have created and configured a bunch of services for a MySQL Cluster setup, and to try it out, lets start them using the NET command line program (the SC command may also be used):
F:\ResKit> net start mgm1
F:\ResKit> net start ndbd1
F:\ResKit> net start ndbd2
F:\ResKit> net start MySQL714

Have fun! And just a word of caution: Although this works just fine for testing, note that shutdown of the ndbd and mgm services isnt really graceful here, so this is just for fun and testing. Also, ndbd and ndb_mgmd will sure be possible to run as a Windows service in their own right, in some future version of MySQL Cluster.

/Karlsson

PlanetMySQL Voting: Vote UP / Vote DOWN

Setting up MySQL Proxy as a Service on Windows

Октябрь 28th, 2009

In the newer versions of MySQL Proxy (0.7.2 and newer), it is now possible to create a Windows service for MySQL Proxy due to the inclusion of “mysql-proxy-svc.exe”.

Basically, you could use “mysql-proxy-svc.exe” in lieu of “mysql-proxy.exe” from the command line and you would not notice a difference. However, just invoking this will not create a service for MySQL Proxy. Furthermore, you cannot invoke it with the “–install” option as you can with mysqld.

But, you can create a service for MySQL Proxy using the “sc” command with “mysql-proxy-svc.exe”.

Say I want to create a service that starts automatically when my system is started/rebooted. I also want it to load a certain lua script, say capture-errors.lua. Given this, I would use the following command:

sc create "proxy" DisplayName= "MySQL Proxy" start= "auto"
binPath= "C:\Program Files\MySQL\mysql-proxy-0.7.2\bin\mysql-proxy-svc.exe
--proxy-lua-script=capture-errors.lua"

Here is the session from my console:

C:\Program Files\MySQL\mysql-proxy-0.7.2\bin>sc create "proxy"
DisplayName= "MySQL Proxy" start= "auto"
binPath= "C:\Program Files\MySQL\mysql-proxy-0.7.2\bin\mysql-proxy-svc.exe
--proxy-lua-script=capture-errors.lua"
[SC] CreateService SUCCESS

Once you have this set-up, you can easily start-up or shutdown the proxy. For instance, the following two commands will start and stop the proxy, respectively:

net start proxy
net stop proxy

Now, a couple of notes about the “sc create” statement:

  1. This will create the service with the name of “proxy”.
  2. I used a “start” type of “auto”. This will mean it will start up automatically when you reboot your system. If you remove that option, it will default to “manual”.
  3. You need a space after each equal sign (=).
  4. I had to use double-quotes (”) around each parameter value, as well as the service name, otherwise it wouldn’t create the service properly on my machine.
  5. The lua script, capture-errors.lua, is located in the proxy basedir (C:\Program Files\MySQL\mysql-proxy-0.7.2\) and so it can be read from that location without a full path. If you have this in a different location, you would need to specify the full path.

If for some reason you want to delete this service, you can issue the following command (where “proxy” is the name of the service that you gave it using the above command):

sc delete proxy

And for more details on “sc”, please refer to the following Microsoft KB article:

http://support.microsoft.com/kb/251192


PlanetMySQL Voting: Vote UP / Vote DOWN