Log Maintenance (SQL SERVER)

Posted by John
on Wednesday, 19 November 2008

Over time your SQL Server transaction log will fill up and if you don't watch it it'll consume all your server's disk space.

So to cure that problem it's best adding a weekly job to SQL Agent with these commands

Truncate log...

USE [databasename]
GO
BACKUP LOG databasename WITH TRUNCATE_ONLY
GO

Shrink database...

USE [databasename]
GO
DBCC SHRINKDATABASE(N'databasename' )
GO

(truncating only clears the logfile, to reclaim that space you have to shrink the database)

Important!

Do remember to schedule a full database backup before this so you don't lose any important transactions; critical in a live environment.

Installing VMWare Server on Ubuntu

Posted by John
on Tuesday, 23 September 2008

First install the pre-requisites;

sudo aptitude install linux-headers-`uname -r` build-essential
sudo aptitude install xinetd

Download VMWare Server .tar.gz file from here.

Remember to signup for a Serial Number, you'll need that during the install

Download the latest vmware-any-any-update patch here,

Now extract VMWare Server and terminal into it's directory, run,

cd vmware-server-distrib
sudo perl vmware-install.pl

When asked Before running VMware Server for the first time, you need to configure it by invoking the following command: "/usr/bin/vmware-config.pl". Do you want this program to invoke the command for you now? [yes] enter *NO* and patch VMWare with that file.

Extract the files within that patch and Terminal into it's directory,

cd vmware-any-any-update115
sudo ./runme.pl

It should prompt you to run vmware-config.pl, this time say YES and continue with the install.

Afterwards start vmware with,

vmware

You might get a load of errors like this,If you get compile errors, do this;

/usr/lib/vmware/bin/vmware: /usr/lib/vmware/lib/libgcc_s.so.1/libgcc_s.so.1: version `GCC_3.4' not found (required by /usr/lib32/libcairo.so.2)
/usr/lib/vmware/bin/vmware: /usr/lib/vmware/lib/libgcc_s.so.1/libgcc_s.so.1: version `GCC_4.2.0' not found (required by /usr/lib32/libstdc++.so.6)
/usr/lib/vmware/bin/vmware: /usr/lib/vmware/lib/libgcc_s.so.1/libgcc_s.so.1: version `GCC_3.4' not found (required by /usr/lib32/libcairo.so.2)
/usr/lib/vmware/bin/vmware: /usr/lib/vmware/lib/libgcc_s.so.1/libgcc_s.so.1: version `GCC_4.2.0' not found (required by /usr/lib32/libstdc++.so.6)
/usr/lib/vmware/bin/vmware: /usr/lib/vmware/lib/libgcc_s.so.1/libgcc_s.so.1: version `GCC_3.4' not found (required by /usr/lib32/libcairo.so.2)
/usr/lib/vmware/bin/vmware: /usr/lib/vmware/lib/libgcc_s.so.1/libgcc_s.so.1: version `GCC_4.2.0' not found (required by /usr/lib32/libstdc++.so.6)

That's because one part of the vmware package was compiled with a different version of gcc than the one you're running now, to fix that do:

sudo cp /lib/libgcc_s.so.1 /usr/lib/vmware/lib/libgcc_s.so.1/
sudo cp /usr/lib/libpng12.so.0 /usr/lib/vmware/lib/libpng12.so.0/

Now you should be able to start VMWare Server

(tested and working on Ubuntu Hardy 8.04 64-bit)

Tomorrow...

Posted by John
on Saturday, 02 August 2008

The Joker

Well after a lot of research and hard work the server's ready to drop off at colocation. There's still some grey areas but in all everything looks ready to go, better off there and running than sitting it home waiting.

So tomorrow I'll be driving down to RapidSwitch in Slough to drop it off, after which Michelle wants us to visit her grandparents who live in Farnborough; not far off from the facility.

Here's a quick rundown of the spec:

  • O/S: Debian Etch 4.0 64-bit
  • HDD: Software RAID 1 - 1TB
  • MEMORY: 4GB Corsair
  • CPU: AMD AM2 2+ghz
  • BANDWIDTH: 3TB per month

Bit of a step up from the virtual server environment I get from SliceHost, but fingers crossed it should all go fine; had so much fun putting it together already planning the next incarnation ;-)

P.S.

Dark Knight is really really good, Heath Ledger has pulled off such a believable and terrifying character; have to see it again.

Update

Just got back from her grandparents; boy do they know how to cook a sunday lunch, lovely couple.

Server's online, it's stopped resyncing the raid drives thankfully, was a little worried about that but everythings loaded running and operating well.

Cat sitting next weekend, let's hope mickey isn't in one of his moods ;-)

All the best, have a great week people.

Debian Hopes

Posted by John
on Sunday, 27 July 2008

With all these problems, and the need to have the homegrown server running something stable I've decided on Debian Stable for the re-install. I'll be doing this with backports as that way I can at least grab the latest releases without damaging the core stable system; as it'll be sitting in colo I really don't want to drive down there every weekend to kick it back into gear.

Debian can be grabbed from here, note most people have never needed anything but the first dvd or first one or two cd iso's for a basic install so no need to grab everything.

Backports are available here, this at least gives the ability to keep up to date with more specific packages while not damaging the core system.

Fingers crossed this should be the final time I do a rebuild before it goes to colo.

[update]

server running a lot better, since I made the switch to Debian; won't be long now till it's taken down to colo.

Building a 1U Server, Part 3

Posted by John
on Monday, 17 March 2008

server

System Config

While the final bits arrive for my new server project I might as well put pen to paper on how the server's O/S will be laid out.

The operating system I'm rooting for this time around will be Linux, purely for the flexibility and the stability; the hardware I'll have to run thru it's paces with a CPU testing tool to make sure i've not got a faulty chip along with some brute-force testing on the memory chips, it's going in co-location so I might as well do it as I don't want to drive down to the site everytime it falls over.

I'll be using SSH obviously to connect to it along with a strong keychain to make my logging in easier and the connection encrypted.

I've got a strong iptables config so will put that into play with a custom port for SSH, not the usual port 22 which is standard; the more things you put in the way of potential hackers the better.

And no, I won't be logging in as root, only if I absolutely have to.

System Layout

This is the tricky bit, working out how you're going to lay the system out and run the various services; there really isn't any good answer, no one solution will fit everything.

For me I've decided to use XEN virtualisation to segregate my services out so each one remains separate, not all my eggs in one basket.

So I plan to use XEN and ArchLinux to handle each server stack, e.g.

  • Database Server (MySQL / PostGreSql / Sqlite)
  • PHP Server (Lighttpd + PHP5)
  • Rails Server (Nginx, Thin, Ruby on Rails 2.0)
  • Caching Server (Memcache, or some kind of custom Content Delivery Network)

I haven't nailed down the particular distro of Linux for the core o/s but will be using ArchLinux to handle the 'baby' boxes, the controlling 'big-daddy' may either be Fedora or again ArchLinux.

Now this may sound like overkill, but it does make sense, as it'll allows me to custom-build each Server based on it's proposed use and with ArchLinux I can make sure no extra baggage is added with unneccesary features and services; tuning it to the maximum performance.

It also allows me to do image backups in the future of each server so I can take snapshots of each one, in case I need to restore any at a certain point in time (say a bad update).

ArchLinux?

I've grown to enjoy ArchLinux, mainly for it's neatness and light feature stack, but also because it has no set release number. Unlike other distro's there is no frozen release 7 or 8, you go with the latest core files and that's what you've got; taking the pressure out of always being on-top.

Also the package manager is a little more powerful and because you only install what you need you don't end up with tons of extra software you never even use. Rolling in at a 160mb ISO build compared to 4.4GB for your average Ubuntu or Fedora you know you're only getting the bare-bones.

As Judd Vinet, the founder of the Arch Linux project said: "It (Arch Linux) is what you make it."

Don't get me wrong, I'm not trying to bash any of the other distro's but as you can imagine with this particular project I have to keep things lean so I can maximise power and alleviate future problems when trying to identify awol services.

Final Notes

It's going to be a lot of work and probably a pain in the rear to put together but I've done this long enough with SliceHost and Virtual Hosting so I think I've cut my teeth long enough to do this for real.

Keep you posted how the build goes.