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

December 23, 2013

scp: command not found

Filed under: Linux — Tags: , , , — admin @ 11:58 am

Today I was trying to copy something from one server to other using scp . But I have a surprise while I was running the correct command scp file.tar root@server:/home well a error was occurred that scp is missing. Now on sending server the scp was because I see the output of usage: scp when I try on destination surprise no scp.
which scp
/usr/bin/which: no scp in (/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)

So to install it just run :
yum install openssh-clients

December 19, 2013

subversion 1.7 on centos 6

Filed under: Linux — Tags: , , , , — admin @ 11:17 am

Well don’t know if you have try to upgrade the subversion on a centos 6 server however is quite a journey .
Let’s start:

yum groupinstall "Development tools"
cd /usr/loca/src
wget http://mirrors.hostingromania.ro/apache.org/subversion/subversion-1.7.14.tar.gz
tar -zxvf subversion-1.7.14.tar.gz
cd subversion-1.7.14
./get-deps.sh
./configure
make
make check
make install

I have to admit that I didn’t have time to wait the make check so I skipped directly to install .
When you will run the get-deps.sh you will see that it say something about mod_dav_svn and your version of apache. I am using the centos 6.5 and the httpd version is httpd-2.2.15 however if you are using mod_dav_svn then you will see that you must have httpd-2.2.25

Well because is not on repository this version and didn’t want to manually upgrade the httpd, I did a little trick because if you install those and try an httpd -t you will see this error.
httpd: Syntax error on line 221 of /etc/httpd/conf/httpd.conf: Syntax error on line 2 of /etc/httpd/conf.d/subversion.conf: Cannot load /etc/httpd/modules/mod_dav_svn.so into server: /usr/local/lib/libsvn_subr-1.so.0: undefined symbol: apr_hash_do

Well a simple fix is to remove the mod_dav_svn and reinstall it so :
The fix for me
rpm -e mod_dav_svn-*
yum install mod_dav_svn

and here is the httpd -t after
Syntax OK

December 3, 2013

Linux Wait IO Problem

Filed under: Linux — Tags: , , , , — admin @ 3:27 pm

One of the problem that is related to my latest post is the Wait IO problem. So if in top or other state command you see WA then is a problem with your IO.
But how to figure out what is the problem ?

Well first of all you can take a look on how your server is going with the waiting.
You can run vmstat to see what is happening.

vmstat 2
procs ———–memory———- —swap– —–io—- –system– —–cpu—–
r b swpd free buff cache si so bi bo in cs us sy id wa st
0 0 252848 1252264 2449400 20381888 0 0 25 77 3 1 6 2 58 29 0
0 1 252848 1241816 2449408 20381956 0 0 34 148 3102 2892 10 3 84 3 0
0 0 252848 1257000 2449408 20382036 0 0 0 468 1336 1201 3 1 33 58 0
3 0 252848 1243228 2449412 20382332 0 0 140 134 2278 1955 7 2 90 1 0
0 1 252848 1245444 2449420 20382460 0 0 68 304 2558 2255 7 2 40 42 0
1 1 252848 1231920 2449424 20382648 0 0 0 122 1708 1356 4 1 61 28 0

From here we are interested into the pre-last column the wa . From what we see there are all the time some values there, this mean the server is waiting the IO . Now we see that we have some problem.
But here you don’t see anything about what is causing this. You only check and see if you are having IO problem .

Please note, in this result, the sum of columns id (Idle) and wa (Wait IO) is almost 100, this is leading to some problem on configuration . In most of the cases is from ext4 journal.

How to find the cause ?
Well we can check with ps auxf command .

ps auxf |more
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 2 0.0 0.0 0 0 ? S Nov10 0:00 [kthreadd]
root 3 0.0 0.0 0 0 ? S Nov10 1:26 \_ [migration/0]
root 4 0.0 0.0 0 0 ? S Nov10 1:04 \_ [ksoftirqd/0]
root 5 0.0 0.0 0 0 ? S Nov10 0:00 \_ [migration/0]
root 6 0.0 0.0 0 0 ? S Nov10 0:01 \_ [watchdog/0]
root 7 0.0 0.0 0 0 ? S Nov10 0:07 \_ [migration/1]
root 8 0.0 0.0 0 0 ? S Nov10 0:00 \_ [migration/1]
root 9 0.0 0.0 0 0 ? S Nov10 3:33 \_ [ksoftirqd/1]
root 10 0.0 0.0 0 0 ? S Nov10 0:01 \_ [watchdog/1]
root 11 0.0 0.0 0 0 ? S Nov10 0:03 \_ [migration/2]
root 12 0.0 0.0 0 0 ? S Nov10 0:00 \_ [migration/2]
root 13 0.0 0.0 0 0 ? S Nov10 6:11 \_ [ksoftirqd/2]
root 14 0.0 0.0 0 0 ? S Nov10 0:01 \_ [watchdog/2]
root 15 0.0 0.0 0 0 ? S Nov10 0:02 \_ [migration/3]
root 16 0.0 0.0 0 0 ? S Nov10 0:00 \_ [migration/3]

And here we are interested about STAT column .

The stat can have this values:
D Uninterruptible sleep (usually IO)
R Running or runnable (on run queue)
S Interruptible sleep (waiting for an event to complete)
T Stopped, either by a job control signal or because it is being traced.
W paging (not valid since the 2.6.xx kernel)
X dead (should never be seen)
Z Defunct (“zombie”) process, terminated but not reaped by its parent.

Additional characters may be displayed:
< high-priority (not nice to other users) N low-priority (nice to other users) L has pages locked into memory (for real-time and custom IO) s is a session leader l is multi-threaded (using CLONE_THREAD, like NPTL pthreads do) + is in the foreground process group So from here we deduct that if the stat have "D" then is a problem with the process. To cut down process that is "eating" your CPU time, you can use this command which samples all process with D flag in every second: while true; do date; ps auxf | awk ‘{if($8==”D”) print $0;}’; sleep 1; done

Tue Dec 3 13:22:06 CET 2013
Tue Dec 3 13:22:07 CET 2013
Tue Dec 3 13:22:08 CET 2013
Tue Dec 3 13:22:09 CET 2013
Tue Dec 3 13:22:10 CET 2013
root 500 0.0 0.0 0 0 ? D Nov10 2:14 \_ [jbd2/sda6-8]
nobody 14675 0.1 0.1 134932 39620 ? D 13:20 0:00 \_ /usr/local/apache/bin/httpd -k start -DSSL
Tue Dec 3 13:22:11 CET 2013
Tue Dec 3 13:22:12 CET 2013
root 981 0.0 0.0 0 0 ? D Nov10 3:13 \_ [kjournald]
Tue Dec 3 13:22:13 CET 2013
Tue Dec 3 13:22:14 CET 2013

From the result you can see that [jbd2/sda6-8] [kjournald] is creating some problem.

Also you may use iotop or atop to see some stats.

You can check only those process with this command .

while true; do ps auxf | grep D | grep -E “(jbd2\/dm\.*|kdmflush)”; sleep 1; done

Ok, if the problem is related to the ext4 journal I think you should consider to remove that. If your server is on development you don’t need it, also if is in production then you may better use a raid for having your information in good condition.

Regards

Load without reason on centos

Filed under: Linux — Tags: , , — admin @ 1:09 pm

Hello
Well it appear that on a plesk server with only os reloaded we see some load.
I search the raid but it was finished to re sync so no load should be there .
After debugging with iotop I see this
505 be/3 root 0.00 B/s 0.00 B/s 0.00 % 99.99 % [jbd2/md1-8]

After a little search it appear that is from ext4 journaling.

Not to disable ext4 journaling is not so easy because you have to umount the partition, or to be monuted in read only .

After a little search I found out that rsyslog was the problem was hitting the limit, and was writing a lot of information into the log. After disabling the rsyslog everything was back to normal . However I am waiting again the problem to see what pid was causing this.

Any way strange problem .

Regards

Powered by WordPress