How to install OpenneBula on Ubuntu

OpenNebula is an open source cloud computing platform that allows us to combine and manage VMware and KVM virtual machines in a fully virtualized cloud

Step 1: Install MariaDB Database Server

OpenNebula also requires a database server to store its content.

Install MariaDB:

1

2

sudo apt update

sudo apt install mariadb-server mariadb-client

After installing MariaDB, the commands below can be used to stop, start and enable MariaDB service.

1

2

3

sudo systemctl stop mariadb.service

sudo systemctl start mariadb.service

sudo systemctl enable mariadb.service

After that, run the following command to secure MariaDB server by creating root password and disabling remote root access.

1

sudo mysql_secure_installation

When prompted, answer the following questions by following the tutorial.

  • Enter root's current password (enter none): just press Enter
  • set root password? [Y/N]: Y
  • New Password: Enter a password
  • Re-enter new password: repeat password
  • Delete anonymous user? [Y/N]: Y
  • Disable root login remotely? [Y/N]: Y
  • delete the test database and access it? [Y/N]: Y
  • Reload permissions table now? [Y/N]: Y

View MariaDB service status.

1

sudo systemctl status mariadb

Example output:

1

2

3

4

5

6

7

8

9

10

11

● mariadb.service - MariaDB 10.1.44 database server

Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)

Active: active (running) since Wed 2016-04-08 17:08:17 CDT; 1min 54s ago

Docs: man:mysqld(8)

https://mariadb.com/kb/en/library/systemd/

Main PID: 22363 (mysqld)

Status: "Taking your SQL requests now. "

Tasks: 27 (limit: 4666)

CGroup: /system.slice/mariadb.service

└─22363 /usr/sbin/mysqld

Apr 08 17:08:17 ubuntu1804 /etc/mysql/debian-start[22396]: mysql

Step 2: Create the OpenNebula Database

Login to MariaDB

1

sudo mysql -u root -p

Create a blank database opennebula

1

CREATE DATABASE opennebula;

Create a database user  opennebulauserwith the password new_password_here

1

CREATE USER 'opennebulauser'@'localhost' IDENTIFIED BY 'new_password_here';

Grant the user  cakephpuserfull access to the database.

1

GRANT ALL ON opennebula.* TO 'opennebulauser'@'localhost' WITH GRANT OPTION;

Finally, save your changes and exit.

1

2

FLUSH PRIVILEGES;

EXIT;

Step 3: Install Opennula

By default, Ubuntu default repositories use no OpenneBula.

We have to install from OpenneBula repository.

Add its repository key to Ubuntu:

1

wget -q -O- https://downloads.opennebula.org/repo/repo.key | sudo apt-key add

Add its repository files.

1

echo "deb https://downloads.opennebula.org/repo/5.6/Ubuntu/18.04 stable opennebula" sudo tee /etc/apt/sources.list.d/opennebula.list

Install OpenNebula.

1

2

sudo apt update

sudo apt install opennebula opennebula-sunstone opennebula-gate opennebula-flow

Install the Ruby library and other required packages to support Opennula.

1

sudo /usr/share/one/install_gems

The commands below can be used to start and enable the OpenNebula service.

1

2

3

4

sudo systemctl start opennebula

sudo systemctl enable opennebula

sudo systemctl start opennebula-sunstone

sudo systemctl enable opennebula-sunstone

Open the configuration file.

1

sudo nano /etc/one/oned.conf

Fill in the configuration file using the database name, user and password created above:

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

SCRIPTS_REMOTE_DIR=/var/tmp/one

PORT = 2633

LISTEN_ADDRESS = "0.0.0.0"

#DB = [ BACKEND = "sqlite" ]

Sample configuration for MySQL

DB = [ BACKEND = "mysql",

SERVER = "localhost",

PORT = 0,

USER = "opennebulauser",

PASSWD = "database_password_here",

DB_NAME = "opennebula",

CONNECTIONS = 50 ]

VNC_PORTS = [

START = 5900

RESERVED = "6800, 6801, 6810:6820, 9869"

By default, its default username and password are stored in the credentials below:

1

sudo nano /var/lib/one/.one/one_auth

Check the status of the OpenNebula service:

1

sudo systemctl status opennebula

Example output:

1

2

3

4

5

6

7

8

9

10

11

12

13

● opennebula.service - OpenNebula Cloud Controller Daemon

Loaded: loaded (/lib/systemd/system/opennebula.service; enabled; vendor preset: enabled

Active: active (running) since Sat 2016-04-11 18:35:40 CDT; 6min ago

Main PID: 17544 (oned)

Tasks: 105 (limit: 4666)

CGroup: /system.slice/opennebula.service

├─17544 /usr/bin/oned -f

├─17547 ruby /usr/lib/one/mads/one_hm.rb

├─17582 ruby /usr/lib/one/mads/one_vmm_exec.rb -t 15 -r 0 kvm

├─17599 ruby /usr/lib/one/mads/one_vmm_exec.rb -l deploy,shutdown,reboot,cancel

├─17616 /usr/lib/one/mads/collectd -p 4124 -f 5 -t 50 -i 60

├─17668 ruby /usr/lib/one/mads/one_im_exec.rb -r 3 -t 15 -w 90 kvm

├─17681 ruby /usr/lib/one/mads/one_im_exec.rb -l -c -t 15 -r 0 vcenter

Step 4: Access the OpenNebula Portal

open login page

http://localhost:9869

After logging in you will be taken to the Opennula Dashboard.

Set up KVM nodes

添加KVM节点,只需运行我们要通过Opennula管理的节点下面的命令。

1

wget -q -O- https://downloads.opennebula.org/repo/repo.key | sudo apt-key add

然后添加其存储库

1

echo "deb https://downloads.opennebula.org/repo/5.6/Ubuntu/18.04 stable opennebula" sudo tee /etc/apt/sources.list.d/opennebulakvmnode.list

最后,运行以下命令以安装节点包

1

2

sudo apt update

sudo apt-get install opennebula-node

打开其配置文件以允许OpenneBula管理它。

1

sudo nano /etc/libvirt/libvirtd.conf

然后编辑这些行并保存。

1

2

3

4

5

This is restricted to 'root' by default.

unix_sock_group = "oneadmin"

If not using PolicyKit and setting group ownership for access

control, then you may want to relax this too.

unix_sock_rw_perms = "0777"

重新启动客户端服务

1

2

sudo systemctl restart libvirtd

sudo systemctl restart libvirt-bin

设置无密码的SSH身份验证。

创建密码身份验证后,将服务器SSH密钥复制到客户端known_hosts文件中。

1

/var/lib/one/.ssh/known_hosts

将有信任的所有密钥。

要管理KVM主机,请转到OpenneBula Web界面,开放式基础架构>>主机,然后单击+按钮。

添加新节点以进行管理。

Guess you like

Origin blog.csdn.net/a1058926697/article/details/131741503