【CMDB】onecmdb 开源cmdb/ITIL软件部署

本文详细介绍了一种配置和部署OneCMDB的方法,包括在CentOS 7.5 x64上安装所需的软件包,配置Tomcat服务器端口,设置数据库连接参数,以及解决在MySQL 5.0以上版本中遇到的初始化错误。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

参考:
https://blog.csdn.net/shaw_young/article/details/78730724


资源:
官方主页:http://www.onecmdb.org/wiki/index.php?title=Main_Page 
官方下载:http://sourceforge.net/projects/onecmdb/files/ 

环境:
centos 7.5 x64
mariadb 5.5.56
ip:192.168.3.5

安装linux64位系统32位支持包glibc.i686

yum list glibc*

yum install glibc.i686 

解压到目录:
tar -xzvf onecmdb-2.1.0-linux.i386.tar.gz -C /opt

引入mysql jar包:
下载mysql-connector-java-5.1.48.tar.gz
tar -xzvf mysql-connector-java-5.1.48.tar.gz
cd mysql-connector-java-5.1.48
cp mysql-connector-java-5.1.48.jar  /opt/onecmdb/tomcat/webapps/ROOT/WEB-INF/lib 

编辑配置文件:

修改连接端口
cd  /opt/onecmdb/tomcat/conf

vi server.xml
1、<Server port="8295" shutdown="SHUTDOWN">

2、<!-- Define a non-SSL HTTP/1.1 Connector on port 8080 -->
   <Connector port="8388" maxHttpHeaderSize="8192"
              maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
              enableLookups="false" redirectPort="8443" acceptCount="100"
              connectionTimeout="20000" disableUploadTimeout="true" />

3、<!-- Define an AJP 1.3 Connector on port 8009 -->
   <Connector port="8299"
              enableLookups="false" redirectPort="8443" protocol="AJP/1.3" />

修改setenv.sh文件
cd /opt/onecmdb/bin

vi setenv.sh

export ONECMDB_URL=http://localhost:8388
export ONECMDB_DESKTOP_URL=http://localhost:8388/onecmdb-desktop


修改onecmdb.xml文件
cd  /opt/onecmdb/repository/OneCMDB_Core/Configuration

vi onecmdb.xml

<entry key="oneCMDBwsdl">http://localhost:8388/webservice/onecmdb</entry>


修改数据库配置文件
cd  /opt/onecmdb/tomcat/webapps/ROOT/WEB-INF/classes 

vi datasource.xml

<property name="driverClassName" value="com.mysql.jdbc.Driver" />
<property name="url" value="jdbc:mysql://localhost:3306/onecmdb?useUnicode=true&amp;characterEncoding=utf8" />
<property name="username" value="root" />
<property name="password" value="mysql" />

创建数据库
CREATE DATABASE IF NOT EXISTS onecmdb default charset utf8 COLLATE utf8_general_ci;
 
启动应用:
cd /opt/onecmdb/bin

./onecmdb.sh start
./onecmdb.sh stop


访问地址:
http://192.168.3.5:8388/onecmdb-desktop

管理账号
admin // 123
    
日志位置:
/opt/onecmdb/tomcat/logs

如果用的是5.0以上的mysql数据库,初始化时会报错:
2019-08-22 10:16:20,311 ERROR - SchemaUpdate.execute(155) | Unsuccessful: create table Attribute (id bigint not null, derivedFromId bigint, displayName varchar(255), alias varchar(255), complexValue bit, isBlueprint bit, description text, typeName varch
ar(255), reftypename varchar(255), valueAsString text, valueAsLong bigint, valueAsDate datetime, ownerId bigint, maxOccurs integer, minOccurs integer, lastModified datetime, createTime datetime, primary key (id)) type=InnoDB
2019-08-22 10:16:20,312 ERROR - SchemaUpdate.execute(156) | You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'type=InnoDB' at line 1

在5.0之后版本
type=InnoDB 被 engine=InnoDB 替代

手动到数据库执行
create table Attribute (id bigint not null, derivedFromId bigint, displayName varchar(255), alias varchar(255), complexValue bit, isBlueprint bit, description text, typeName varchar(255), reftypename varchar(255), valueAsString text, valueAsLong bigint, valueAsDate datetime, ownerId bigint, maxOccurs integer, minOccurs integer, lastModified datetime, createTime datetime, primary key (id)) engine=InnoDB;

create table CI (id bigint not null, derivedFromId bigint, displayName varchar(255), alias varchar(255), gid bigint, path text, isBlueprint bit, description text, sourceId bigint, sourceAttributeId bigint, targetId bigint, sourceTemplatePath text, targetTemplatePath text, lastModified datetime, createTime datetime, primary key (id)) engine=InnoDB;

create table CMDBTX (id bigint not null, name varchar(255), status integer, issuer varchar(255), insertTs datetime, beginTs datetime, endTs datetime, rejectCause varchar(255), ciModified integer, ciAdded integer, ciDeleted integer, primary key (id)) engine=InnoDB;

create table RFC (id bigint not null, RFC_TYPE varchar(255) not null, parentId bigint, targetId bigint, targetCIId bigint, targetAlias varchar(255), txId bigint, ts datetime, destroyedAlias varchar(255), destroyedId bigint, wasCi bit, newAlias varchar(255), oldAlias varchar(255), newTemplate bit, oldTemplate bit, description text, newDisplayNameExpression varchar(255), oldDisplayNameExpression varchar(255), fromId bigint, toId bigint, toAlias varchar(255), oldReferenceTypeAlias varchar(255), newReferenceTypeAlias varchar(255), oldTypeAlias varchar(255), newTypeAlias varchar(255), oldMaxOccurs integer, newMaxOccurs integer, oldMinOccurs integer, newMinOccurs integer, oldValue text, newValue text, newValueAsAlias varchar(255), value text, indx integer, alias varchar(255), valueAsAlias varchar(255), oldOwnerId bigint, newOwnerId bigint, sourceAttributeId bigint, referenceTarget varchar(255), primary key (id)) engine=InnoDB;

--优点
部署简单

--缺点
界面UI不是很好看
全英文,无中文支持

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值