- 一、關閉SE
- 二、配置epel源地和opennebula源
cat << "EOT" > /etc/yum.repos.d/opennebula.repo
[opennebula]
name=opennebula
baseurl=https://downloads.opennebula.org/repo/5.10/CentOS/7/$basearch
enabled=1
gpgkey=https://downloads.opennebula.org/repo/repo.key
gpgcheck=1
repo_gpgcheck=1
EOT
cat << "EOT" > /etc/yum.repos.d/opennebula.repo
[opennebula]
name=opennebula
baseurl=https://downloads.opennebula.org/repo/5.10/CentOS/8/$basearch
enabled=1
gpgkey=https://downloads.opennebula.org/repo/repo.key
gpgcheck=1
repo_gpgcheck=1
EOT
- 三、安裝相關主控相關依賴包
yum install opennebula-server opennebula-sunstone opennebula-ruby opennebula-gate opennebula-flow -y
- 四、Ruby 運行環境安裝(V5.10版本以後可選)
查看:
ls -lad /usr/share/one/gems*
lrwxrwxrwx 1 root root 9 Aug 13 11:41 /usr/share/one/gems -> gems-dist
drwxr-xr-x 9 root root 4096 Aug 13 11:41 /usr/share/one/gems-dist
自動修復:
test -L /usr/share/one/gems && unlink /usr/share/one/gems
/usr/share/one/install_gems
手動修復:
sqlite3 development library
mysql client development library
curl development library
libxml2 and libxslt development libraries
ruby development library
gcc and g++
make
以上安裝包
- 五、mysql數據庫配置
一、建立用戶
GRANT ALL PRIVILEGES ON opennebula.* TO 'oneadmin' IDENTIFIED BY '<thepassword>';
二、配置事務隔離級別
SET GLOBAL TRANSACTION ISOLATION LEVEL READ COMMITTED;
三、配置oned.configuration
# Sample configuration for MySQL
DB = [ backend = "mysql",
server = "localhost",
port = 0,
user = "oneadmin",
passwd = "<thepassword>",
db_name = "opennebula" ]
四、按期清理索引
alter table vm_pool drop index ftidx;
alter table vm_pool add fulltext index ftidx (search_token);
五、虛擬機自定義配置
- 六、啓動OpenNebula
一、使用 oneadmin 用戶
su oneadmin
二、修改默認密碼
echo "oneadmin:mypassword" > ~/.one/one_auth
三、啓動
systemctl start opennebula
systemctl start opennebula-sunstone
四、出錯驗證Ruby環境是否有問題
- 七、驗證安裝
一、命令:oneuser show
輸出:
USER 0 INFORMATION
ID : 0
NAME : oneadmin
GROUP : oneadmin
PASSWORD : 3bc15c8aae3e4124dd409035f32ea2fd6835efc9
AUTH_DRIVER : core
ENABLED : Yes
USER TEMPLATE
TOKEN_PASSWORD="ec21d27e2fe4f9ed08a396cbd47b08b8e0a4ca3c"
RESOURCE USAGE & QUOTAS
二、網頁
http://<frontend_address>:9869
三、錯誤日誌
/var/log/one/sunstone.log
/var/log/one/sunstone.error
四、程序說明
Path Description
/etc/one/ Configuration Files
/var/log/one/ Log files, notably: oned.log, sched.log, sunstone.log and <vmid>.log
/var/lib/one/ oneadmin home directory
/var/lib/one/datastores/<dsid>/ Storage for the datastores
/var/lib/one/vms/<vmid>/ Action files for VMs (deployment file, transfer manager scripts, etc…)
/var/lib/one/.one/one_auth oneadmin credentials
/var/lib/one/remotes/ Probes and scripts that will be synced to the Hosts
/var/lib/one/remotes/hooks/ Hook scripts
/var/lib/one/remotes/vmm/ Virtual Machine Manager Driver scripts
/var/lib/one/remotes/auth/ Authentication Driver scripts
/var/lib/one/remotes/im/ Information Manager (monitoring) Driver scripts
/var/lib/one/remotes/market/ MarketPlace Driver scripts
/var/lib/one/remotes/datastore/ Datastore Driver scripts
/var/lib/one/remotes/vnm/ Networking Driver scripts
/var/lib/one/remotes/tm/ Transfer Manager Driver scripts
五、端口說明
Port Description
9869 Sunstone server.
29876 VNC proxy port, used for translating and redirecting VNC connections to the hypervisors.
2633 OpenNebula daemon, main XML-RPC API endpoint.
2474 OneFlow server. This port only needs to be opened if OneFlow server is used.
5030 OneGate server. This port only needs to be opened if OneGate server is used.
端口均可以自定義配置,或者代理。
- 八、後續步驟
一、重置密碼
oneuser passwd 0 <PASSWORD>
echo 'oneadmin:PASSWORD' > /var/lib/one/.one/one_auth