目前登录权限存在问题-待解决。
1.概述
因OpenneBula官方镜像源只有AMD架构的镜像包不存在ARM的镜像包,借此用源码编译进行测试。
2.官网github地址
下载解压存放在服务器上:
https://github.com/OpenNebula/minione/blob/master
文件目录:
3.安装依赖包
sudo apt -y install g++ libxmlrpc-c++8-dev scons sqlite3 libmysqlclient-dev postgresql libxml2 libxml2-dev libvncserver-dev openssl libssl-dev ruby bison debhelper default-jdk libws-commons-util-java flex freerdp2-dev grunt javahelper libaugeas-dev libcairo2-dev libcurl4 libcurl4-openssl-dev libmysql++-dev libmysqlclient-dev libnode-dev libossp-uuid-dev libpango1.0-dev libpulse-dev libsqlite3-dev libssh2-1-dev libssl-dev libsystemd-dev libtool libvncserver-dev libvorbis-dev libwebp-dev libxml2-dev libxmlrpc-c++8-dev libxslt1-dev libzmq3-dev libzmq5 nodejs npm postgresql-server-dev-all python3 python3-pip python3-setuptools rake ruby-dev unzip
4.创建用户及文件夹
创建用户文件夹:
sudo mkdir -p /srv/cloud/
sudo groupadd -g 10000 cloud
sudo useradd -u 10000 -g cloud -m oneadmin -d /srv/cloud/one -s /bin/bashsudo passwd oneadmin
sudo chown -R oneadmin:cloud /srv/cloud/
安装秘钥:
su -l oneadmin
ssh-keygen
cat ~/.ssh/id_rsa.pub > ~/.ssh/authorized_keys
echo “StrictHostKeyChecking no” > ~/.ssh/config
exit
安装nfs:
sudo apt-get install nfs-kernel-server
设置权限:
sudo pico /etc/exports
增加如下内容:
/srv/cloud *(rw,fsid=0,nohide,sync,root_squash,no_subtree_check)
启动nfs:
sudo /etc/init.d/nfs-kernel-server start
安装 mariadb-client:
apt install mariadb-client-core-10.6
初始化mariadb:
mariadb-secure-installation
mysql -u root -proot
CREATE USER "oneadmin"@"localhost" IDENTIFIED BY "oneadmin";
CREATE DATABASE opennebula;
GRANT ALL PRIVILEGES ON opennebula.* TO "oneadmin" IDENTIFIED BY "oneadmin";
FLUSH PRIVILEGES;
quit;
5.编译
切换到one-master目录执行编译命令【参数根据自己需要选择】:
su -l oneadmin
scons sqlite=no mysql=yes postgresql=yes parsers=yes new_xmlrpc=yes sunstone=yes fireedge=yes systemd=yes rubygems=yes svncterm=yes context=yes strict=yes
或者修改配置文件【one-master/SConstruct】
scons -j 4
6.安装
切换到one-master目录执行安装命令:
./install.sh -u oneadmin -g cloud -d /srv/cloud/one
配置环境变量:
vim ~/.bash_profileexport ONE_LOCATION=/srv/cloud/one
export ONE_AUTH=$ONE_LOCATION/.one/one_auth
export ONE_XMLRPC=http://localhost:2633/RPC2
export PATH=$ONE_LOCATION/bin:/usr/local/bin:/var/lib/gems/1.8/bin/:$PATH
刷新环境变量:
source ~/.bash_profile
创建用户登录账号密码:
mkdir ~/.one
echo "oneadmin:YOUR_PASSWORD" > ~/.one/one_auth
chmod 640 ~/.one/one_auth
one start
7. 启动sunstone-server
注意安装nodejs的版本为14,因"node-sass": “4.14.1”
官网下arm版本
https://nodejs.org/dist/latest-v14.x/
解压文件到 /usr/local下
vim /etc/profile
export NODE_HOME=/usr/local/node-v14.21.3-linux-arm64
export PATH=$PATH:$NODE_HOME/binsource /etc/profile
rm -rf /usr/local/bin/node
ln -s /usr/local/node-v14.21.3-linux-arm64/bin/node /usr/local/bin/node
rm -rf /usr/local/bin/npm
ln -s /usr/local/node-v14.21.3-linux-arm64/bin/npm /usr/local/bin/npm
npm -v
改变npm默认的路径。
步骤如下:
进入终端,依次输入一下命令
(1)创建global安装任务的目录
mkdir ~/.npm-global
(2)配置npm使用新的目录
sudo npm config set prefix ‘~/.npm-global’
(3)在~/.profile文件中增加配置
sudo export PATH=~/.npm-global/bin:$PATH
(4)配置文件立即生效
source ~/.profile
目前ubantu 不支持在线下载16版本以下的nodejs,安装方法保留,
sudo apt purge nodejs
sudo apt autoremove
sudo apt update
sudo apt install -y curl
curl -fsSL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo dpkg --remove --force-remove-reinstreq libnode-dev
sudo dpkg --remove --force-remove-reinstreq libnode72:amd6
sudo apt install nodejs build-essential -y
配置为淘宝镜像:
npm config set registry http://registry.npm.taobao.org/
还原默认镜像
npm config set registry https://registry.npmjs.org
到安装目录/lib/sunstone/public/下构建nodejs
sudo npm install -g bower
sudo npm install -g grunt-cli
sudo npm install -g grunt
sudo npm install
sudo bash build.sh
运行
sunstone-server start
注意:如果编译失败请删除nodejs 的源文件,我的路径在/root/.npmrc ls
访问地址:
http://ip:9869/
登录权限问题:暂时无法解决。
8. OpenNebula-kvm-node
正在调研。
9. 异常
Install 过程中部分文件找不到(先忽略):
移除man相关文件
mv /usr/share/man/man1/oneacct.1.gz /bak
mv /usr/share/man/man1/oneshowback.1.gz /bak
mv /usr/share/man/man1/oneacl.1.gz /bak
mv /usr/share/man/man1/onehook.1.gz /bak
mv /usr/share/man/man1/onebackupjob.1.gz /bak
mv /usr/share/man/man1/onelog.1.gz /bak
mv /usr/share/man/man1/oneirb.1.gz /bak
mv /usr/share/man/man1/onehost.1.gz /bak
mv /usr/share/man/man1/oneimage.1.gz /bak
mv /usr/share/man/man1/oneuser.1.gz /bak
mv /usr/share/man/man1/onevm.1.gz /bak
mv /usr/share/man/man1/onevnet.1.gz /bak
mv /usr/share/man/man1/onetemplate.1.gz /bak
mv /usr/share/man/man1/onegroup.1.gz /bak
mv /usr/share/man/man1/onecfg.1.gz /bak
mv /usr/share/man/man1/onedb.1.gz /bak
mv /usr/share/man/man1/onedatastore.1.gz /bak
mv /usr/share/man/man1/onecluster.1.gz /bak
mv /usr/share/man/man1/onezone.1.gz /bak
mv /usr/share/man/man1/onevcenter.1.gz /bak
mv /usr/share/man/man1/oneflow.1.gz /bak
mv /usr/share/man/man1/oneflow-template.1.gz /bak
mv /usr/share/man/man1/oneprovision.1.gz /bak
mv /usr/share/man/man1/oneprovider.1.gz /bak
mv /usr/share/man/man1/onesecgroup.1.gz /bak
mv /usr/share/man/man1/onevdc.1.gz /bak
mv /usr/share/man/man1/onevrouter.1.gz /bak
mv /usr/share/man/man1/onemarket.1.gz /bak
mv /usr/share/man/man1/onemarketapp.1.gz /bak
mv /usr/share/man/man1/onevmgroup.1.gz /bak
mv /usr/share/man/man1/onevntemplate.1.gz /bak
生成man包文件(如果缺少其他依赖请自己安装):
apt-get install ronn
cd /xxx/one-master/share/man
bash build .sh
One服务启动失败:
详细查看日志文件onehem.error(不能加载文件):
在rubby工具中安装工具:
gem install ffi
gem install ffi-rzmq
再次启动 one start
安装依赖:
sudo gem install treetop
安装依赖:
sudo gem install parse-cron
在次启动,具体错误找寻不到:
sunstone-server 服务启动失败:
安转依赖:
sudo gem install sinatra
安转依赖:
sudo gem install rqrcode
安转依赖:
sudo gem install rotp
安转依赖:
sudo gem install rbvmomi
安转依赖:
sudo gem install addressable
缺少文件:
目前 有关nodejs 的编译失败,具体原因是node-sass": "4.14.1 自动编译拉取失败。
解决方案:
apt-get install gnutls-bin
git config --global http.sslVerify false
git config --global http.postBuffer 1048576000
安转依赖:
sudo gem install ipaddress
安转依赖:
sudo gem install curb
登录权限问题:暂时无法解决。