A complete website on-line process

Source: Internet
Author: User
Tags memcached snmp switches bacula dell r710

On-line process


1. The on-line process consists of the following:
1.1. Network planning
1.2. System Planning
1.3. Data migration
2. What the network planning contains
2.1. Select Room
2.2. If you need to divide multiple network segments
2.3. Does the export need VSRP
2.4. How to backup between switches
2.5. The connection speed between each switch
3. What the System plan contains
3.1. Select a server
3.2. Select storage
3.3. Select the operating system
3.4. How the site is layered
3.5. How well each application is distributed to different servers
3.6. Monitoring of the system
3.7. Backup of the system
4. Data migration
4.1. Migration of static storage
4.2. Migration of databases

Select Room
Choosing a computer room in China is a very headache, you have to consider whether your site serves the object belongs to Netcom or telecommunications, as well as other small operators. However, there is basically no such problem in foreign countries. Just choose a better route to the basics. From the domestic to the foreign server if you can keep within 20 hops even if it is possible. If you're still unsure about testing around the world, you can find a similar speed test site. For example, Banreee, Networkbench, Gamez are better test sites.

Network Segment Planning
In the room selection, it is necessary to carry out the network segment planning, especially when your internal server interaction between very frequent cases, it should be very good planning, different requirements of the server must be placed in different VLANs, especially jealous partition very large network segments, so the broadcast storm will be more serious. There are 2 types of sub-segments I personally think that someone is to put the whole set of servers in the same network segment, the entire server contains all the front-end, middle and back-end and database, this feeling is the game class will do such planning. There is also a separate VLAN for all front ends, a separate network segment for the middle tier, a network segment for the backend, and a separate network segment for the database. This when your site size is smaller than the case can not be divided, after all, the switch is not so much, in the future if you want to replace the server for other purposes, you must also change the VLAN number of a port on the switch, once changed more than even their own can not remember.

Vsrp
The VSRP is a high-level protocol for switches that are used to mutually redundant protocols between 2 switches. If you want to do VSRP between 2 switches, it is generally required 6 public network ip,3 is pointing to the computer room gateway, and the other 3 is to do the local server gateway. 2 of them are used as virtual IPs. All intranet servers should point to that internal virtual IP. If there is a down between the 2 switches, it will not cause the website to be inaccessible. But this requires more high-end switches, such as H3C's S5500 ei series. and 2 switches to connect at least 4 fiber, so that 2 switches to interact with each other data. The following switches also need to connect 2 or 1 fibre to 2 switches, which are used to compare the switch ports. So the general is to buy 48 mouth to compare insurance. If it's just a small website, that's not necessary.

Switch backup
There are 2 kinds of switch backup, one is hot standby and one is cold standby.
First of all, the cold is to configure a switch to be the same as the switch running on the line, once the problem occurs on the line, notify the room to replace the switch, and reconnect between the server and the upper switch.
The hot spare is that once a switch has a problem, it automatically switches to another switch without having to notify the machine room to reconnect and the server does not need to reconnect. However, this scenario requires a server to have at least 4 network cards, and then the switch directly to do the redundancy settings, so it is more expensive, of course, if you are not short of money can be fully used in this scenario.

Speed of connection between switches
This look at the specific business, the core switch between the best to have 4G upstream and downstream bandwidth, and the core of the lower level of the switch is also at least 2G bandwidth, otherwise your data internal interaction is very frequent bottlenecks. Select switches also focus on the backplane bandwidth of the switch. If the backplane bandwidth is not high, then the speed of connection between the switch is not much use AH.

Pick a server
Pick a server is a complex process, first of all to determine your needs, such as your site database is read, update and insert less, then you need only RAID1 or RAID5 on the hard disk. That would only take 3 hard drives. And if your database belongs to update and insert more, then the hard disk is better raid0+1, so that the performance of the hard disk. And for the CPU and memory selection, see your needs are a lot of CPU or memory, if you only do squid such a memory-consuming program, the CPU needs to be lower, and the memory will be selected to more, specific to your needs, some companies directly on the 128G memory such. While some programs just consume the CPU, and for memory requirements is low, this is you have to choose a balance, so good later can be replaced by other purposes. and choose a good CPU, memory and hard disk after the choice of server manufacturers, and now almost mainstream server vendors have a variety of models of servers, can also be customized, especially when you have a particularly large demand. Select the server when you have to test the situation of power consumption, like previously tested H brand server and L brand servers in the configuration of the same situation, the power consumption difference is 30%. So the same cabinet can add several machines.

Select storage
Storage has professional and non-professional, professional have NETAPP,EMC such company. But no money and the data is not growing particularly fast just need to NFS, and companies will be equipped with their own machines for storage, now 2T SATA Hard drive is also very cheap. And some of the more demanding Internet companies, some users upload more than 2TB of data per day, that with NFS is certainly not appropriate, in the premise of not using professional storage, it can only choose GFs such a distributed file system to be stored. There are a lot of solutions now, there are Yahoo's Hadoop,redhat gfs, and others such as Fastfs and so on, but each GFS has its own needs to adapt, some for large files such as video files such as storage, and some are for small files such as various log storage.

Select operating System
Operating system is of course the main Linux, see a variety of requirements are also some suitable for other operating systems, such as a gateway server, that using FreeBSD is appropriate. And as a Web site needs or Linux good, operating system Gentoo, Ubuntu, CentOS, Opensusu, these are now open source free. Choose operating system not only to look at the operating system itself, but also some drive, if installed on the server, running after the operating system has found that the network card driver problem, then the trouble. such as the installation of the Dell R710 Server, installed CentOS incredibly NIC driver has problems, fortunately, the test found the problem, with patches to solve. Otherwise, it would be troublesome to go on the line and have a problem. So when you buy a server, you have to go to the official website to check it for the supported operating system. Choose a good operating system depends on the choice of what kernel, 2.6.30 and 2.6.31 in some applications run up or very different. In particular, support for multi-threaded threads. Choose a good file system, this now I just choose ext3, after all very mature, and JFS, EXT4 or dare not directly use online.

Site layering
Site layering, for large sites this is necessary, load balancer (LVS, Nginx, F5,netscaler), front-end Web server (Tomcat, Apache, resin, lighttpd, nginx, etc.), middle tier (such as memcached, ICE), Databases (Oracle, PostgreSQL, MySQL, etc.). This still needs to be planned before the program is developed. and the partition of database is also very important, can distribute different database to different machine, at the same time do master-slave, realize read-write separation.

System monitoring
must be built before the system is officially launched, some companies will have their own set of monitoring systems, there are many custom monitoring content. But more is the use of open source monitoring products nagios, cacti, munin and so on. And Nagios I personally feel very good, especially in combination with Nrpe as a client, you can customize a lot of monitoring needs, you can write monitoring content, such as monitoring memory ah, monitoring memcached and so on. And Nagios provides a lot of monitoring scripts. Nagios is now not only able to send alarm messages, but also to send text messages, send MSN. And for the system history of the display, with cacti and munin is very good. Cacti is SNMP-based, easy to monitor, but once across the network, such as cross-telecommunications netcom, then you use cacti will occur often occurs when the data can not be taken. And for the server too many cases will occur 5 minutes a poll is too late, this needs to cacti itself to optimize, this direct reference zys.3322.org above the hint step by step optimization, mainly cacti the default that the database is actually all the tables are not indexed. And Munin is also based on the client, is to go TCP protocol, so that compared to the stability of SNMP more. And no database support is required.

Backup of the system
Backup of the system is also required to be done before going live. Backup has simple tar and compare enterprise-class open source products Bacula and so on. Bacula is also used internally before, for large backups are really good, backup methods are also incremental, all backup and so on various ways. It has a central server, a backup server, a client, a tape backup, and so on. Perhaps I do not use, because it is a backup completed is also a single file, this is not enough for me to visualize, although Bacula also support a good recovery, but not direct enough, in case the bad can not be restored. So I chose the direct tar to do the backup. First of all to choose which things need to be backed up, in my case is mainly the database and the user uploads the data, and the program files are distributed on more than one machine, just need a simple backup to it. The data uploaded by the user is now basically 5 minutes synchronized to the other file servers, and an incremental backup is performed. A full backup is performed at the same time every day.
For the database, first of all must have slave, but also must be backed up every 30 minutes, MyISAM data engine is relatively easy to back up, you can directly back up the data files, can also be mysqldump, there is also the default hotcopy MySQL provided. And InnoDB can be exported directly with Mysqldump SQL file and directly xcopy export data file. But personally think Xcopy performance is not particularly superior, the speed is not particularly fast, and later need to restore the backup time also must install the Xcopy to be able. Backup every 30 minutes and keep only one by one on the day of the morning, not all of them.

static Data Migration
This can be done through rsync, and once the migration is really started, it is best not to do the tar to migrate, so the first thing to do is to transfer the files too large and not necessarily to be fully synchronized.

Database Migration
There are 2 ways to do this, one of which is slave, so you can switch the slave into master, but if you're a temporary slave, it's likely to cause the database to be out of sync, After all, when you build the slave, Master is definitely in the update, and you even if slave specified from which position start, you will also have synchronization error situation.
So another way is to stop the mysqldump, this is the safest way, but when you have a large amount of data or the index of a particular number of cases will be compared to spend time, almost all in hours, but in fact, mysqldump can also be incremental backup, In fact, it is based on the position of MySQL bin log for incremental backup.

Complete website on-line process
First determine how many online people are required to support the new site, based on this to determine the bandwidth and number of servers, and then determine the number and model of the switch based on the number and bandwidth of the server.
Determine the server's configuration and associated branding.
Then according to these you have to draw the website architecture diagram, Network Diagram, network wiring diagram, server wiring diagram.
The architecture diagram is the overall logical architecture of the site and is a logical overview of the whole
The network diagram is the logical architecture for displaying network switches, such as the configuration of Vsrp,vlan is shown here.
Network wiring diagram The network switch shown here directly how to connect, how many lines, to indicate to which port.
Server wiring diagram, which shows which ports on the server are which ports on which network switch.
The next 2 figures are the most important for the operator, and if the painting is not clear, it is likely to delay a lot of time in communication.
After the on-line installation of the operating system, which is now basically the network to install, will not be installed through the CD-ROM drive to install, so not only to buy the machine when more than the unnecessary money, and the installation is relatively slow, while the CD-ROM sometimes has a useful life, sometimes long time there is no way to install. Redhat system can be selected kickstart for remote installation, kickstart in the installation process can also be installed when the implementation of their own system initialization script. For example, specify hostname, modify the relevant TCP/IP settings, set the Iptables, and so on. And for the network environment particularly complex server must be in the network configuration file to specify the gateway between the various VLANs, which I used to put in the rc.local, and although this can be automatically loaded when the system starts, and if you manually start the NIC will lose these network information.
After installing the operating system, the deployment of the respective program files is necessary.
The relevant program files are ready for online testing, not just for application testing, but also for stress testing to test how much load the new system can withstand. There may be a variety of bottlenecks, this is generally due to Web server problems, especially resin,tomcat these problems are relatively large, and the PHP Web site because fast-cgi is now often able to withstand greater concurrency. Another possible bottleneck would be the database. For example, MySQL needs to be based on the data engine you choose to adjust the size of the buffer, this is the overall performance of the database adjustment, individual adjustments need to be based on your slow log to adjust accordingly.

A complete website on-line process (GO)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.