- 一、关闭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