Ralph3 インストール on Ubuntu18.04 - ぶやかー

目次 Outline

Ralph3

https://ralph-ng.readthedocs.io/en/stable/

  • IP、VLAN管理できるけど重複できない
  • マルチテナント的には使えない
  • Demoデータの時点でちょっとデータ量多いものは読み込み以上に遅い(AllhostsやHardwareとか)

→ 実用不可な感じ

curl -sL https://packagecloud.io/allegro/ralph/gpgkey | sudo apt-key add -
sudo sh -c "echo 'deb https://packagecloud.io/allegro/ralph/ubuntu/ bionic main' >  /etc/apt/sources.list.d/ralph.list"
sudo apt-get update
sudo apt-get install mysql-server nginx ralph-core

sudo mysql -u root -e "CREATE DATABASE ralph_ng CHARACTER SET utf8 COLLATE utf8_general_ci;"
sudo mysql -u root -e "CREATE USER ralph_ng@localhost IDENTIFIED BY 'ralph_ng';"
sudo mysql -u root -e "GRANT ALL PRIVILEGES ON ralph_ng.* TO ralph_ng@localhost;"
cat << 'EOF' | sudo tee /etc/nginx/sites-available/ralph.conf
server {

    listen 80;
    client_max_body_size 512M;

    proxy_set_header Connection "";
    proxy_http_version 1.1;
    proxy_connect_timeout  300;
    proxy_read_timeout 300;

    access_log /var/log/nginx/ralph-access.log;
    error_log /var/log/nginx/ralph-error.log;

    location /static {
        alias /usr/share/ralph/static;
        access_log        off;
        log_not_found     off;
        expires 1M;
    }

    #location /media {
    #    alias /var/local/ralph/media;
    #    add_header Content-disposition "attachment";
    #}

    location / {
        proxy_pass http://127.0.0.1:8000;
        include /etc/nginx/uwsgi_params;
        proxy_set_header Host $http_host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
}
EOF
sudo rm /etc/nginx-sites-enabled/default
ln -s /etc/nginx/sites-available/ralph.conf /etc/nginx/sites-enabled/
sudo systemctl restart nginx
sudo ralphctl migrate
sudo ralphctl createsuperuser
sudo ralphctl sitetree_resync_apps

Demoデータ入れるなら

sudo ralphctl demodata

とりあえず起動

sudo ralphctl runserver 8000

サービス起動と登録

sudo systemctl enable ralph
sudo systemctl start ralph

この記事を書いた人 Wrote this article

kmatsunuma

TOP