AdminSet QuickStart安装文档

AdminSet QuickStart安装文档

Adminset基于DevOps理念开发,以整合全部运维场景为己任。Adminset是一个真正的基于运维思维而开发的全自动化运维平台。
https://github.com/guohongze/adminset

服务端安装

生产服务器建议 4核CPU,6G内存以上.
学习测试建议 2核CPU,2G内存以上.
服务器操作系统版本要求 centos7.2 centos7.4
安装之前请关闭防火墙
//配置阿里源_https://opsx.alibaba.com/mirror
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum makecache
//关闭防火墙
systemctl stop firewalld
systemctl disable firewalld
//配置hosts
vim /ect/hosts
agent的IP agent
//设置主机名
hostnamectl set-hostname server
//重启客户端
reboot
//安装AdminSet服务端(不建议手动安装)
git clone https://github.com/guohongze/adminset.git
adminset/install/server/auto_install.sh

安装完成后打开浏览器http://服务端IP

账户:admin
密码:Adminset123

客户端安装

客户端脚本目前rhel/centos6、centos7,ubuntu16.04
客户端python版本支持2.6.6及以上
说明:为保证注册IP是管理IP(后续会被ansible等调用),客户端的IP抓取目前使用主机名解析,否则报错。
如:主机名为cn-bj-web01 请在/etc/1、hosts中加入相应的解析 192.168.x.x cn-bj-web01,这样再执行adminset_agent.py 可以保证正常运行。
//配置hosts
vim /ect/hosts
server的IP server
//配置主机名
hostnamectl set-hostname agent
//重启客户端
reboot
//配置阿里源_https://opsx.alibaba.com/mirror
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum makecache

1、修改文件install/client/adminset_agent.py :

客户端正常使用需要修改脚本中的两个字段:
token = 'HPcWR7l4NJNJ'        #token是上传到服务器的密钥可以在WEB界面的系统配置中自定义
server_ip = '192.168.47.130'  #此项目为adminset server的IP地址

2、拷贝install/client/ 目录到客户机的任意位置并执行:

cd client
/bin/bash install.sh

3、客户端管理

service adminsetd start|stop|restart|status

注意:客户端全部功能需要配置服务器到客户端的ssh免密登录。
4、配置ssh免密登录

//复制服务端复制公钥
cat /root/.ssh/id_rsa.pub
//登录客户端,新建.ssh文件夹
mkdir .ssh
//将服务端的公钥复制authorized_keys保存
vim /root/.ssh/authorized_keys

安装问题

问题1:ERROR: Cannot uninstall ‘python-ldap’. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

pip install --ignore-installed python-ldap
adminset/install/server/auto_install.sh

问题2:ERROR: Cannot uninstall ‘requests’. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

pip install --ignore-installed requests
adminset/install/server/auto_install.sh

问题3:无法连接WebSSH。

运行:/usr/bin/wssh --xsrf=False --maxconn=100 --log-file-prefix=/var/opt/adminset/logs/webssh.log
报错:File "/usr/lib/python2.7/site-packages/paramiko/ssh_gss.py", line 55, in <module>
    GSS_EXCEPTIONS = (gssapi.GSSException,)
AttributeError: 'module' object has no attribute 'GSSException'
vim /usr/lib/python2.7/site-packages/paramiko/ssh_gss.py
53行修改:import gssapi.error
55行修改:GSS_EXCEPTIONS = (gssapi.error.GSSException,)
//启动webssh
systemctl start webssh.service
//开机自启
systemctl enable webssh.service

问题4:安装完成后无法打开首页,Nginx报502错误。

原因:系统开启了selinux
解决方法:
setenforce 0
sed -i "s/SELINUX=enforcing/SELINUX=disabled/g" /etc/sysconfig/selinux

问题5:系统运行一段时间以后重启服务,Nginx报502错误。

原因:gunicorn 关闭后未能正常删除pid文件
解决方法:
service adminset stop
rm -rf /var/opt/adminset/pid/gunicorn.pid
service adminset start

问题6:定时任务不生效,部署任务卡住。

原因:修改配置后celery服务未获得新得参数进行配置
解决方法:
任务编排-定时任务-后台管理中重启celery服务
或在服务器上执行
service celery restart service beat restart

问题7:第一次在客户端执行agent上报时间太长。

原因:服务器端的配置管理>密钥管理>ssh password中设置的密码与客户机密码不相同
解决方法:
可以忽略,只有第一次上报时间长,以后不会发生这样的问题
或修改客户机或服务器的密码,使其一致

问题8:ansbile、shell、部署等任务失败。

原因:ssh免密登录未成功设置
解决方法:
参写使用说明
或在服务器端执行,进行验证
ssh 客户端ip

问题9:自动或手动安装时安装失败。

原因:外部资源无法下载
解决方法:
请确认yum、pypi、npm等资源可用
如果node 编译时NPM包卡住,请在安装脚本autho_install.sh的47-49行,或server_install.sh的75-77行替换成如下代码
/usr/bin/npm install -g cnpm --registry=https://registry.npm.taobao.org
/usr/bin/cnpm install --production
/usr/bin/cnpm install forever -g
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值