Archive for June, 2008

Integration of Internet Services In many ways, MySQL (Virtual web hosting)

Tuesday, June 10th, 2008

Integration of Internet Services In many ways, MySQL makes a great database and backend for many Internet and e-commerce services. MySQL offers a no-cost/low-cost licensing system, MySQL is versatile, and MySQL is both stable and fast. When combined with a low- cost/no-cost operating system such as Linux, MySQL can be the perfect backend for Internet services such as e-mail, customer tracking, virtual services, DNS, and authentication. Note Some privately funded studies claim that the Total Cost of Ownership (TCO) is at least as high with Linux as it is with Microsoft Windows although (given the fierce competition among vendors of operating systems), such studies may be less than objective. On the other hand, if you implement Linux on an Internet server, the low initial cost of acquiring the OS (as basic freeware) may not be the only outlay required. Other potential costs may crop up in such areas as technical support, overall network security, and compatibility with legacy systems though these are not unique to Linux. In my experience, running Linux often costs less but evaluate the needs of your own system carefully before you commit to a major change of operating systems. Linux can be downloaded for free or purchased for a relatively low cost with no additional licensing costs for 5 or 500,000 users. Powerful server software such as Sendmail and Apache do not require additional licenses and virtually no maintenance once installed. Linux is secure. When an update is released for almost any service running on Linux, the server does not need to be rebooted to apply the update. Finally, Linux has low overhead and can be installed on machines with lower hardware requirements. 19 1919 CHAPTER …. In This Chapter Authenticating users with PAM and NSS via MySQL Managing DNS with MySQL Integrating RADIUS with MySQL Using MySQL to integrate and manage e-mail Building a full-scale virtual-services interface ….
We recommend you use shared web hosting services, because many users agree that it is cheap, reliable and customer-satisfying webhost.

Web hosting - Chapter 18 . Replication 547 . Regardless of

Monday, June 9th, 2008

Chapter 18 . Replication 547 . Regardless of the type chosen for the replication set, monitoring replication is important. The size of the binary log can grow to no more than 2 gigabytes on some file systems; other issues can also arise that cause replication to fail. . Perl with the DBI/DBD can be used to produce a simple replication monitoring program for replication. . Using PHP, a more sophisticated monitoring program can be built that is accessible from the Web. . If an error or other unexpected event occurs, one or more servers in the replication set may break out of the set. If this happens, you will have to kick-start the replication by issuing commands or manually restarting replication. . One way to kick-start replication is to keep the original snapshot on the master and distribute that to the slave server. The slave server then replays the replication log to catch up. …
Searching for affordable and proven webhost to host and run your servlet applications? Go to Linux Web Hosting services and you will find it.

546 Part (Post office web site) V . Advanced Performance Figure 18-14:

Sunday, June 8th, 2008

546 Part V . Advanced Performance Figure 18-14: The replication set after kick-starting Summary Replication does not require a constant connection between the master and slave servers in a replication set. The administrator can fine-tune the databases or tables that he or she wants to replicate. This is done during the original configuration process for replication. . All servers in a replication set should be running the same version of MySQL because the format and options can change from version to version. . The server-id value set in the configuration file must be different for all servers in the replication set, regardless of their status as master or slave server. . The most common replication type is one master and multiple slaves. MySQL currently does not support multiple master replication, but there is some minor trickery that you can do to add redundancy. . A snapshot should be taken of the data to be replicated prior to starting the replication set. That snapshot must be distributed to all replication partners prior to starting replication.
If you are in need for chaep and reliable webhost to host your website, our recommendation is http web server services.

Chapter 18 (Yahoo web hosting) . Replication 545 3. Move the

Saturday, June 7th, 2008

Chapter 18 . Replication 545 3. Move the snapshot data into the data directory on the slave. 4. Start the slave server. Since you don t have to get a snapshot from the master, you don t have to stop MySQL on the master. This is a key feature for systems where uptime of the master server is crucial. Examining this type of method a little closer might be helpful. I set up an example that starts from the beginning creating a snapshot on the master. This step has to be performed just this one time; afterward, it won t be necessary unless the master server must be stopped for some unforeseen reason. I am replicating only the ecommerce database. To do that, I add the following line to the [mysqld]section of the MySQL configuration file on the master: replicate-do-db = ecommerce I stop the MySQL server on the master and make a backup of the ecommerce database. cd /var/lib/mysql mkdir snapshot tar -zcvpf ecommerce.tgz ecommerce mv ecommerce.tgz snapshot On the master server, I now have a snapshot of the ecommerce database as it exists at this point in time. That snapshot is safely stored in the snapshotdirectory on the master server. I can restart the master server s MySQL process. I now copy that snapshot to the slave servers. Personally, I prefer to use scp for this task; you may want to use ftp or some other method for transferring the file to the slave server. On each slave server, I stop the MySQL server and then change to the data directory. Next I unarchive the snapshot file that I transferred from the master, and use that file to overwrite the existing ecommerce database folder and files after which I can start the MySQL server on the slave servers. The replication set is up and running, as evidenced by Figure 18-14. If one of the slave servers goes down for any reason, I can simply copy the snapshot that I already created from the master, stop the slave server, overwrite the database, and start the slave server again.
Please visit our professional web hosting services to find out about cheap and reliable webhost service that will surely answer all your demands.

544 Part (Http web server) V . Advanced Performance When good

Friday, June 6th, 2008

544 Part V . Advanced Performance When good replication goes bad Monitoring replication regularly, you may encounter errors. For example, an error occurred within in my replication set (as shown in Figure 18-13). I attempted to restart the replication by using the RESET SLAVE command but because the ecommerce database already exists, the replication failed. Behind the scenes, the RESET SLAVE statement tells the slave server to forget its position in the replication logs and start over. For updates and changes, this can cause replication to fail on that slave server. The slave server attempts to re-create the database or table or perform some other statement. However; a conflict exists thus the statement will fail. In an instance such as this, you must restart replication across your replication set. The procedure to use follows some of the same steps you took to start replication: 1. Stop the MySQL server on the master. 2. Take a snapshot of the data. 3. Start the MySQL server on the master. 4. Copy the snapshot of the data to the slaves. 5. Stop the slave server. 6. Move the snapshot data into the data directory on the slave. 7. Start the slave server. The master and slave(s) now have the same starting point for data and can begin replicating from that known good set of data. Kick-starting replication revealed As a replication best practice, I make one snapshot of data on the master and copy that to a separate location on the master server. Then, when I have to restart replication on one or more slave servers, I can simply take that snapshot from the beginning of the replication and copy it to the slave server. Restarting replication on the slave server with that known data and issuing a RESETSLAVEstatement causes the slave to play back the entire replication log from the beginning, thus catching up with the master server. 1. Copy the snapshot of the data to the slaves. 2. Stop the slave server.
You want to have a cheap webhost for your apache application, then check apache web hosting services.

Chapter 18 . Replication 543 Examination of the

Thursday, June 5th, 2008

Chapter 18 . Replication 543 Examination of the output in Figure 18-13 shows that I have a problem with a slave in the replication set. It just so happens that the error leads directly into the next section of the chapter. Before you do so, however, you may have to make another improvement on the monitoring PHP script adding a refresh to the page so that it automatically runs every N seconds or minutes. Figure 18-13: The monitoring application built into PHP Kick-starting Replication Replication has become quite a robust addition to MySQL. As part of my work with MySQL, I administer a large MySQL replication cluster. Unfortunately, the cluster is built on an older version of MySQL and it s too vital to update in place. Accordingly (though the actual replication is acceptably stable), I ve had to get by without the benefit of some of the better and more recent replication commands shown in this chapter. This section examines what can be done if replication goes wrong including commands and statements that can kick-start replication.
Please visit Domain Name Hosting services for high quality webhost to host and run your jsp applications.

542 Part V . Advanced Performance The previous (Tomcat web server)

Thursday, June 5th, 2008

542 Part V . Advanced Performance The previous snippet calls the functions for querying the various replication servers. Again, by adding a feature to gather this data from a MySQL database, you could use one function and call the server based on what type it is as stored in your database. function slavestatus ($host,$username,$password) { $dbconn = mysql_connect($host,$username,$password) or die ( Cannot connect to database server ); $result = mysql_query( SHOW SLAVE STATUS ); $timeresult = mysql_query( SELECT NOW() ); $time = mysql_result($timeresult, 0, 0); The next step is to make a connection to the database and issue statements, including one that queries for the current time from the replication server. while ($status = mysql_fetch_array($result)) { $mysqlserver = $host; $file = $status[4]; $position = $status[5]; $run = $status[6]; $errnum = $status[9]; $errmsg = $status[10]; } Taking the results from SHOW SLAVE SERVER, I parse them into variables that make some sense for the application context. The code looks like this: if ($run != Yes ) { $color =
; $additional = $errnum - $errmsg

; } else { $color =
; } print $time

$color Slave

$color $host $file $position $run

$additio nal

n ; } The contents of the $run variable are examined. If it is anything other than Yesis found, the background color of the table cell changes to red (otherwise it s green). Pointing a Web browser to the page results in the listing illustrated in Figure 18-13. The replication status from Figure 18-13 is taken directly from output of the appropriate SHOW statement. Notice that there is no Yes or No applicable for the master server. This is because the master server doesn t know anything about replication or the slaves that replicate from it. It simply goes about its business of recording updates and changes to the binary replication log.
We recommend cheap and reliable webhost to host and run your web applications: Coldfusion Web Hosting services.

Chapter 18 (Hosting your own web site) . Replication 541 To enable the

Wednesday, June 4th, 2008

Chapter 18 . Replication 541 To enable the program on the monitor host to query the slaves adding a user on the slaves MySQL server is necessary. The user must have the processprivilege to issue the SHOWstatement. Consider this example: grant process on *.* to rmonitor@192.168.1.75 identified by maddog31 ; This statement is issued on all MySQL servers in the replication set. The monitoring host will be 192.168.1.75and will be monitored by user rmonitor. The code for the monitoring program is as follows: 192.168.1.136 , 1=> 192.168.1.1 ); $master = array(0=> 192.168.1.71 ); The previous code snippet builds arrays for master and slave servers. In my replication setup, there are only two slave servers and one master server. For an enhancement of this script, you could store the replication servers within a database and query for those servers. $username = rmonitor ; $password = maddog31 ; print

n ; print

n ; The previous snippet sets the values for connecting to the MySQL servers in the replication set as well as some basic HTML. foreach ($slave as $server) { print

n ; slavestatus($server,$username,$password); print

n ; } foreach ($master as $server) { print

n ; masterstatus($server,$username,$password); print

n ; }
You need excellent and relaible webhost company to host your web applications? Then pay a visit to Inexpensive Web Hosting services.

Free web space - 540 Part V . Advanced Performance Figure 18-12:

Tuesday, June 3rd, 2008

540 Part V . Advanced Performance Figure 18-12: The e-mail that results when there is a replication problem. Monitoring replication through the Web The script from the previous section can easily be enhanced to monitor a number of servers. In addition, that monitoring data can then be used to create a dynamic Web page with the results. This type of monitoring can be useful for proactively watching a group of servers. This section shows an example of replication monitoring through the Web. If, however, I use PHP to make a dynamic Web page, I have to convert the script to PHP. For this section, I assume you have PHP with MySQL enabled, as well as a working Web server. PHP offers an advantage over Perl for this application. Ideally, the monitoring page would include an auto-refresh so that the administrator can monitor the replication in pseudo real time. It can be done in Perl; however the solution is much more elegant in PHP. It can be done with a CGI; however, PHP makes it much easier. Using PHP as the development language, I can add an auto-refresh easily; and when the page updates, it will automatically re-run the statements to gather the performance data from the members of the replication set. The basis for the program will be a central monitoring host that sends the SHOW SLAVE STATUS statement to the replication slaves at regular intervals and also sends the SHOW MASTER STATUSstatement to the replication master. The program then outputs a Web page in table format with some pretty colors. Note
In case you need affordable webhost to host your website, our recommendation is ecommerce web host services.

Chapter 18 . Replication 539 (Web hosting reseller) The previous code

Monday, June 2nd, 2008

Chapter 18 . Replication 539 The previous code runs the system command ifconfig and does some minor massaging to get the IP address of this host. $dbh = DBI->connect( DBI:mysql::localhost ,undef, boo ); # Error Checking using an IF test. if (! $dbh) { print Connection unsuccessful!nn ; } $query = SHOW SLAVE STATUS ; $sth = $dbh->prepare($query); $sth->execute(); Nothing new for this section of the script. Standard Perl-DBI. Cross-For more information on the Perl-DBI and MySQL DBD, see Chapter 15. Reference The next snippet, however, shows some essential differences: while ((@status) = ( $sth->fetchrow_array() ) ) { $host = $status[0]; $file = $status[4]; $position = $status[5]; $run = $status[6]; } The previous section takes the output from the SHOW SLAVE STATUSstatement and parses it into variables that make sense for the various columns in the statement. if ($run ne Yes ) { open MAIL, |mail -s Replication Problem: $thishost suehring@braingia.org ; print MAIL REPLICATION PROBLEM on $thishostn ; print MAIL Replicating from: $hostn ; print MAIL Replication file: $file. Position: $positionn ; print MAIL Replication running: $runn ; close (MAIL); } The final section of the script evaluates the Slave_running column. Under normal operations the Slave_runningcolumn is Yes if replication is running. However, if the result is anything other than Yes, an e-mail will be sent to an administrator. The e-mail contents from the script are shown in Figure 18-12: This script could be run on a schedule with cron so that the system is automatically monitored.
You want to have a cheap webhost for your apache application, then check apache web hosting services.


Last Update Type IP Replication File Position Run?