Wondering what’s been happening with the offline problems and loss of some posts? Here’s DU’s sys admin, Marc Perkel, to explain it all.
And for those who keep popping off in the comments to posts about Windows or Mac, tell us again why Linux is the future and we’re all idiots for not seeing the light?
Here’s what’s happening.
In order to spread the load and increase capacity I was trying to move the MySQL server to another computer with the main server handling the web and the second server running the MySQL database. Even though I have 8 gigs of ram in the main server every now and then for some reason I can’t explain memory usage soars the the server quits working due to high load.
Most all applications talk to MySQL through “localhost” that resolves to IP address 127.0.0.1 port 3306. Normally moving this service is trivial. I just shut down the database on the main server, move the database to another server, start it up there. Then I set up an SSH tunnel that pipes requests from the main server to the new server by intercepting requests and transporting them over TCP. Generally this just works.
However…
The morons at MySQL decided to redefine the meaning of “localhost” and when an application uses “localhost” the client libraries force it to be redirected to talk to the Unix socket /var/lib/mysql/mysql.sock instead of the TCP port. Why they did this is crazy beyond belief but there’s no way to override it short of downloading the source code and fixing it and recompiling MySQL which is the standard answer that you get whenever you complain too much about Open Source.
I however don’t give up so easily. I found a Linux utility called “socat” (socket concatenate ?) that allowed me to create a fake Unix socket and pipe it to a TCP port. And it worked – for a while. But it wasn’t reliable. As long as I was awake and in front of the computer it worked fine. But as soon as I went to sleep it shut down. So I wake up to a mailbox full of “my web site is down”.
So – I put it back on the main server till I find a real solution.
But – this is yet another example of why open source will never fully replace paid for software. If you have a commercial product people can call up the vendor and scream at them to fix bugs. When I sold commercial software and someone called me needing something fixed or added I usually had it the same day. However in the open source world you have a lot of people who have a highly inflated sense of importance who think their software is the greatest thing that was ever written and it’s crap!
What it comes down to as far as I can tell is the VI editor that comes with Unix causes brain damage. I’m totally serious about this. The VI editor absolutely sucks. It’s years behind editors I got with DOS 20 years ago and is an example of how to make an interface that totally sucks. I have refused to learn this editor because I find it offensive. I do most all my editing with a Windows editor, Textpad, and I run Samba on the Linux boxes so that I can mount them from Windows. That’s because there are no good editors in the Linux world. Other than that I use Pico which is a great little Unix editor for quick and dirty but still isn’t up to the kind of power I had in DOS or even CP/M (Wordstar) which is a better editor than any text mode editor in the Unix world.
I’m still waiting for Linux to catch up to CP/M!!!
My theory is that when people use VI it lowers their standards as to what good software should look like and causes their minds to physically alter in a way that leads to VI syndrome leading to delusions that their little piece of shit software is the greatest program in the world and that they are just so superior to microsoft that it’s just a matter of days before Microsoft collapses and everyone accepts Linux as God.
But what the open source world doesn’t get is that Windows programs actually WORK! If you want to install a windows application you download it, click NEXT, AGREE, NEXT, NEXT, NEXT, FINISH and the program is running. In the Linux world this almost never happens and when it does you’re almost sure that something has to be wrong. In Linux you have to edit cryptic config files with poor documentation. Then you try to run the application, get an error, Google the error, and go back and edit again. After many hours you might have it working or you might have to give up.
Out here in the real world localhost = 127.0.0.1 everywhere EXCEPT in MySQL. Not only did they hard code the bizarre behavior but have no way to override it. In fact they do the opposite. Whatever you set the configuration to they override it and force you to use the Unix socket. So doing something that should be simple becomes a nightmare. And you can’t talk to them because they have VI syndrome.
Why is VI still around?
Its embarrassing, like an old aunt wearing a miniskirt
pico or ee would be my choices, but you still got to learn input\command mode insert text delete text & search at the very least for VI
Why not print these out cheatsheet style and put them on a nearby wall?
(google for it, about 2million out there)
I miss VMS
For those who don’t like VI there is VIM. VIM gives you almost all the features emacs has and there are many plug-ins that enhance productivity. I can’t match the productivity I have using VIM with a GUI text editor. It just doesn’t work. Now that isn’t to say that GUI text editors don’t have a use. I’d rather read text files from a GUI editor.
As #3 said, it’s a poor mechanic who blames his tools for not understanding how to do the job right.
This is not a rant about why OSS does or doesn’t suck, so much as it is an example of why not understanding the procedure causes damage. It doesn’t matter whether you use proprietary or open source software: If you don’t understand the tools you’re using, making assumptions instead, you’re going to make a mistake eventually.
And if you need an example of how not even closed-source software is immune: Have you ever seen a proficient WordStar user try to use WordPerfect? Your sysadmin should, since he claims Linux hasn’t caught up to the ancient kludge that was CP/M. (Side note: How do you copy a file in CP/M? “PIP”!) Or have you ever seen a proficient WordPerfect user try to use Microsoft Word? Neither one would know something as simple as how to simply quit the thing. Ctrl+U? F7? Alt+F4?
Blaming the tool for not working the way you wish it would is not a convincing excuse for failing to read abundant documentation on how it really works.
#136 – stalin:
I once referred to VI as the edlin of Unix. (Yes, that was before Windows as we know it today… 🙂 The reason why it’s still there, because it’s reliable and can be found on EVERY Unix system installed today.
#73 – Marc:
400 Sites all using mysql on one server? Really?? I’d look into moving something more than just mysql off onto another server.
The aren’t all using MySQL. It’s a dual core Athlon box with 8 gigs of ram. Generally it is plenty enough to handle it. But if I cam move the MySQL off to a different server it will significantly increase my ability to expand.
It is odd that you compain about mysql as if it isn’t paid software. You can purchase mysql support contracts. You can purchase mysql enterprise licences…
A simple google search for ‘mysql localhost client socket’ turns up a 3 year old ‘bug report’ describing this problem.
http://bugs.mysql.com/bug.php?id=6246
Also, instead of using some obsucure socat+ssh trick, why not use something that was actually designed to do what you want? Like Mysql Proxy?
http://forge.mysql.com/wiki/MySQL_Proxy
#135 — You want be be part of the longest thread?
go here:
http://www.dvorak.org/blog/?p=3008
it’s due to be reposted in a week or so.
#137 – gvim B)
My brother-in-law keeps telling me how much easier is is to configure windows services and applications. He is a windows admin. I am a consultant with expert Linux, Solaris knowledge.
I make twice his salary.
#144 of course you make twice his salary. That’s because Linux is harder than Windows.
Having developed systems software on Linux, I can attest to how Rube Goldberg and baroque a lot of it is, and much of this is due to the arrogant hacker-unixhead culture of the Linux developer community. Marc Perkel is dead-on about editing screwball configuration files in the vi editor and other similar stuff. It’s a disgrace that this sort of thing is considered acceptable by the Linux developer community. There countless howlers in online forums along the lines of “If you want to install this or that driver, you need to edit this config file and rebuild the kernel.”
The suggestion that you can always change the code to fix something isn’t realistic for ordinary problems like the one described by Perkel. It’s fine if you’re a developer creating a product, but flexibility should mean more than being able to edit the code.
On the other hand, Windows server components, while better integrated and easier to use, have all the problems of a closed box, and it’s a disgrace that open source usually beats it in robustness and security. When one sees a public website go down or fail to work, it’s uncanny how often one sees a SQL Server error message. Microsoft has its own brand of arrogance, but ironically the challenges from Linux and others seem to have chastened it in recent years, to some good effect.
BTW, a poster said Google’s data centers run Linux, but I believe they use FreeBSD.
I understand the frustration with localhost not really meaning 127.0.0.1 …. but you’re work around seemed unnecessarily difficult.
Could you add an entry to /etc/hosts to link another name to 127.0.0.1 … like
127.0.0.1 localhost fred
and then connect to xyz@fred ???
or xyz@127.0.0.1
or a really complicated solution …. float another IP on top or the loopback interface lo:1 and add an entry to that in the hosts file.
Why in God’s name are you trying to do this with socat????
Friends at Dvoraktown;
I have to correct some of the comments in the article. Installing applications and updates in Ubuntu is a snap. It is a single command line or two or three clicks operation that rarely if ever causes problems. My system automatically updates all critical files like Win Update except without the anal (authentication) exam. There are two GUI application managers and a good search engine to facilitate application acquisition. It is easier to find safe reliable programs in Linux than windows, though some may be odd or handicapped in some small way. I think Ubuntu Linux is actually ahead of MSWin in terms of these kinds of update, add-on, and upgrade procedures. Linux now has passed the parity point with Windows in the number of hardware drivers therein contained and hardware compatibility without special conforming drivers and firmware is at least on par. The programmer Sys-admin in the Dvorak SQL rant complaining about customizing his SQL database was describing truisms about desktop Linux of five years ago. Perhaps Dvorak should unchain the poor fellow and let him out in the sunshine two or three hours a day.
Do you like wordstar? Try Joe
Marc: Not that I am any sort of expert, but I am hosting 15-20 sites on a pair of P4 servers with 2 gigs of ram each, and it really wasn’t that hard to inform them all to set their mysql connection lines to access 192.168.0.2 rather than localhost. Sounds much more pleasant, at least, than the route you tried to go through.
nginx, PHP w/ FastCGI, and virtual-domain-enabled postfix on one server.
MySQL on the other.
I like open source software for the exact reason you don’t… if I need to, I can change anything about it. But I’m pretty much on my own at that point. That is the biggest tradeoff you make for not paying for a product; nobody has a vested interest in helping you with it, so you have to find a good samaritan somewhere in the open source community that knows the innards of MySQL..
All very interesting; I would add that, if Marc had described his problem above as an appeal for help rather than a blanket indictment of OSS, all the crabby Linux hacks above would have fallen all over themselves to help him with the problem.
But no. And piping stuff through SSH DOES sound stupid, when MYSQL will do SSL.
And yes, if you won’t take the trouble to learn vi (I like Elvis, even on Win32) then don’t complain; Joe is also a great editor if you insist on channeling WordStar (which I also loved at one time).
Don’t care HOW much experience you have; I’m 41, have been doing stuff like this since high school, and I wouldn’t consider myself a member of the tech brotherhood if I didn’t ASK FOR HELP, NICELY, before ripping OSS a new one. Specially considering how much money it has save John.
Well – lots of you have made a number of comments that there’s something wrong with me. Of those 90% clearly haven’t even bother to read and comprehend the issue I’m talking about. And of those who actually get it, I’m not seeing anyone who has found a solution. There are those who say RTFM who clearly haven’t RTFM themselves because if they did they would see it’s not in there.
So talk all you want but if you can’t do it then I win. That’s the test. If anyone can come up with a solution then I’m wrong. If you can’t then I’m right. It’s that simple.
Your vi comments, level set your other information. Too bad, I found you almost credible till then.
It sounds like you need a new admin, John. He doesn’t understand the tools and the fix isn’t hard.
I think this was just a plea for free tech support from the community. Good one.
Take a look at some of the earlier replies. There are a number of options that would work.
#83 nailed the beauty of vi: the use of buffers.
DOS’s wm (WordMaster, not to be confused with the word processor WordStar) had a simple buffer, but vi has many buffers making it easy to flip-flop passages of text. Being able to execute a buffer made it wonderfully nice for making changes in files without knowing the exact phrasing of the text. I could put the command strings into a buffer, along with whole lines or searched strings of text yanked from the file, then execute the buffer making changes based on the strings found. I didn’t have to use it often, but I couldn’t find a way to do it with other apps of the time (now 24 years ago, so don’t ask me for specifics now. I was coding in Assembly/Macro Language at the time.) I could even save buffers to use in batch files for automating edits similar files.
In vi, you do need to keep a mental image of what’s been put in which buffer, but I’ve never had a problem with that. I still read many books at once, picking up from wherever I left off in any of them without getting confused with the others.
Linux = Communism (marxism) reborn. Which eventually means no accountability and no reliability. Tell me again… how do we pay our monthly bills?
At least we know who you are and that inbred egos will innately keep this crap at bay.
Users drive this thing folks not your self annointed righteous IT egos.
The difference between ‘the valley’ brats and the opensource sewer rats… ‘the valley folks’ get paid. Ego’s and shortsightedness are the same!
Agree completely! I never did buy into the open source MySQL/Linux crap. You get what you pay for. Period.
There’s a limit to the complexity of free Open Source software and while simpler system are more reliable, they are not more reliable when they attempt achieve the same level of complexity that paid corporte software development has proven to achieve at Microsoft, IBM and Apple. Simple old horses are more reliable than horeless cars, but I don’t ride one…nor to do I flog dead horses.
I find that modern Linux distros such as Fedora and openSUSE work quite well as long as they support your hardware. That tends to be the hiccup though. I’ve had openSUSE fail to see the SATA in two very different systems I have. Aside from that, both Fedora 7 and SUSE 10.3 are currently running very well, one on my upgraded Mac and the other on my home-built Asus/AMD64 system. The included software installers and updaters work very well, and I especially like Fedora’s selection. All of this applies to good ol’ Ubuntu as well, of course. Linux is good enough for me to replace Mac OS and Windows, as it is reliable, modern and fast. I do get annoyed all of the bugs that seem to go unfixed, however.
This isn’t the default behavior of MySQL. The decision was made by your vendor. I assume too many of their customers were leaving MySQL servers exposed to the net without admin passwords. “Open source” hasn’t much to do with the matter; programmers don’t call the shots at Redhat/Novell.
Pico is a typewriter, while vi is optimized for C hacking and quick scattershot modifications. One size does not fit all in this area.
But the *real issue* here is that you needed 12k to implement a multitasking Forth. That’s nothing to brag about, bro!
In the technical field most have encountered a manager or executive that created a spreadsheet in a couple of hours and now believes that all data gathering, statistical analysis, and reporting can be done in a couple of hours. These are smart people but their view is colored by their experience with the tools they use. I personally have encountered this and I suspect most folks on this thread have had similar experiences. Marc’s comment is a pithy expression of a common experience, yet rather than evaluate the strengths and weaknesses of the comment, and looking for ways to mitigate the situation, the comment is invalidated and dismissed, and Marc is personally attacked.
This strikes me as a poor way to win friends and influence people and worse yet an ineffective way encourage progress.
To those of you in the open source movement: are you interested in moving forward, or being right? In this situation and environment Marc is your customer, listen to your customer.
um.. pardon me just came across this article from stumble upon… i am a freshmen electronic engineering just starting out and am interested enough in programing to to have at least studied it to some degree. I have a few friends who use linux and are able to use it fluently and are able to run and set it through its paces like a well trained race horse. However, I have dabbled in linux (umbuntu) which some people I have spoken to treat it as some kind of bastard lovechild of windows and linux. I can understand how open sorce could be a truly aw inspiring thing. however, one of the main things about linux is it is not for people who have never touched a command prompt. Alot of it seems to need a slight fiddling with in order to get it to work to a personal standerd of efficency. If you are good at fiddling it stays at that standard. If your not, it will slowly fall from that standard back to, or past its origional state. This is why linux doesnt seem to like its going to outpace windows. not becase the fiddling is difficult, but becase people have no clue how to actually make them work. Most people start out with windows at a young age and learn how to use a computer at the phenominal pace that childeren are able to pick up on things. Adults, aside from the ones who are so seeped in code that switch between platform and platform is like switching between a pond and pool, have difficulty picking up somthing that from the point that they try to swich to linux, using windows having been somthing that they have naturally been able to use. Its a different lanugage. some poeple can pick up languages and be speaking them like a local. Others will always have an accent or even need a guidebook. their is a solution though. Recently there has been a big program to give 200 dollar laptops to childeren in poorer countries. These laptops run linux and only linux. To the kids using this system it will be the only opereating system their is. They will be fluent with linux which will come as naturally to them as windows comes to other people. thats the thing. get linux to people earlier in their lives. not just to extreamly adept programers and tech gurus, but to kids . it will most defenetly teach them how a coputer works better than they would learn on a windows pc and they would most likely be able to swich back and forth between windows and linux depending how it suits them, and the possiblity of linux taking over windows would be larger due to the fact there are people who know the ins and outs of everything involved. what a long and pritty crappy rant i probly just added fuel to this entire fire or this will be treated as a laymans refuse and swept under the rug as an unnessary observation whatever.
I’ve been in the finger pointing loop many times myself. It always sucks. I’ve also been thumped for complaining that the “fix the source yourself” type of help and the difficulty with config files are what keeps linux from having a chance of winning the desktop. Typically, each ‘thumper’ recommends that I trash my system and “upgrade” to their personal favorite distro and add their favorite custom tools to solve the problem.
On the other hand, I don’t think it is fair to call the primary MySQL or PHP developers “hobbyists.” MySQL has a commercial side and I cannot imagine that something as widespread as PHP isn’t receiving some funding from big businesses that use it (as MySQL once did, and may still). Many of the developers of the biggest open source projects do it as a full time, paid job.
And, for handling bugs, don’t expect Microsoft to be any better (or worse) than an open source company. When we switched from Visual C/C++ 6 to Visual Studio 2005 for our primary Windows-based product, I reported several bugs. For one, they contacted me, sent debug DLLs to produce diagnostic logs and eventually incorporated the fix in the next patch. For another (make dependencies no longer check all files in a project) they just said, “That is how we want it now. Won’t Fix.” (and the others were my misunderstandings of new “features”).
As for editors, I agree about VI, it has only one useful command :q
I wouldn’t have survived without nano or mc (the ‘Midnight Commander’).
I found it hysterical that someone pointed out that VI was “the fastest editor around, once you became very familiar with it.” That is true of so many editors it is difficult to count. I cannot imagine retaining my sanity while learning VI, but I can imagine the poor souls who started on VI thinking most other are bad, because VI taught them to think differently about the editing task and now the more common way is alien to them.
Great article. I’m starting to see the light here. I always thought there might be a reason I’m still running doze instead of already having switched to linux on all my boxen, and it seems that you might have hit that particular nail on the head!
So there’s no confusion, I’m a developer and I code in any/all languages. Have done since time began. Today I’m a c-sharper, and while I still think OSS has merits galore, fact is doze gets the job done properly while the oss world sort of just blathers about inconsequentially.
Go figure. I’ m trying to!
Anyone complaining about the instability of open source software misunderstands the place and value of the open source community, as do the members of that community who claim software can be fully matured in an open source environment. The open source concept can be a valuable tool in any development cycle but should be understood and viewed as test bed for software that will have to mature under focused (i.e., paid) leadership if it is to ever be viable at the consumer level. Otherwise the movie has no director, the orchestra no conductor, etc, etc. An anarchistic approach will never write a concerto or build a bridge, much less produce an efficient, completely mature software package.
I would even call Firefox an anomaly. Though it’s growing bloated, it has enjoyed unusual success for an open source project, due largely to its user-friendliness (also highly unusual in open source software) and due as well to the need for an alternative to the miserably clunky IE.
Oh, you proud Utopians calm down. I don’t think open source is going away anytime soon, at least not as long as you guys are burning the midnight oil and writing code well into the early hours of the morning. It’s free to write and free to use. Until they outlaw free software, I think your village is safe.