Home PC Games Linux Windows Database Network Programming Server Mobile  
  Home \ Linux \ Axel install plug under CentOS 5/6 acceleration yum downloads     - Denyhosts prevent hackers using SSH scanning (Linux)

- I like Linux Security (Linux)

- Web database security tips (Linux)

- How to upgrade the kernel to 3.13.7 on Ubuntu / Linux Mint (Linux)

- Linux network security strategy (Linux)

- Appweb configuration in detail (Server)

- Cache implementation APP interacts with the server-side interface control Session (Server)

- quotacheck command file can not be created aquota.user and aquota.group solutions (Linux)

- Use Ansible installation NGINX and NGINX Plus (Server)

- C language print various graphic (Programming)

- How to compare PDF files on Ubuntu (Linux)

- Service Discovery: Zookeeper vs etcd vs Consul (Server)

- Linux C programming and Shell Programming in the development of practical tools similarities summary (Programming)

- Vi editor Introduction (Linux)

- Ubuntu Tutorial: E: Failed to get lock / var / lib / apt / lists / lock - open (Linux)

- Oracle View Object Information (Database)

- Oracle 12c In-Memory Study (Database)

- Talk Packages (Linux)

- Vim useful plugin: YouCompleteMe (Linux)

- DIY security of Linux platform (Linux)

  Axel install plug under CentOS 5/6 acceleration yum downloads
  Add Date : 2016-05-12      
  Axel plug-in is based on a multi-threaded download the plug under the yum, by opening multiple HTTP / FTP connection to download a file segment, so as to achieve the purpose of accelerating download. For downloading large files, this tool is especially useful. Available for CentOS, RHEL, Fedora and other Linux distributions use yum. I could not find the rpm package, only compiler installation. Use Axel can increase download speeds several times in slow network environment.

1 Download axel widget rpm package

Download http://pkgs.repoforge.org/axel/

If you then use http://pkgs.repoforge.org/axel/axel-2.4-1.el5.rf.x86_64.rpm to centos 5 64-bit systems

If http://pkgs.repoforge.org/axel/axel-2.4-1.el6.rf.x86_64.rpm is centos 6 64-bit systems

2 Install the rpm package rpm -ivh http://pkgs.repoforge.org/axel/axel-2.4-1.el6.rf.x86_64.rpm

You can directly run the installation command

yum install axel

3 and download the configuration file axelget.conf axelget.py to yum in:
cd /etc/yum/pluginconf.d/
wget http://cnfreesoft.googlecode.com/svn/trunk/axelget/axelget.conf

You can also edit their own, reads as follows:

enabled = 1
onlyhttp = 1
enablesize = 54000
cleanOnException = 1

cd / usr / lib / yum-plugins /
wget http://cnfreesoft.googlecode.com/svn/trunk/axelget/axelget.py

You can also edit their own, reads as follows:

from yum.plugins import PluginYumExit, TYPE_CORE, TYPE_INTERACTIVE
from urlparse import urljoin
import os, time

requires_api_version = '2.3'

enablesize = 300000
trymirrornum = -1
maxconn = 10
httpdownloadonly = False
cleanOnException = 0

def init_hook (conduit):
 global enablesize, trymirrornum, maxconn, cleanOnException, httpdownloadonly
 enablesize = conduit.confInt ( 'main', 'enablesize', default = 30000)
 trymirrornum = conduit.confInt ( 'main', 'trymirrornum', default = -1)
 maxconn = conduit.confInt ( 'main', 'maxconn', default = 10)
 httpdownloadonly = conduit.confBool ( 'main', 'onlyhttp', default = False)
 cleanOnException = conduit.confInt ( 'main', 'cleanOnException', default = 0)

def predownload_hook (conduit):
 global enablesize, cleanOnException, httpdownloadonly
 preffermirror = ""
 PkgIdx = 0
 TotalPkg = len (conduit.getDownloadPackages ())
 for po in (conduit.getDownloadPackages ()):
  PkgIdx + = 1
  if hasattr (po, 'pkgtype') and po.pkgtype == 'local':
  totsize = long (po.size)
  ret = False
  if totsize <= enablesize:
   conduit.info (2, "Package% s download size% d less than% d, Skip plugin!"% (po.repo.id, totsize, enablesize))
   conduit.info (2, "[% d /% d] Ok, we will try to use axel to download this big file:% d"% (PkgIdx, TotalPkg, totsize))
  local = po.localPkg ()
  if os.path.exists (local):
   if not os.path.exists (local + "st."):
    fstate = os.stat (local)
    if totsize == fstate.st_size:
     conduit.info (2, "Target already exists, skip to next file!")
  localall = "% s% s"% (local, local + ". st")
  rmcmd = "rm -f% s"% (localall)
  curmirroridx = 0
  conduit.info (2, "Before we start, clean all the key files")
  os.system (rmcmd)
  connnum = totsize / enablesize
  if connnum * enablesize    connnum + = 1
  if connnum> maxconn:
   connnum = maxconn
  mirrors = []
  mirrors [: 0] = po.repo.urls
  ! If preffermirror = "":
   mirrors [: 0] = [preffermirror]
  for url in mirrors:
   if url.startswith ( "ftp: //") and httpdownloadonly:
    print "Skip Ftp Site:", url
   if url.startswith ( "file: //"):
    print "Skip Local Site:", url
   curmirroridx + = 1
   if (curmirroridx> trymirrornum) and (trymirrornum = -1!):
    conduit.info (2, "Package% s has tried% d mirrors, Skip plugin!"% (po.repo.id, trymirrornum))
   remoteurl = "% s /% s"% (url, po.remote_path)
   syscmd = "axel -a -n% s% s -o% s"% (connnum, remoteurl, local)
   conduit.info (2, "Execute axel cmd: \ n% s"% syscmd)
   os.system (syscmd)
   time.sleep (2)
   if os.path.exists (local + "st."):
    conduit.info (2, "axel exit by exception, let's try another mirror")
    if cleanOnException:
     conduit.info (2, "because cleanOnException is set to 1, we do remove key file first")
     os.system (rmcmd)
   elif not os.path.exists (local): # this mirror may not update yet
    ret = True
    preffermirror = url
  if not ret:
   conduit.info (2, "try to run rm cmd:% s"% rmcmd)
   os.system (rmcmd)

Final confirmation /etc/yum.conf in plugins = 1

4 Test and install yum-fastestmirror widget
yum install -y yum-fastestmirror
NOTE: axel widget can also function as an independent download tool. Download as a standalone tool when applied to most Linux distributions.
Use the following parameters:
General Use: axel url (Download file address);
Limit use: add -s parameter, such as -s 10240, that is the number of bytes per second download, here are 10 Kb;
Limit the number of connections: add -n parameters, such as -n 5, it opens 5 connections.

yum install axel
yum install yum-presto
yum install yum-fastestmirror
yum install yum-metadata-parser
yum install yum-downloadonly
yum install yum-priorities
- No password on Oracle and MySQL login (Database)
- The top command under Linux (Linux)
- See Shell Script Linux Server network traffic (Server)
- iOS persistence of data archiving NSKeyedArchiver (Programming)
- namespace mechanism Linux kernel analysis (Linux)
- Java synchronization mechanism: synchronized, wait, notify (Programming)
- Ubuntu upgrade to Linux Kernel 4.2.3 Kernel (Linux)
- Linux Basics Tutorial: Linux Kickstart automated installation (Linux)
- Android Studio quick overview of Gradle (Programming)
- Remote installation of Net-SNMP whole process (Linux)
- Linux Network Analysis Tcpdump Command Guide (Linux)
- BusyBox build root file system (Linux)
- Linux Learning --- disk partition / relational representation + mount (Linux)
- Ubuntu FAQ solutions (Linux)
- Spring AOP (Programming)
- When Linux virtual machine to another copy of the operating system, a static IP NAT mode Invalid (Linux)
- JDK comes with tools jinfo (Linux)
- Unity Greeter Badges: the lost session icon back to the login screen Ubuntu (Linux)
- Linux 6 install Oracle 11g (64bit) (Database)
- Linux basic introductory tutorial ---- simple text processing (Linux)
  CopyRight 2002-2020 newfreesoft.com, All Rights Reserved.