1. Ubuntu ์ธ์Šคํ„ด์Šค์— CentOS ๋„์ปค ์ปจํ…Œ์ด๋„ˆ ์„ค์น˜

์„ค์น˜ ํ™˜๊ฒฝ

  • NHN Cloud
  • Ubuntu 20.04 LTS
  • Docker 23.0.1
  • CentOS 7.9

 

Workflow

  1. ์„ค์น˜ํ•˜๋ ค๋Š” ํŒจํ‚ค์ง€๊ฐ€ ์ด๋ฏธ ์„ค์น˜๋˜์–ด ์žˆ๋Š”์ง€ ์ฒดํฌ ํ›„ ๋‹ค์šด๋กœ๋“œ
  2. Docker ๊ณต์‹ GPG ํ‚ค ์ถ”๊ฐ€
  3. Docker ๋ ˆํฌ์ง€ํ† ๋ฆฌ ๋“ฑ๋ก
  4. apt-get ์—…๋ฐ์ดํŠธ
  5. Docker ์„ค์น˜
  6. ๊ทธ๋ฃน์— ์‚ฌ์šฉ์ž ์ถ”๊ฐ€
  7. CentOS 7 ์ปจํ…Œ์ด๋„ˆ ์‹คํ–‰

 

์„ค์น˜ ์Šคํฌ๋ฆฝํŠธ

#!/usr/bin/env bash

# curl ์ด๋ฏธ ์„ค์น˜๋˜์–ด ์žˆ๋Š”์ง€ ์ฒดํฌ
if ! command -v curl &> /dev/null
then
    sudo apt-get update
    sudo apt-get install -y curl
fi

# apt-transport-https ์ด๋ฏธ ์„ค์น˜๋˜์–ด ์žˆ๋Š”์ง€ ์ฒดํฌ
if ! dpkg -s apt-transport-https &> /dev/null
then
    sudo apt-get update
    sudo apt-get install -y apt-transport-https
fi

# ca-certificates ์ด๋ฏธ ์„ค์น˜๋˜์–ด ์žˆ๋Š”์ง€ ์ฒดํฌ
if ! dpkg -s ca-certificates &> /dev/null
then
    sudo apt-get update
    sudo apt-get install -y ca-certificates
fi

# gnupg-agent ์ด๋ฏธ ์„ค์น˜๋˜์–ด ์žˆ๋Š”์ง€ ์ฒดํฌ
if ! dpkg -s gnupg-agent &> /dev/null
then
    sudo apt-get update
    sudo apt-get install -y gnupg-agent
fi

# software-properties-common ์ด๋ฏธ ์„ค์น˜๋˜์–ด ์žˆ๋Š”์ง€ ์ฒดํฌ
if ! dpkg -s software-properties-common &> /dev/null
then
    sudo apt-get update
    sudo apt-get install -y software-properties-common
fi

# Docker ๊ณต์‹ GPG key ์ด๋ฏธ ์ถ”๊ฐ€๋˜์–ด ์žˆ๋Š”์ง€ ์ฒดํฌ
if ! curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key list | grep Docker &> /dev/null
then
    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
fi

# Docker repository ๋“ฑ๋ก
if ! apt-cache policy | grep https://download.docker.com/linux/ubuntu | grep stable &> /dev/null
then
  echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
fi

# ๊ธฐ๋ณธ์ ์ธ ํŒจํ‚ค์ง€๋“ค์ด ์ตœ์‹  ๋ฒ„์ „์ธ์ง€ ํ™•์ธ
sudo apt-get update

# docker-ce ์ด๋ฏธ ์„ค์น˜๋˜์–ด ์žˆ๋Š”์ง€ ์ฒดํฌ
if ! dpkg -s docker-ce &> /dev/null
then
    # Docker ์„ค์น˜
    sudo apt-get install -y docker-ce docker-ce-cli containerd.io
fi

# docker ๊ทธ๋ฃน์— ์‚ฌ์šฉ์ž ์ถ”๊ฐ€
sudo usermod -aG docker $USER

# Centos7 ์ปจํ…Œ์ด๋„ˆ ์‹คํ–‰
sudo docker run --privileged -d -p 5432:5432 --name centos centos:7 /sbin/init
  • systemctl ๋ช…๋ น์„ ์‚ฌ์šฉํ•˜๊ธฐ ์œ„ํ•ด์„œ privileged๋กœ ์ปจํ…Œ์ด๋„ˆ ์‹คํ–‰
  • ์ปจํ…Œ์ด๋„ˆ์— postgresql์„ ์„ค์น˜ํ•  ์˜ˆ์ •์ด์–ด์„œ ํฌํŠธ 5432๋กœ ์‹คํ–‰

1. ๋กœ์ปฌ PC์—์„œ Vagrant๋กœ CentOS ๊ฐ€์ƒํ™˜๊ฒฝ ๋„์šฐ๊ธฐ

์„ค์น˜ ํ™˜๊ฒฝ

  • Macbook Pro Intel (2019)
  • CentOS 7.9

 

์„ค์น˜ ์Šคํฌ๋ฆฝํŠธ

#!/usr/bin/env bash

directory="$HOME/workspace/VM/centos7"
ssh_key_file="$HOME/.ssh/id_rsa"

# Check if Homebrew is installed
if ! [ -x "$(command -v brew)" ]; then
  echo '>> Homebrew is not installed.' >&2
  /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi

# Check if VirtualBox is installed
if ! [ -x "$(command -v vboxmanage)" ]; then
  echo '>> VirtualBox is not installed.' >&2
  brew install --cask virtualbox
fi

# Check if VirtualBox Extension Pack is installed
if ! vboxmanage list extpacks | grep "Oracle VM VirtualBox Extension Pack"; then
  echo '>> VirtualBox Extension Pack is not installed.'
  rm Oracle_VM_VirtualBox_Extension_Pack-$(VBoxManage -v | cut -d r -f 1).vbox-extpack
fi

# Check if Vagrant is installed
if ! [ -x "$(command -v vagrant)" ]; then
  echo '>> Vagrant is not installed.' >&2
  brew install vagrant
fi

# Check if Ansible is installed
if ! [ -x "$(command -v ansible)" ]; then
  echo '>> Ansible is not installed.' >&2
  brew install ansible
fi

# Create directory for CentOS VM
if [ ! -d "$directory" ]
then
    mkdir -p "$directory"
fi

cd "$directory"

# Check if the required Vagrant plugins are installed
if ! vagrant plugin list | grep -q vagrant-vbguest
then
    echo ">> vagrant-vbguest plugin is not installed."
    vagrant plugin install vagrant-vbguest
fi

if ! vagrant plugin list | grep -q vagrant-disksize
then
    echo ">> vagrant-disksize plugin is not installed."
    vagrant plugin install vagrant-disksize
fi

# Initialize Vagrantfile
vagrant init

# Edit Vagrantfile
cat << EOF > Vagrantfile
ENV["LC_ALL"] = "en_US.UTF-8"
Vagrant.configure("2") do |centos|

  # All servers will run cent 7
  centos.vm.box = "centos/7"
  centos.vm.box_check_update = false
  centos.disksize.size = "60GB"

  # Create the cent1 Server
  N = 1
  (1..N).each do |i|
    hostname = "cent7-#{i}"
    centos.vm.define hostname do |host1|
      host1.vm.hostname = hostname
      host1.vm.network "private_network", ip: "192.168.56.#{10 + i}"
      host1.vbguest.auto_update = false
      host1.vm.provider "virtualbox" do |v|
        v.name = hostname
        v.memory = "2048"
        v.cpus = "2"
        v.linked_clone = "true"
        v.gui = "false"
        v.customize ['modifyvm', :id, '--graphicscontroller', 'vmsvga']
        v.customize ['modifyvm', :id, '--vram', '20']
      end
    end
  end

  # Provision with Ansible playbook
  centos.vm.provision "ansible" do |ansible|
    ansible.playbook = "init.yml"
  end
end
EOF

# Edit Ansible playbook
cat << EOF > init.yml
- name: init.yml
  hosts: all
  gather_facts: no
  become: yes
  tasks:
    - name: Create users
      user:
        name: "{{ item }}"
        shell: /bin/bash
        home: "/home/{{ item }}"
        generate_ssh_key: true
        password_lock: yes
      with_items:
        - irteam
        - irteamsu
        - centos
    - name: Add sudoers.d file
      copy:
        content: |
          %{{item}} ALL=(ALL) NOPASSWD: ALL
        dest: "/etc/sudoers.d/{{item}}"
        owner: root
        group: root
        mode: 0440
        validate: "/usr/sbin/visudo -c -f '%s'"
      with_items:
        - irteam
        - irteamsu
        - centos
    - name: Add SSH key
      authorized_key:
        user: "{{ item }}"
        state: present
        key: "{{ lookup('file', '~/.ssh/id_rsa.pub') }}"
      with_items:
        - irteam
        - irteamsu
        - centos
        - vagrant
        - root
    - name: Restart SSH service
      ansible.builtin.systemd:
        state: restarted
        name: sshd.service
EOF

# Start Vagrant VM
vagrant up

# Generate SSH key
if [[ ! -f "$ssh_key_file" ]]; then
    echo ">> Generating new SSH key..."
    ssh-keygen
fi

cat ~/.ssh/id_rsa.pub

cd "$directory"

# SSH into Vagrant VM
vagrant SSH

vagrant ssh -c "cat ~/.ssh/authorized_keys"

vagrant ssh -c 'exit'

# Print public SSH key
cat "$ssh_key_file"

# Provision Vagrant VM
vagrant provision

# Connect
ssh-keyscan -H 192.168.56.11 >> ~/.ssh/known_hosts
ssh -o StrictHostKeyChecking=no centos@192.168.56.11

 

๊ฒฐ๊ณผ

์„ฑ๊ณต!

 

 

2. Ubuntu ์ธ์Šคํ„ด์Šค์—์„œ Vagrant๋กœ CentOS ๊ฐ€์ƒํ™˜๊ฒฝ ๋„์šฐ๊ธฐ

์„ค์น˜ ํ™˜๊ฒฝ

  • NHN Cloud
  • Ubuntu 20.04 LTS
  • CentOS 7.9

 

์„ค์น˜ ์Šคํฌ๋ฆฝํŠธ

#!/usr/bin/env bash

directory="$HOME/workspace/VM/centos7"
ssh_key_file="$HOME/.ssh/id_rsa"

# Check if wget is installed
if ! command -v wget &> /dev/null
then
    echo ">> wget is not installed."
    sudo apt-get update
    sudo apt-get install -y wget
fi

# Download and add VirtualBox public key

# Add VB repo to package manager

# Update package list
sudo apt-get update

# Install VirtualBox
sudo apt-get install -y virtualbox-6.1

# Clean up
#sudo apt-get autoremove
#sudo apt-get autoclean


# Check if VirtualBox Extension Pack is installed
if ! vboxmanage list extpacks | grep -q "Oracle VM VirtualBox Extension Pack"; then
  echo '>> VirtualBox Extension Pack is not installed.'
  wget https://download.virtualbox.org/virtualbox/6.1.42/Oracle_VM_VirtualBox_Extension_Pack-6.1.42.vbox-extpack
  rm "Oracle_VM_VirtualBox_Extension_Pack-6.1.42.vbox-extpack"
fi

# Check if Vagrant is installed
if ! [ -x "$(command -v vagrant)" ]; then
  echo '>> Vagrant is not installed.' >&2
  wget -O- https://apt.releases.hashicorp.com/gpg | gpg --dearmor | sudo tee /usr/share/keyrings/hashicorp-archive-keyring.gpg
  sudo apt update && sudo apt install -y vagrant
fi

# Check if Ansible is installed
if ! [ -x "$(command -v ansible)" ]; then
  echo '>> Ansible is not installed.' >&2
  sudo apt install -y ansible
fi

# Create directory for CentOS VM
if [ ! -d "$directory" ]
then
    mkdir -p "$directory"
fi

cd "$directory"

# Check if the required Vagrant plugins are installed
if ! vagrant plugin list | grep -q vagrant-vbguest
then
    echo ">> vagrant-vbguest plugin is not installed."
    vagrant plugin install vagrant-vbguest
fi

if ! vagrant plugin list | grep -q vagrant-disksize
then
    echo ">> vagrant-disksize plugin is not installed."
    vagrant plugin install vagrant-disksize
fi

# Initialize Vagrantfile
vagrant init

# Edit Vagrantfile
cat << EOF > Vagrantfile
ENV["LC_ALL"] = "en_US.UTF-8"
Vagrant.configure("2") do |centos|

  # All servers will run cent 7
  centos.vm.box = "centos/7"
  centos.vm.box_check_update = false
  centos.disksize.size = "60GB"

  # Create the cent1 Server
  N = 1
  (1..N).each do |i|
    hostname = "cent7-#{i}"
    centos.vm.define hostname do |host1|
      host1.vm.hostname = hostname
      host1.vm.network "private_network", ip: "192.168.56.#{10 + i}"
      host1.vbguest.auto_update = false
      host1.vm.provider "virtualbox" do |v|
        v.name = hostname
        v.memory = "2048"
        v.cpus = "2"
        v.linked_clone = "true"
        v.gui = "false"
        v.customize ['modifyvm', :id, '--graphicscontroller', 'vmsvga']
        v.customize ['modifyvm', :id, '--vram', '20']
      end
    end
  end

  # Provision with Ansible playbook
  centos.vm.provision "ansible" do |ansible|
    ansible.playbook = "init.yml"
  end
end
EOF

# Edit Ansible playbook
cat << EOF > init.yml
- name: init.yml
  hosts: all
  gather_facts: no
  become: yes
  tasks:
    - name: Create users
      user:
        name: "{{ item }}"
        shell: /bin/bash
        home: "/home/{{ item }}"
        generate_ssh_key: true
        password_lock: yes
      with_items:
        - irteam
        - irteamsu
        - centos
    - name: Add sudoers.d file
      copy:
        content: |
          %{{item}} ALL=(ALL) NOPASSWD: ALL
        dest: "/etc/sudoers.d/{{item}}"
        owner: root
        group: root
        mode: 0440
        validate: "/usr/sbin/visudo -c -f '%s'"
      with_items:
        - irteam
        - irteamsu
        - centos
    - name: Add SSH key
      authorized_key:
        user: "{{ item }}"
        state: present
        key: "{{ lookup('file', '~/.ssh/id_rsa.pub') }}"
      with_items:
        - irteam
        - irteamsu
        - centos
        - vagrant
        - root
    - name: Restart SSH service
      ansible.builtin.systemd:
        state: restarted
        name: sshd.service
EOF

# Start Vagrant VM
vagrant up

# Generate SSH key
if [[ ! -f "$ssh_key_file" ]]; then
    echo ">> Generating new SSH key..."
    ssh-keygen
fi

cat ~/.ssh/id_rsa.pub

cd "$directory"

# SSH into Vagrant VM
vagrant SSH

vagrant ssh -c "cat ~/.ssh/authorized_keys"

vagrant ssh -c 'exit'

# Print public SSH key
cat "$ssh_key_file"

# Provision Vagrant VM
vagrant provision

# Connect
#ssh centos@192.168.56.11
ssh-keyscan -H 192.168.56.11 >> ~/.ssh/known_hosts
ssh -o StrictHostKeyChecking=no centos@192.168.56.11

 

๊ฒฐ๊ณผ

์‹คํŒจ..

 

์—๋Ÿฌ ์ƒํ™ฉ

  • NHN ํด๋ผ์šฐ๋“œ ubuntu ์ธ์Šคํ„ด์Šค์—์„œ vagrant๋กœ centos ๊ฐ€์ƒํ™˜๊ฒฝ์„ ๋„์šฐ๋ ค๊ณ  ํ•จ
  • vagrant up ๋‹จ๊ณ„์—์„œ ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ•ด ๋‹ค์Œ ๋‹จ๊ณ„๋กœ ๋„˜์–ด๊ฐ€์ง€ ๋ชป ํ•จ

There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.

Command: ["startvm", "d7c9b9b1-a0d1-4ff2-b119-3a33f10a1540", "--type", "gui"]

Stderr: VBoxManage: error: The virtual machine 'cent7-1' has terminated unexpectedly during startup because of signal 6
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component MachineWrap, interface IMachine

 

์‹œ๋„ํ•ด๋ณธ ๋ฐฉ๋ฒ•

  • ํ˜ธ์ŠคํŠธ ์žฌ๋ถ€ํŒ… - ์‹คํŒจ
  • virtualbox์™€ virtualbox extension pack ๋ฒ„์ „ ๋งž์ถ”๊ธฐ - ์‹คํŒจ
  • VM headless ๋ชจ๋“œ๋กœ ์‹œ์ž‘ - ์‹œ๋„ ์ „

 

๊ฒฐ๋ก 

์„ค์น˜๋ฅผ ์ง„ํ–‰ํ•˜๊ณ  ์žˆ๋Š” ubuntu ์ž์ฒด๊ฐ€ ์ธ์Šคํ„ด์Šค ํ™˜๊ฒฝ์ด์–ด์„œ ๊ทธ ์œ„์— ๋˜ ๊ฐ€์ƒํ™˜๊ฒฝ(VM)์„ ๋„์šฐ๋Š”๊ฒŒ ๋ถˆ๊ฐ€๋Šฅํ•œ ๊ฒƒ์œผ๋กœ ํŒ๋‹จ..

vagrant ๋Œ€์‹  ํ˜ธ์ŠคํŠธ OS ์œ„์— ํ•˜์ดํผ๋ฐ”์ด์ €๋ฅผ ๋„์šฐ์ง€ ์•Š๋Š” ๊ตฌ์กฐ์ธ docker๋กœ ์ง„ํ–‰ํ•˜๊ธฐ๋กœ ๊ฒฐ์ •!

1. CentOS์— PostgreSQL ์„ค์น˜

์„ค์น˜ ํ™˜๊ฒฝ

  • NHN Cloud ์ธ์Šคํ„ด์Šค ๋˜๋Š” Docker ์ปจํ…Œ์ด๋„ˆ
  • CentOS 7.9

 

Workflow

  1. ์Šคํฌ๋ฆฝํŠธ ์‹คํ–‰์‹œ ์„ค์น˜ํ•˜๊ณ ์ž ํ•˜๋Š” ๋ฒ„์ „์ด ์ž…๋ ฅ๋˜์—ˆ๋Š”์ง€ ํ™•์ธ
  2. ์„ค์น˜ํ•˜๊ณ ์ž ํ•˜๋Š” PC์˜ OS, ์•„ํ‚คํ…์ฒ˜๊ฐ€ ์ ํ•ฉํ•œ์ง€ ํ™•์ธ
  3. CentOS 7์ธ์ง€ ํ™•์ธ
  4. PostgreSQL์ด ์ด๋ฏธ ์„ค์น˜๋œ ๊ฒฝ์šฐ ์ œ๊ฑฐ
  5. ํ•„์š”ํ•œ ํŒจํ‚ค์ง€ ์„ค์น˜ ๋ฐ yum ๋ ˆํฌ์ง€ํ† ๋ฆฌ ์—…๋ฐ์ดํŠธ
  6. PostgreSQL ์„ค์น˜
  7. ์ดˆ๊ธฐํ™” ๋ฐ ์œ ์ € ๋น„๋ฐ€๋ฒˆํ˜ธ ์„ค์ •
  8. ์™ธ๋ถ€ ์ ‘์†์„ ์œ„ํ•œ pg_hba.conf์™€ postgresql.conf ์ˆ˜์ • ๋ฐ ์žฌ์‹œ์ž‘
  9. PostgreSQL ์‹คํ–‰

 

์„ค์น˜ ์Šคํฌ๋ฆฝํŠธ

#!/usr/bin/env bash

# ์„ค์น˜ํ•˜๊ณ ์ž ํ•˜๋Š” ๋ฒ„์ „
version=$1
major_version=${version%%.*}  # 15.2 -> 15

# ์„ค์น˜ํ•˜๋ ค๋Š” ๋ฒ„์ „ ๋ฒˆํ˜ธ๋ฅผ ๋ฐ›์•˜๋Š”์ง€ ํ™•์ธ
if [ $# -eq 0 ]; then
    echo -e "\033[31;1m>> Error: Version number is missing. Usage: ./install_postgres_yum.sh <version>\033[0m"
    exit 1
fi

# OS๊ฐ€ Linux x86_64์ธ์ง€ ํ™•์ธ
if [ "$(uname -s)" != "Linux" ]; then
    echo -e "\033[31;1m>> Error: Your OS is not supported.\033[0m"
    exit 1
fi
if [ "$(uname -m)" != "x86_64" ]; then
    echo -e "\033[31;1m>> Error: Your architecture is not supported.\033[0m"
    exit 1
fi

# CentOS๊ฐ€ Enterprise Linux 7 (EL7)์ธ์ง€ ํ™•์ธ
if [ "$(rpm -q --queryformat '%{VERSION}' centos-release)" != "7" ]; then
    echo -e "\033[31;1m>> Error: This script is only compatible with Enterprise Linux 7 (EL7)\033[0m"
    exit 1
fi

# PostgreSQL์ด ์ด๋ฏธ ์„ค์น˜๋˜์–ด ์žˆ๋‹ค๋ฉด ์ œ๊ฑฐ
if yum list installed | grep postgresql; then
    echo -e "\033[31;1m>> Remove PostgreSQL already installed...\033[0m"
    sudo yum -y remove postgresql*
fi

# ํ•„์š”ํ•œ ํŒจํ‚ค์ง€ ์„ค์น˜
echo -e "\033[31;1m>> Install required packages...\033[0m"
yum install -y sudo
sudo yum -y update
sudo yum install -y epel-release
sudo yum install -y zstd

# PostgreSQL ์„ค์น˜
echo -e "\033[31;1m>> Install PostgreSQL...\033[0m"
sudo yum install -y https://download.postgresql.org/pub/repos/yum/${major_version}/redhat/rhel-7-x86_64/postgresql${major_version}-libs-${version}-1PGDG.rhel7.x86_64.rpm
sudo yum install -y https://download.postgresql.org/pub/repos/yum/${major_version}/redhat/rhel-7-x86_64/postgresql${major_version}-${version}-1PGDG.rhel7.x86_64.rpm
sudo yum install -y https://download.postgresql.org/pub/repos/yum/${major_version}/redhat/rhel-7-x86_64/postgresql${major_version}-server-${version}-1PGDG.rhel7.x86_64.rpm

# ์ดˆ๊ธฐํ™”
echo -e "\033[31;1m>> Initialize PostgreSQL...\033[0m"
sudo /usr/pgsql-${major_version}/bin/postgresql-${major_version}-setup initdb

# ์‹œ์ž‘
echo -e "\033[31;1m>> Start PostgreSQL...\033[0m"
sudo systemctl start postgresql-${major_version}
sudo systemctl enable postgresql-${major_version}

# ์œ ์ € ์ƒ์„ฑ
username="postgres"
password="nhnpostgres123"

sudo adduser $username
echo "$username:$password" | sudo chpasswd

# postgres user๋กœ ๋ณ€๊ฒฝ ํ›„ ์„ค์ •ํŒŒ์ผ ์ˆ˜์ •
echo -e "\033[31;1m>> Edit pg_hba.conf and postgresql.conf\033[0m"
sudo su - postgres <<EOF
    echo "host    all             all             133.186.251.35/22       md5" >> /var/lib/pgsql/${major_version}/data/pg_hba.conf

    sed -i "s/#listen_addresses = 'localhost'/listen_addresses = '*'/g" /var/lib/pgsql/${major_version}/data/postgresql.conf

    exit
EOF

# ์žฌ์‹œ์ž‘
echo -e "\033[31;1m>> Restart PostgreSQL...\033[0m"
sudo systemctl restart postgresql-${major_version}

# ์‹คํ–‰
echo -e "\033[31;1m>> Run PostgreSQL...\033[0m"
sudo su - postgres -c "psql"

 

๊ณผ์ œ ๋‚ด์šฉ

  • ์Šคํฌ๋ฆฝํŠธ๋ฅผ ์‹คํ–‰ํ•˜๋ฉด ๋น„๋ฐ€๋ฒˆํ˜ธ ์—†์ด ์ ‘์†ํ•  ์ˆ˜ ์žˆ๋„๋ก ์ž‘์„ฑ
  • ๊ฐ€์žฅ ์ตœ์‹  ๋ฒ„์ „์„ ์„ค์น˜ํ•จ
sh install_redis.sh

 

๊ฐœ๋ฐœํ™˜๊ฒฝ

  • NHN Cloud
  • CentOS 7.9

 

ํ”„๋กœ์„ธ์Šค

 

์ฝ”๋“œ

  • su - : root ๊ณ„์ •์œผ๋กœ ์‹คํ–‰
  • yum repository ์—…๋ฐ์ดํŠธ

 

  • redis๊ฐ€ ์ด๋ฏธ ์„ค์น˜๋˜์–ด ์žˆ๋Š”์ง€ ํ™•์ธ
    • ์„ค์น˜๋œ ๊ฒฝ์šฐ ์‚ญ์ œ

 

  • dependency๋“ค์ด ์ด๋ฏธ ์„ค์น˜๋˜์–ด ์žˆ๋Š”์ง€ ํ™•์ธ

 

  • redis ์„ค์น˜ ๋ฐ ์‹คํ–‰

 

  • redis.conf ๋“ฑ ์„ค์ •

 

  • redis ์žฌ์‹คํ–‰

 

  • ์„ค์น˜๊ฒฐ๊ณผ ๋กœ๊ทธ ํŒŒ์ผ๋กœ ์ €์žฅ

 

๊ฒฐ๊ณผ

๊ณผ์ œ ๋‚ด์šฉ

  • ์Šคํฌ๋ฆฝํŠธ๋ฅผ ์‹คํ–‰ํ•˜๋ฉด ์ž๋™์œผ๋กœ redis๋ฅผ ์„ค์น˜ํ•จ
  • redis-cli ์ž…๋ ฅ์‹œ ์ž๋™์œผ๋กœ ์ ‘์†ํ•  ์ˆ˜ ์žˆ๋Š” alias ์ถ”๊ฐ€
  • ์„ค์น˜ ๋ฒ„์ „์„ ๋ณ€์ˆ˜๋กœ ๋ฐ›๊ธฐ
sh install_redis.sh 7.0.8

 

๊ฐœ๋ฐœํ™˜๊ฒฝ

  • NHN Cloud
  • CentOS 7.9

 

ํ”„๋กœ์„ธ์Šค

 

์ฝ”๋“œ

  • ๋ฒ„์ „์„ ์ž…๋ ฅ๋ฐ›์ง€ ์•Š์•˜์„ ๋•Œ

 

  • ๋ฒ„์ „์„ ์ž…๋ ฅ๋ฐ›์•˜์„ ๋•Œ
    • ์ž…๋ ฅํ•œ ๋ฒ„์ „์„ ์„ค์น˜ํ•  ๊ฒƒ์ธ์ง€ ๋ฌป๊ธฐ

 

  • redis์™€ dependency๋“ค์ด ์ด๋ฏธ ์„ค์น˜๋˜์–ด ์žˆ๋Š”์ง€ ํ™•์ธ

 

  • redis ๋‹ค์šด๋กœ๋“œ ๋ฐ ์„ค์น˜

 

  • redis.conf ๋“ฑ ์„ค์ •

 

  • redis ์‹คํ–‰

 

  • alias ์„ค์ •

 

๊ฒฐ๊ณผ

+ Recent posts