Tag Archives: Ubuntu

Percona apt repo with Key – Ubuntu

puppet code snippet

It works!

 

 

 

 

 

Using Puppet for configuration management is great.  So is using the high performance Percona DB.  Ditto for Ubuntu 18.04 LTS Bionic.   The issue arises when you are combining them and realize that all of the modules and easily located online resources use the old and deprecated short key, you can read more here:

https://www.percona.com/blog/2016/10/13/new-signing-key-for-percona-debian-and-ubuntu-packages/

You can read in the comments that some people asked for the current key… but didn’t get it.  I found using the installable .deb file that Percona provides to be a PITA with using the PuppetLabs Apt module:

https://www.percona.com/doc/percona-server/LATEST/installation/apt_repo.html

I jumped through some hoops (I should probably have documented that…) with gpg commands and the deb package and determined that the current repo public key is currently:

4D1BB29D63D98E422B2113B19334A25F8507EFA5

Want to put this to work in your own Puppet Module?  Here you go:

apt::source { 'percona':
  ensure   =>; present,
  include  =>; { src => true },
  location =>; 'http://repo.percona.com/apt',
  release  =>; $::lsbdistcodename,
  repos    =>; 'main',
  key      =>; '4D1BB29D63D98E422B2113B19334A25F8507EFA5',
  } ->;
  Class['apt::update']

This should work fine with other flavors of Ubuntu like 16.04 and you can also use it to get a repo installed for xtrabackup (make sure you use apt to get xtrabackup24 otherwise you’ll get the very aged version from Ubuntu sources).

Editing DNS in Ubuntu 12.04 Server

http://askubuntu.com/questions/130452/how-do-i-add-a-dns-server-via-resolv-conf

That link really helped me out.  Essentially you just follow through this example:

Edit the /etc/network/interfaces file. The same configurations that you would have written to resolv.conf can now be in the same file as your network adapter configurations like the example below:

# The loopback network interface
auto lo iface lo inet loopback

# The primary network interface
auto eth0 iface eth0 inet static
address 192.168.1.2
netmask 255.255.255.0 
network 192.168.0.0 
broadcast 192.168.1.255 
gateway 192.168.1.1

dns-nameservers 75.75.75.75, 75.75.76.76
dns-search local
dns-domain local.domain

I found this sample very handy in setting up a 12.04 Server instance. So many posts are about the network manager, but that isn’t available with out installing many other packages, etc.

–Nat

Ubuntu 10.04 SSD Tweaks

Reduce “swappiness” to 0

This prevents the swap file from being used unless it is actually needed, preventing unnecessary write cycles on the drive.

Code:
vm.swappiness=0

Edit /etc/sysctl.conf by using your favorite editor :
$sudo gedit /etc/sysctl.conf

If the line doesn’t exist, you will need to create it.

After reboot vm.swappiness is 0

Enable TRIM (if applicable)

Uninstall proprietary (ie, video card) drivers first. The 10.6 cats included didn’t like the newer kernel and it really garbled up the video driver install process.

Update to a newer kernel. 2.6.33+

Edit your /etc/fstab file so your SSD line looks like this:

UUID=of your SSD here / ext4 noatime,discard,errors=remount-ro 0 1

After reboot TRIM should function.

Links I found useful:

http://ubuntuforums.org/showpost.php…1&postcount=43 (swapiness syntax)
http://ubuntuforums.org/showthread.php?p=9740235 (fstab discussion)
https://help.ubuntu.com/community/RadeonHD (link to Kernel versions and an explanation of how to update)

http://forums.anandtech.com/showthread.php?t=2069761 (incredibly informative forum posting about SSD drives in general)

Enjoy!

–Nat