Basic stability and Language compatibility testing on LDAP

2006年9月17日 21点02分 没有评论

Basic stability and Language compatibility testing on LDAP
Wrote by Phillip Huang

Index
– Target
– Testing Environment
– Testing Process
– Testing Result
– Following up
– Summary

1. Target
Test the stability of LDAP service when create a large number of users. Specify “getent passwd” and “ldapsearch -x” command usage. Test LDAP service whether it supports Chinese characters set or not.

2. Testing Environment
Machines/Software:
192.168.123.21: LDAP service (port: 390) running based on ‘iplanet’, Operating system is Windows 2000 Advance server (Service Pack 4).
192.168.123.22: PC, with CentOS 4.3(Fully installation).
192.168.123.62: SNAZ OS 4
Network Environment: LAN (10Mbps)

3. Testing process.

3.1 Preprocessing
In machine ‘192.168.123.22’, log on as ‘root’. Install ‘smbldap-tools'(referring to smbldap tools How-to Manual). And then create a shell script ‘ldaptest’ as following text:
#! /bin/bash
# script name: ldaptest
echo “Start: `date`”
for ((i=1;i<=10000;i++)) do /usr/local/sbin/smbldap-useradd -m "testuser$i" done echo "End: `date`" Here, set the script executing privilege: # chmod 777 ldaptest In machine ‘192.168.123.62’, login as ‘root’, and modify the ‘/etc/openldap/ldap.conf’ as the following text: #BASE dc=example, dc=com #URI ldap://ldap.example.com ldap://ldap-master.example.com:666 #SIZELIMIT 12 #TIMELIMIT 15 #DEREF never BASE dc=plasmon, dc=com #HOST 192.168.123.8 #HOST 192.168.123.21 uri ldap://192.168.123.21:390 3.2 Create user with Chinese character set There are two ways to create users: ‘smbldap-useradd’ command and iplaned console. For smbldap-tools, log on ‘192.168.123.22’ as root, type the texts ‘#smbldap-useradd Chineseusername’, here, input Chinese characters in Chineseusername location. And then press ‘enter’ to confirm issuing this command. Watch on the return message. No message means the operating has been done successfully. Any other information means failure.(Also, you could get the status by issuing “echo $?”). In the LDAP server which is located at ‘192.168.123.21’, open iplanet console, and turn to ‘users and groups’ table. Add new users, and input the user profile table as possible as Chinese characters, special focus on ‘uid’ and ‘user name’ items. 3.3 Create large number of users In machine ‘192.168.123.22’, login as ‘root’, run the ‘./ldaptest’ script firstly. In machine ‘192.168.123.62’, login as ‘root’, issue the ‘getent passwd’ and ‘ldapsearch –x’ in command line to view the users added to LDAP database. For double checking, in machine ‘192.168.123.21’ hold LDAP service and database, open ‘iplanet’ console, and list all returned users from query. 3.4 End working When the ‘ldaptest’ script runs completely, record the ‘Start’ and ‘End’ time information. Keep on watching at ‘getent passwd’ result, and compare it with what iplanet shows. 4. Testing Result At the beginning, ‘ldaptest’ script worked well, and the added users could be viewed from ‘getent passwd’ result. In ‘192.168.123.62’, also issued ‘getent passwd | wc –l’, the number of lines increased as expected. After about 30 minutes, the machine ‘192.168.123.22’ running "ldaptest" script got warning messages: Cannot confirm uidnumber is free at /usr/local/sbin//smbldaptools.pm line 1062 No user could be inserted now. In machine ‘192.168.123.62’, ‘getent passwd’ only showed the former 2030 items. the rest added uses are not listed and seemed to be ‘lost’. But I would get those users information by issuing ‘getent passwd testuser’. For example, it proved ‘testuser4600’ was existed: # getent passwd testuser4600 This command returned the ‘testuser4600’ entry from LDAP database. Run ‘ldapsearch -x’ commands on ‘192.168.123.62’, the result did not contain all the user entries and it showed the warning message: # search result search: 2 result: 4 size limit exceeded In "192.168.123.21", iplanet console would show more users (about 4500), but not all. e.g., one user like ‘testuser4800’ would be searched and return its profile, but it is not displayed in iplanet user list. In order to specify how many users had been created, I just guessed by issuing the following commands on ‘192.168.123.62’: # getenv passwd testuser10000 If no result returned, continued with: # getenv passwd testuser5000 If ‘testuser5000’ existed, try the middle number between 5000 and 10000, and so on. If ‘testuser5000’ did not existed, user number less than 5000 to do the loop until the identified number has corresponding ‘testuser’ entry. Finally, I found the count was 4820. It means "ldaptest" had already created 4820 users. I stopped the "ldaptest", just executed: # smbldap-useradd newtestuser It failed with the same warning message like ‘ldaptest’ script got early . Then, identified the ‘uid’ and tried again: # smbldap-useradd -u 20000 -a newtestuser This operating still failed to add ‘newtestuser’, smbldap tools indicated it could not confirm the uidnumber is free. Later, I used the reversed loop script "smbldap-userdel testuser$i" to delete all users whose name begin as ‘testuser’. In the first 15 minutes, ‘getent passwd’ showed the rest ‘testuser$i’ users, and the returned lines always hold at 2030. After 15 minutes, the "getent passwd | wc -l" result became to decrease, and finally all "testuser$i" users were deleted. Now, I could add user again without smbldap tools warning messages. Then I repeated the whole test again. And the secondary result was same as the first one. Only 4820 users could be inserted to the iplanet LDAP database. It’s a limitation. Another testing project, both smbldap tools and iplaned could accept Chinese characters to setting the user profiles except of uid and email. If set Chinese uid, there was the following error message: The value is not 7-bit clean. Constraint violation Later, I deleted ‘uid’ limitation from iplanet ‘7-bit clean’ rules, Chinese was able to input as uid, and it also was found when query by Chinese string in iplanet. Smbldap tools, did not support Chinese uid as issuing in command line mode, and the inserted Chinese uid user could not be returned during query. 5. Following up In order to display all user in ‘getent passwd’, in machine ‘192.168.123.21’, I modified the ‘c:iplanetserversslapd-plz/config/des.ldif’, changed the nssizelimit value to ‘-1’(default nssizelimit is ‘2000’, ‘-1’ means no limit). Then restart iplanet service, more users were listed but not all. This way did not affect the ‘getenv passwd’ returned result, it still hold 2030 without changing. On the third tools LAT connecting to ‘192.168.123.21’ LDAP service, It would only display 1000 accounts as maximum value(Loren is fixing this issue, and today sent me a new patch). Searching the added users as "testuser4820" and "testuser4800" which were not listed on LAT, both of them could be found and return profile. When I’m going on researching, the LDAP server ‘192.168.123.21’ crashed and all the data lost. We had to format the hard disk and install new OS. Testing is also halted. Since iplanet has these issues and I have to wait its reinstallation, I plan to test on another LDAP server(OpenLDAP) in these days to focus on maximum user count. 6. Summary Iplanet LDAP server seems to have limitation on users count. This issue is waiting to be confirmed in the following up testing. ‘getent passwd’ and ‘ldapseach -x’ could not display all users, only a part of users were returned. In iplaned, Chinese could not be used as ‘uid’ until modify the ‘7-bit clean’ rules. Smbldap tools do not accept Chinese character as ‘uid’ whenever.

分类: 科技 标签:

OpenLDAP Installation

2006年9月17日 16点59分 没有评论

It took me about a week in researching OpenLDAP+SSL installtaion. The troubles I met mostly are OpenSSL and Berkeley DB configuration. Here should I write the step used to install them successfully.

Testing Operating System: CentOS 3.5 (On Virtual Machine)
Virtual Machine setting: P3/256M/6G/Bridge Network
Basic Operating System: CentOS 4.3(Final)
Hardeware: P4 1.7GHz/DDR266 512M/80G IDE

1. Install openSSL
Download the latest version “openssl-0.9.8c.tar.gz” from www.openssl.org/source. Check the former openssl which has been installed in the system, by issuing the following commands:
# rpm -qa | grep openssl
As the result, it showed openssl-0.9.7a and openssl-devel-0.9.7a. I tried to remove these two packages by “rpm -e”, but then the two have so many packages depending and I could not done the delete operation. Then I downloaded the rpm packages:0.9.8c.rpm and devel-0.9.8c and tired to update : rpm -Uvh *.rpm, it also failed. Note, the openssl-develop package must be installed, or in OpenLDAP installation would have errors. Finally, I decided to use and complie the source package like “.tar.gz”. This source code has already included the development packages as openssl website indicates.

Unzip the tarball package and go to its directory:
# tar zxvf openssl-0.9.8c.tar.gz
# cd openssl-0.9.8c
Here, I set the “–prefix” paramter as “/usr/local/newssl”, if this parameter is not set, it will use “/usr/local” as default. The most important thing could pay attention, is “shared” parameter must be add with configure command. “shared” means in addition to the usual static libraries create shared libraries. If shared is not set, OpenLDAP installation will failed.
# ./configure –prefix=/usr/local/newssl shared
Guess on system mode by issuing:
# ./config -t
Begin to build:
# make depend
# make
# make test
# make install
Create links as following:
# cd /usr/local/newssl/lib
# ln -s libcrypto.so libcrypto.so.2
# ln -s libssl.so.0.9.8c libssl.so.c
Update the library:
# echo /usr/local/newssl/lib >> /etc/ld.so.conf
# lddconfig -v
Update the PATH:
# vi /root/.bash_profile
PATH=/usr/local/newssl/bin:$PATH:…
Note, here “/usr/local/newssl” could be added in the first position.
Check SSL installation:
# which openssl
If successful, it will show “/usr/loca/newssl/bin/openssl”
# openssl version
If successful, it will show “0.9.8c”.

2.Install Berkeley DB4.3
Download the source code, unzip and compile:
# tar zxvf BerkeleyDB.4.3.tar.gz
# cd BerkeleyDB.4.3/build_unix
# ../dist/configure
As the default, Berkeley DB will be installed at “/usr/local” directory.
# make && make install
The most important in this stage is recovery the former Berkeley DB version 4.1 which has been installed in the OS. If ignore this step, during OpenLDAP installation, it failed with “Berkeley DB version dismatch”.
# cd /usr/lib
Remove all items named “libdb4.1”, and copy all the 4.3 libraries in “/usr/local/BerkeleyDB.4.3/lib” to “/usr/libdb4.1”. Ok, everything about Berkeley DB has been configurated successfully.

3.Install OpenLDAP
Download the source code from www.openldap.org, the version I used is 2.3.29.
Unzip the package:
# tar zxvf openldap-2.3.29.tar.gz
Before “configure”, the env must be set rightly,”CPPFLAGS” is the path of OpenSSL and Berkeley DB’s include directories location, and “LDFLAGS” is the path of OpenSSL and Berkeley DB’s library directories location.
# env CPPFLAGS=”-I/usr/local/newssl/include -I/usr/local/BerkeleyDB.4.3/include” LDFLAGS=”-L/usr/local/newssl/lib -L/usr/local/BerkeleyDB.4.3/lib” ./configure –with-tls
If all the above steps are set rightly, the configure process will create make file without errors.
# make
# make install

Finally, run “/usr/local/libexec/sladp” in the command line to check whether the installation has been done or not. if the sladp runs well, it means the successful installation.

分类: 科技 标签:

Saturday

2006年9月16日 21点02分 没有评论

Today is Saturday. I’ve been in Zhuhai for about 1.5 months. Through the beginning hard days, I would put all my heart in the Linux development. It’s a really intersting world and charming. How happy when I install iPlanet,create large number of users by ldif, export and import entries again and again, sometimes also did I feel very tired, and even wanted to give up. But I decided to keep on fixing all the issues, and then I got it! I could not decribe that feeling when found the right way by many testings. It’s really life, really researching. None of my earilier days in Shenzhen gave me the feeling. Robert, the father of the weatherman said, the hard things are always the right things.

I’ll write some articles about latest two weeks experience. It’s very important.

分类: 科技 标签:

Two days researing on iplanet/LDAP/LDIF

2006年9月10日 16点00分 没有评论

Saturday, Sunday, install and configure iplanet successfully, and create large number of users by LDIF database.

Put all heart in reseaching, is funny thing.

分类: 科技 标签:

LAT-LDAP Administrator Tool

2006年9月3日 11点02分 没有评论

LAT stands for LDAP Administration Tool. The tool allows you to browse LDAP-based directories and add/edit/delete entries contained within. It can store profiles for quick access to different servers. There are also different views available such as Users, Groups and Hosts which allow you to easily manage objects without having to deal with the intricacies of LDAP.

The latest stable release of LAT is 1.0.6 which was released on June 30th, 2006. The latest development release of LAT is 1.1.6 which was released on August 28, 2006.

SambaLMPassword and SambaNTPassword have not been encrypted issue:

Opened: 2006-09-01 02:39 CDT Phillip Huang
Hi, I am using LAT 1.0.6 on CentOS4.3,LAT is really a userful tools on LDAP administration. Today I added some SMB attributes to a user, and tried to changed this account’s SambaLMPassword and SambaNTPassword which two seems to
have been encrypted. In the path “Browers-User-Phillip”, I modified these two passwords to the string “testpassword” and pressed “Apply”, and then I found in the right frame, both”SambaLMPassword” and “SambaNTPassword” were showed as “testpassword” without encrypted!

Absolutely, I could not use this samba accout to access SMB shares through LDAP certification. Hmmm. and I tried to copy other certified user’s encrpted password string instead of “testpassword”, yes, could access smb share later.
Lorenb, would you please tell how me to modify the SMBpassword in LAT directly? Many thanks.

From Loren Bandiera 2006-09-01 07:58 CD
You can’t use the browser portion to set passwords in 1.0. That has been fixed in 1.1 branch (it will eventually be v1.2).
You can however use the User view. If you go to Views -> Users, you can do one of the following:

a) Right click on Phillip and select “Change password”
b) Double click on Phillip, select the ‘Account’ tab, and click on the ‘Set password’ button.

That will set the Unix and SAMBA passwords. Let me know if that works for you.

From Phillip Huang 2006-09-02 21:03 CDT
Hello, Loren, thanks for your cencern. I just try following with your guide, the first “Right click on phillip and select “change passwd” operation is ok, and I am a litter confused which option I will take, Crypt,MD5 or SHA? It seems
the “SHA” option is default setting.

Then the second step, when double click, the LAT crashed, there are error messages like the following text:

[root@localhost ~]# lat
(lat:2898): Gtk-WARNING **: Mixing deprecated and non-deprecated GtkToolbar API is not allowed
(lat:2898): Gtk-WARNING **: Mixing deprecated and non-deprecated GtkToolbar API is not allowed
(lat:2898): Gtk-WARNING **: Mixing deprecated and non-deprecated GtkToolbar API is not allowed
(lat:2898): Gtk-WARNING **: Mixing deprecated and non-deprecated GtkToolbar API is not allowed
(lat:2898): Gtk-WARNING **: Mixing deprecated and non-deprecated GtkToolbar API is not allowed
Unhandled Exception: System.ArgumentException: Key duplication when adding: 515
in <0x001f2> System.Collections.Hashtable:PutImpl (System.Object key,System.Object value, Boolean overwrite)
in <0x00012> System.Collections.Hashtable:Add (System.Object key, System.Object value)
in <0x00291> lat.EditUserViewDialog:getGroups (Novell.Directory.Ldap.LdapEntryle)
in <0x000b6> lat.EditUserViewDialog:.ctor (lat.LdapServer ldapServer,Novell.Directory.Ldap.LdapEntry le)
in <0x0006f> lat.ViewDialogFactory:Create (System.String name, lat.LdapServer server, Novell.Directory.Ldap.LdapEntry le)
in <0x00038> lat.ServerView:OnRowActivated (System.Object o,Gtk.RowActivatedArgs args)
in (wrapper delegate-invoke)
System.MulticastDelegate:invoke_void_object_RowActivatedArgs (object,Gtk.RowActivatedArgs)
in <0x001a1> Gtk.TreeView:RowActivatedSignalCallback (IntPtr arg0, IntPtr arg1,IntPtr arg2, IntPtr gch)
in (wrapper native-to-managed) Gtk.TreeView:RowActivatedSignalCallback (intptr,intptr,intptr,intptr)
in <0x00000>
in (wrapper managed-to-native) Gtk.Application:gtk_main ()
in <0x00007> Gtk.Application:Run ()
in <0x00007> Gnome.Program:Run ()
in <0x00238> LdapAdministrationTool:Main (System.String[] args

Oh, my LAT is 1.0.6 which is stable version. I downloaded the latest version
1.1.6(rpm), and try to install this package, it warnes me:
[root@localhost temp]# rpm -ivh lat-1.1.6-1.noarch.rpm
error: Failed dependencies:
avahi-sharp is needed by lat-1.1.6-1.noarch
dbus-sharp is needed by lat-1.1.6-1.noarch
Would you please give me more advice to resolve my trouble? Thanks and regards.

分类: 科技 标签:

Read more books

2006年9月1日 21点10分 没有评论

Today is the 34th days I came to Zhuhai. It is a quiet city, I love the blue sky and clear air.Here’s my new friends: Charles,Steven,Bruce,Sam,Hans,More,Red,Mike,and two girls,Spring and Vicky.

No time could be wasted. Read more books.

分类: 科技 标签:

SCSI and IDE(hardware cache)

2006年8月28日 20点29分 没有评论

The harddrivers always have cache for buffer the data. The cache is very fast than both harddrivers and Host Bus, so it is impossible to form continous transfer stream in the Host Bus, because it acts like middlestone between harddriver and host bus. I think the following example would indicate the factor more clearly.

Just image, in an operating system, copy data from harddriver “A” to harddriver “B”.

SCSI: because the cache is more faster device, it always has to wait for harddisk to full it. when the cache is full, A will send all the data in cache to host, in this time, the cache is receiving data again, and the host send the data to B through host bus! Yes, it saves time and increase the transfer rate greatly.

IDE: A will hold the channel single until it writes all data to host memory, even there’s other way which is free when A’s cache is fulling. This mode waste a large machine time and has low rate.

Absolutely, SCSI is more powerful than IDE.

分类: 科技 标签:

SCSI ans IDE

2006年8月28日 20点02分 没有评论

Serial Attached SCSI is running SCSI command set on the electric and physical lyers of Serial ATA. So call it “SAS”.

SCSI ans IDE:
1.Connecting ability: Ultra SCSI has 16bit host bus, and each SCSI channel holds 15 devices; IDE is also 16bit as SCSI,but only two devices would be supported. The length of ATA cable should not be more than 0.5m.

2.Adapter: In the early, ATA used PIO(Programmer Input Output) transfer mode, every I/O operation need CPU resource, so the processor is alway in a high working rate, even sometimes the whole system looks halt without no responding.With the development to Ultra ATA, DMA(Direct Memory Access) increases the performance, the system accesses interface device through DMA, not as former tools “CPU”. To SCSI, it has its own powerful adapter which need litter cpu resources.

3.ATA Channel: ATA Channel is not shared.The primary channel has he prior, for example, it is why we usually set the harddisk to “primary” or “slave” when having two. Note, whoever hold the ATA channel, the other one device could not access and only has to wait for the ending of the current one.

分类: 科技 标签:

ssh accessing

2006年8月28日 19点37分 没有评论

One machine whose IP is 192.168.123.78, and could be accessed by ssh. Later, I re-installed this machine with the same Linux system, and then try to log in by ssh, but to my surprise, I was refused! So many times I tried, finally found the resolution: On my own computer, “vi” the file “/root/.ssh/known_hosts”, and delete the line comprising the strings “192.168.123.78”. At this time, I could login on 78 successfully.

分类: 科技 标签:

Some useful tips

2006年8月22日 21点03分 没有评论

Simply script to find number of files in current directory:
# ls | awk ‘{x++}END{print x}’

Create identified size file:
# dd if=/dev/urandom of=targername bs=1M count=100
bs: block size

Check the video card status:
# glxgears
glxgears is a GLX demo that draws three rotation gears, and prints out framerate information to stdout.
# glxinfo
display info about a GLX entension and OpenGL render.
Note, we could use “winex” to play CS and WARIII.

What the capacity of harddisk are different from the value appeared in Linux system? For example, a 40GB harddisk seems to only have 38GB in OS?
First, it is caused by different measurement, the harddisk manufactor use 1000byte which is easy for calculate, but the system uses 1024byte.
Second, harddisk must be formatted before using, note, this formating operating would also contains some spaces on disk.

How to test harddisk transfer rate(Interal):
# hdparm -Tt /dev/hda
# hdparm -Tt /dev/sdb

IOP acts as chipset and CPU, if we just look RAID card like a motherboard. By adding different control chipset,eg, SCSI,SAS,SATA, we could make all these type RAID products.
IOP is made by Intel:
IOP331 supports PCI-X(1.0)
IOP333 supports PCI Express

分类: 科技 标签: