How to , and other stuff about linux, photo, php … A linux, photography blog. To remember some linux situation, and fix them quickly.

December 23, 2011

Using Domain Names With Elastic Load Balancing route53

Filed under: Linux — admin @ 12:33 pm

Well a few day’s ago I have to setup a domain to use loadbalancer from Amazon.  Well there are 2 posibilities

1. You may associate a subdomain  with CNAME to loadbalancer, however this is not a good solution because you may not use ex: matrafox.info you may use only www.matrafox.info

2.  Move the domain to amazon also use route53 and you may add alias to domain also. How you may do this.

elb-associate-route53-hosted-zone myLoadBalancer –rr-name example.com –hosted-zone-id Z123000000 –weight 100
elb-associate-route53-hosted-zone myLoadBalancer –rr-name www.example.com –hosted-zone-id Z123000000 –weight 100

And if you want to remvoe just use
elb-disassociate-route53-hosted-zone myLB –rr-name example.com –hosted-zone-id Z123000000 –weight 100

myLoadBalancer – is the name of your load balancer
example.com – name of your domain
Z123000000 – this you will get from route53 page. Each domain has a unique zone id
weight – is something from route53 that you need it.

However wehen I try this solution I have this error:
elb-associate-route53-hosted-zone: program error

It appear that this error was because the domain was not fully propagated.

However to use this second solution you have to know your credential, and have installed their api.

One other simple solution is to add directly into route53, how you do this ?
1. go to ec2/load balancer and copy dns name of your load balancer ex: MyLoadBalancer-0000000000.us-east-1.elb.amazonaws.com , and his name ( myloadbalancer )
2. go to route 53 and edit your domain.
3. Chose what you want to be on load balancer .
and the parameter are
A – IPV4 address
Alias : yes
alias target: ( name of your load balancer ) myloadbalancer ( this will be all with low letter )
Weighted Set: yes
Weight : 100
Set id: MyLoadBalancer-0000000000.us-east-1.elb.amazonaws.com. ( do not forget the dot from the end )
And save this is preaty easy because you don’t have to use a lot of commands.

ngnix php apc memcached – connection stay active

Filed under: Linux — admin @ 10:58 am

Well, one client complain because the server start going to be verry slow. After a short look, I see that where over 20k ESTABLISHED connection from php-fpm to memcached server.

The main problem was that the server didn’t verify if have a connection active and every time was adding a new one.

After a short search we nottice that we have the stable version of memcached ( php module ) , and the new one have something like isPristine function, you won’t find anything on official documentation on pecl site.

So, the fix was to upgrade to memcached-2.0.0b2 .

How to upgrade memcached:

pecl uninstall memcached

pecl install memcached-2.0.0b2

After this you may use into php code  isPristine

 

 

December 22, 2011

how to set keyword azerty on centos

Filed under: Linux — admin @ 11:18 am

Well today I face another problem. I use Oracle VM VirtualBox Manager, and because of time consume to install a linux from dvd, I search and download a image from internet.

Well everything was good until I boot up and try to write something on that virtual machine. The keyword was mess up.

I search a little on internet and a lot of people sugested to use  system-config-keyboard however I don’t have any GUI installed, and I wanted to make it work from command line.

Well finally I found that you may fix this by using

loadkeys us

After using this you will see tha path to configuration file, on my server are located  “/lib/kbd/keymaps/i386/” . There you may find what you need and after that just run loadkeys and the name of the file without map.gz

 

December 19, 2011

DataStax OpsCenter “not recognize”

Filed under: Linux — admin @ 2:55 pm

Well , today I was trying to install DataStax OpsCenter on a Centos 5.4 ( 5.x ) . After download and configured when to start I see a error. Well this was because on that version the python on that server is 2.4  more exaclty python-2.4.3-44.el5_7.1 .

How to upgrade centos 5.x with python 2.6 ? Well the solution is to yum install python26.

Will install another package and the DataStax OpsCenter will start working.

 

 

December 15, 2011

Deleting mail in postfix queue (mailq)

Filed under: Linux — admin @ 10:43 am

Well another problem.

One friend call me  that his server can’t send / receive e-mails. After I got ssh logins I see with mailq that where more then 20000 e-mail on queue.

Well I decided to remove all e-mail from queue  but how to do this.

Well the magic command is :

postsuper -d ALL

this will erase all e-mail from mailq queue

If you want to remove just one e-mail id run

postsuper -d mailID

Hope will help someone.

« Newer PostsOlder Posts »

Powered by WordPress