2017년 8월 31일 목요일

rabbit cluster

vagrant 
# -*- mode: ruby -*-
# vi: set ft=ruby :

# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
  # The most common configuration options are documented and commented below.
  # For a complete reference, please see the online documentation at
  # https://docs.vagrantup.com.

  # Every Vagrant development environment requires a box. You can search for
  # boxes at https://vagrantcloud.com/search.
  config.vm.box = "ubuntu/xenial64"
   # config.vm.host_name = 'web'
  # Disable automatic box update checking. If you disable this, then
  # boxes will only be checked for updates when the user runs
  # `vagrant box outdated`. This is not recommended.
  # config.vm.box_check_update = false

  # Create a forwarded port mapping which allows access to a specific port
  # within the machine from a port on the host machine. In the example below,
  # accessing "localhost:8080" will access port 80 on the guest machine.
  # NOTE: This will enable public access to the opened port
  # config.vm.network "forwarded_port", guest: 80, host: 8080

  # Create a forwarded port mapping which allows access to a specific port
  # within the machine from a port on the host machine and only allow access
  # via 127.0.0.1 to disable public access
  #config.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: "192.168.50.4"

  # Create a private network, which allows host-only access to the machine
  # using a specific IP.
  
  config.vm.define "n1" do |n1|
      n1.vm.hostname = "n1"
      n1.vm.network "private_network", ip: "192.168.50.4"
  end

  config.vm.define "n2" do |n2|
      n2.vm.hostname = "n2"
      n2.vm.network "private_network", ip: "192.168.50.5"
  end
  
  config.vm.define "n3" do |n3|
      n3.vm.hostname = "n3"
      n3.vm.network "private_network", ip: "192.168.50.6"
  end
  
  config.vm.define "haproxy" do |haproxy|
      haproxy.vm.hostname = "haproxy"
      haproxy.vm.network "private_network", ip: "192.168.50.3"
  end
 # config.vm.network "private_network", ip: "192.168.50.4"
  # Create a public network, which generally matched to bridged network.
  # Bridged networks make the machine appear as another physical device on
  # your network.
  # config.vm.network "public_network"

  # Share an additional folder to the guest VM. The first argument is
  # the path on the host to the actual folder. The second argument is
  # the path on the guest to mount the folder. And the optional third
  # argument is a set of non-required options.
  # config.vm.synced_folder "../data", "/vagrant_data"

  # Provider-specific configuration so you can fine-tune various
  # backing providers for Vagrant. These expose provider-specific options.
  # Example for VirtualBox:
  #
  # config.vm.provider "virtualbox" do |vb|
  #   # Display the VirtualBox GUI when booting the machine
  #   vb.gui = true
  #
  #   # Customize the amount of memory on the VM:
  #   vb.memory = "1024"
  # end
  #
  # View the documentation for the provider you are using for more
  # information on available options.

  # Enable provisioning with a shell script. Additional provisioners such as
  # Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
  # documentation for more information about their specific syntax and use.
  # config.vm.provision "shell", inline: <<-SHELL
  #   apt-get update
  #   apt-get install -y apache2
  # SHELL

end


서버 1
    1  ifconfig
    2  exit
    3  sudo su
    4  exit
    5  sudo apt-get install rabbitmq-server
    6  sudo rabbitmq-plugins enable rabbitmq_management
    7  sudo service rabbitmq-server restart
    8  sudo rabbitmqctl add_user rabbitmq password
    9  sudo rabbitmqctl set_user_tags rabbitmq administrator
   10  sudo rabbitmqctl cluster_status
   11  rabbitmqctl stop
   12  rabbitmqctl stop_app
   13  ps -aux | grep rabbit
   14  rabbitmq-server -detached
   15  sudo rabbitmq-server -detached
   16  exit
   17  ping 192.168.50.6
   18  ping 192.168.50.5
   19  rabbitmq-server -detached
   20  sudo rabbitmq-server -detached
   21  sudo rabbitmqctl status
   22  cd /var/lib/rabbitmq/
   23  ll
   24  vi .erlang.cookie
   25  sudo vi .erlang.cookie
   26  sudo vi /etc/hosts
   27  sudo vi .erlang.cookie
   28  history
   29  sudo rabbitmqctl cluster_status
   30  sudo apt-get -y install htop


서버 2

 1  sudo su
    2  exit
    3  sudo apt-get install rabbitmq-server
    4  rabbitmq-plugins enable rabbitmq_management
    5  sudo rabbitmq-plugins enable rabbitmq_management
    6  sudo service rabbitmq-server restart
    7  sudo rabbitmqctl add_user rabbitmq password
    8  sudo rabbitmqctl set_user_tags rabbitmq administrator
    9  sudo rabbitmqctl cluster_status
   10  history
   11  sudo rabbitmq-server -detached
   12  sudo rabbitmqctl stop_app
   13  sudo rabbitmqctl join_cluster rabbit@n1
   14  ping n1
   15  ping 192.168.50.4
   16  ping 192.168.50.6
   17  ping 192.168.50.4
   18  sudo rabbitmqctl join_cluster rabbit@n1
   19  ping n1
   20  vi /etc/host
   21  cd /var/lib/rabbitmq/
   22  ll
   23  sudo vi .erlang.cookie
   24  sudo vi /etc/hosts
   25  ping n2
   26  ping n1
   27  sudo rabbitmqctl join_cluster rabbit@n1
   28  sudo rabbitmq-server -detached
   29  sudo rabbitmqctl join_cluster rabbit@n1
   30  ls
   31  ll
   32  sudo vi .erlang.cookie
   33  rabbitmqctl status
   34  sudo rabbitmqctl status
   35  sudo vi /etc/hosts
   36  sudo rabbitmqctl join_cluster rabbit@n1
   37  sudo rabbitmqctl cluster_status
   38  sudo rabbitmq-server -detached
   39  sudo rabbitmqctl cluster_status
   40  ls
   41  ll
   42  rm -rf .erlang.cookie
   43  sudo rm -rf .erlang.cookie
   44  sudo rabbitmq-server -detached
   45  sudo rabbitmqctl cluster_status
   46  sudo /etc/hosts
   47  sudo vi /etc/hosts
   48  sudo rabbitmqctl cluster_status
   49  sudo rabbitmq-server -detached
   50  sudo rabbitmq-server stop_app
   51  sudo rabbitmq-server stop
   52  sudo rabbitmqctl status
   53  l
   54  ll
   55  sudo vi .erlang.cookie
   56  sudo vi /etc/hosts
   57  sudo rabbitmq-server stop_app
   58  sudo rabbitmq-server -detached
   59  sudo rabbitmqctl cluster_status
   60  sudo rabbitmqctl join_cluster rabbit@n1
   61  ps -aux | grep rabbi
   62  sudo rabbitmq-server stop
   63  ps -aux | grep rabbi
   64  sudo rabbitmqctl shutdown
   65  sudo rabbitmq-server stop_app
   66  sudo rabbitmqctl stop_app


댓글 없음:

댓글 쓰기

nexacro 인터셉터 설정

    <dependency>       <groupId>com.fasterxml.jackson.core</groupId>   <artifactId>jackson-core</artifactId&...