Four levels of O & M from the perspective of software deployment

Source: Internet
Author: User
Tags redis cluster install redis

Four levels of O & M from the perspective of software deployment

Four levels of O & M from the perspective of software deployment

First of all, it is difficult to get the name of a blog post. It doesn't feel right about anything. It is tentative here. It is undeniable that this is a bit of a motive for winning favor, not to mention that the overall situation is not big enough.

The Chinese philosopher Mr. Feng Youlan said that life has four realms: natural realm, utilitarian realm, moral realm, and heaven realm. After a long period of deployment and installation of software services, I feel that I have gained a lot of familiarity recently. through practice, I can come up with some methods and summarize them to form a set of methodologies. However, as a Chinese, I still use the pattern, realm and other words are more friendly.

I will not talk nonsense much. I will do the following. (The dry goods I understand may not be. Please ignore them)


The following describes the problem through installing the redis software. I have attached four installation methods to discover four different realms.


1. Traditional manual installation (famous three-board Ax)

Config

Make

Make install


Wget http://download.redis.io/releases/redis-2.8.17.tar.gz

Tar-zxvf redis-2.8.17.tar.gz

Cd redis-2.8.17.tar.gz

Install tcl first; otherwise, an error will be reported below

Yum install tcl-y

Make MALLOC = libc

Make test

Make install

/Root/redis-2.8.17/utils/install_server.sh

Welcome to the redis service installer

This script will help you easily set up a running redis server


Please select the redis port for this instance: [6379]

Selecting default: 6379

Please select the redis config file name [/etc/redis/6379. conf]

Selected default-/etc/redis/6379. conf

Please select the redis log file name [/var/log/redis_62.16.log]/data/redis/redis_62.16.log

Please select the data directory for this instance [/var/lib/apsaradb for redis/6379]/data/redis/6379

Please select the redis executable path [/usr/local/bin/redis-server]

Selected config:

Port: 6379

Config file:/etc/redis/6379. conf

Log file:/data/redis/redis_62.16.log

Data dir:/data/apsaradb for redis/6379

Executable:/usr/local/bin/redis-server

Cli Executable:/usr/local/bin/redis-cli

Is this OK? Then press ENTER to go on or Ctrl-C to abort.

Copied/tmp/6379. conf =>/etc/init. d/redis_6379

Installing service...

Successfully added to chkconfig!

Successfully addedto runlevels 345!

Starting Redis server...

Installation successful!


This traditional installation method is mainly time-consuming. For example, it takes more than half an hour to install redis, a 1 m small software. This method is similar to the natural realm of Feng Youlan. One advantage of this method is that it allows you to quickly get familiar with a strange software, and you have to go through this process for the first installation.


Ii. Script Installation

With the passage of time, the number of servers is increasing. Is it annoying for me to repeat such work every day and cannot be improved without technical skills? Most O & M personnel are not satisfied with the status quo, especially when the boss says that he is looking for a fast deployment method to reward 2 K, is it motivated? At this time, both the right place and the right place come, so I started to figure out a solution. Most people first thought of scripts.

I am not familiar with bash, But I can copy and modify scripts, let alone 3 P (don't think wrong, many people say they want to learn (python, perl, php ), if you are a natural technical expert, either of them will be the best.


It doesn't matter if you are not interested in the 3 P or cannot afford it. You just need to learn shell. At least this stage is enough.

Only the redis service is installed to get a script, but it does not show the advantages of the script at this time. If it is an LNMP environment, the advantages of the script will be highlighted. Press Enter on the keyboard, you can have a cup of coffee, but at this time you usually have other things. In two hours, the basic environment will be complete.


If redis really writes a simple script, add a # Before the above command line #! /Bin/bash.

#! /Bin/bash

Wget http://download.redis.io/releases/redis-2.8.17.tar.gz

Tar-zxf redis-2.8.17.tar.gz

Cd redis-2.8.17.tar.gz

Yum install tcl-y | tail-n 6

Make MALLOC = libc | tail-n 6

Make test | tail-n 6

Make install | tail-n 6

/Root/redis-2.8.17/utils/install_server.sh


Tip: I have never tried this script and it may not be used. At this time, I am not very satisfied with this installation method.


3. Green Installation

In the past, I heard about green installation in most windows environments, but I rarely heard about it in linux. Is it true that linux does not like easy-to-use methods? Is this a bit immoral? I think the so-called moral realm should be like this: the simpler the complicated things, the better. I don't think that simplicity is not technical, and simplicity is the highest realm I have ever pursued.

Speaking of this, there are some roots that support green installation. In fact, I think I have forgotten a very deep sentence for a while: Everything is a file! I remember hearing this sentence when I first started to learn linux, but I never think of it. So many detours have taken place. In other words, without so many detours, the understanding of this sentence will not be so deep.

Back to the topic, green installation is to pack the first software package installed in an environment and copy it. For example, redis only needs to copy the binary program and configuration file. The only thing that the binary program depends on is some development libraries.


Software. This must be installed in advance.

Yum install tcl-y

Mkdir/etc/redis

Ls/etc/redis

6379. conf

Ls/etc/init. d

Redis_6379

Tar zxvf redis_data.tar.gz-C/

Tar zxvf redis.2.7.17.tar.gz-C/

Here, redis is installed in several directories for the first time. If the installation directory is specified during the first installation, you only need to copy the entire directory. Is it easy?


4. clone a template

The fourth kind of realm is called the realm of heaven and earth. It is a bit embarrassing to use it here, but it cannot be managed so much. I have already worked hard for the integrity of blog posts. What I understand in the realm of heaven and earth is the unity of Heaven and Man. Is it impossible for us to combine humans and machines? I can't think about the profound questions. I just said that I am very simple. Thanks to the development of virtualization technology, do not mention cloud computing. I am very allergic to it. I have not seen any cloud computing people in front of me.

In fact, this method is similar to the third method, but the system is deployed together. Isn't the operating system the biggest software? By the way, who did not say mac and windows are the biggest malicious programs!

This method is also relatively simple, but the pattern is mostly used. For example, for various so-called cloud-based SAAS, I remember that qingcloud's redis cloud cache server should be a level higher than what I said. At this moment, I suddenly want to split this realm into two, because I suddenly want to add another situation.


First, I guess you have already thought of it:

1. Deploy the redis service on a virtual machine or physical machine. The third method is available.

2. Convert the PtoV or VtoV method to a template.

3. You can directly deploy a virtual machine from the template when you use it next time. This is supported by any virtualization technology.


The second type is the distributed cluster environment. This is not applicable to every software, but the redis General

1. Deploy the redis cluster (supported by redis3.0, but I have not tried the redis cluster, I have tried the codis cluster)

2. Expand codis-group directly on the cluster (for example, codis cluster) and add the codis-server instance.

3. This distributed Cluster Environment supports horizontal scaling and online scaling to meet various demanding requirements.


Now, the change is over. I still want to say something that can't be said. It's really hard to understand the realm of Heaven and Earth.


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.