FreeBSD
Creating an Extra MySQL Slave from Another MySQL Slave
I was tasked with creating a new MySQL slave in a Brighton datacenter to replicate with the master in London. There was already a replication in place from London to Manchester. Here are the steps to copy the information from Manchester Slave (MySQL2) to the Brighton Slave (MySQL3) . This method allows the master MySQL to be completely untouched In […]
Nagios: DNS CRITICAL – ‘/usr/bin/nslookup -sil’ msg parsing exited with no address
Scenario: We changed from BIND to Unbound on a smarthost email server. As soon as this was changed Nagios started throwing up a "DNS CRITICAL – '/usr/bin/nslookup -sil' msg parsing exited with no address" . In the following example i've substituted myhost.domain.co.uk for the actual host. Troubleshooting steps: From the Nagios server i checked the config file: […]
Setting up vsFTPd to use SSL on FreeBSD
Notes: FreeBSD 9.1 / vsFTPD 3.0.2 / using a CA certificate 1) Ensure both private key and certificate are located in .pem. I named this vsftpd.pem 2) Edit the the vsftpd.conf file # vi /usr/local/etc/vsftpd.conf ### PASV FTP pasv_enable=YES pasv_min_port=49152 pasv_max_port=65535 port_enable=YES ssl_enable=YES ### SSL STUFF allow_anon_ssl=NO force_local_data_ssl=NO force_local_logins_ssl=NO ssl_tlsv1=YES ssl_sslv2=NO ssl_sslv3=NO rsa_cert_file=/usr/local/etc/vsftpd.pem 3) […]
Enable SNMP FreeBSD
1) Install Net-SNMP # cd /usr/ports/net-mgmt/net-snmp # make install clean 2) Create SNMP conf file # vi /usr/local/share/snmp/snmpd.conf syscontact [email protected] rocommunity public 10.0.0.1/24 syscontact Jordansphere syslocation London 3) Start SNMP service # /usr/local/etc/rc.d/snmpd start 4) Input line in rc.conf so it starts on a reboot # vi /etc/rc.conf snmpd_enable="YES"
Configuring MySQL Replication 5.5 in 6 steps
Scenario: You want to create a MySQL replication between an exisiting master and a brand new slave. Both machines running FreeBSD 8.x with MySQL 5.5. The master server currently has a mixture of InnoDB and MyISAM engines. A small amount of downtime is available. Master server: 10.1.1.1 Slave server: 10.1.1.2 (1) ON […]
Using Logrotate with MySQL Database Backups
Scenario: I wanted to backup all the databases individually from a MySQL server and keep for x days. I set about achieving this using a custom script combined with logrotate. The server is running FreeBSD 8.x. 1) Firstly, the script (backup-all-dbs.sh): #!/usr/local/bin/bash # backup-all-dbs.sh # backup each mysql db into a different file, rather […]
Add an IP alias to NIC on FreeBSD
Here are the steps for adding and removing an alias to a NIC on a FreeBSD 8.x machine. Find out the name of the NIC : # ifconfig As you’ll see from the above screenshot the NIC is called em0 Now to add the alias: # ifconfig em0 192.168.9.50 netmask 255.255.255.0 alias […]
MySQL Corruption: Error 1034 (HY000) : Incorrect key file for table ‘xyz’ ; try to repair it
Scenario: We upgraded from MySQL 5.1 to 5.5 (It was 4.1 in the past and possibly even 3.x before my time!). There seems to be some sort of corruption in a particular DB. The normal myisamchk and REPAIR TABLE functions didnt cut the mustard. Below are my steps to fix the issue. It appears that the […]
Installing and Enabling NRPE on Remote FreeBSD Server
Here are some instructions I had (from a couple of years ago may I add) to assist in setting up NRPE for remote monitoring from (eg) Nagios 1) Add nagios user. nologin 2) install nagios-plugins from ports (nagios-plugins-1.4.11,1 ) -> cd / /usr/ports/net-mgmt/nagios-plugins/ -> make -> make install 3) Set permissions -> chown […]
Login Incorrect when connecting from FreeBSD to SQL Server 2008 via FreeTDS
Scenario: I wanted to connect to an SQL server 2008 from a FreeBSD 8.2 machine using PHP5.3 and FreeTDS. We have a similar set up on another server running FreeBSD 7.2 with PHP 5.2 . This is still running in production and connecting to the same DB server successfully. The logical thing to do was […]