当前位置:网站首页>OpenNMS分离数据库
OpenNMS分离数据库
2022-07-06 15:10:00 【星哥玩云】
1. 分离数据库 1.1 配置OpenNMS文件 1.我们需要在OpenNMS中修改datasource数据源,在OpenNMS中如下目录:
/opt/opennms/etc/opennms-datasources.xml
2.将localhost修改为数据库主机IP地址即可
<jdbc-data-source name="opennms"
database-name="opennms"
class-name="org.postgresql.Driver" url="jdbc:postgresql://数据库主机IP:5432/opennms"
user-name="opennms"
password="opennms" />
修改前:
修改后:
1.2 安装PostgreSQL数据库 1.安装PostgreSql数据库
yum install postgresql postgresql-server命令,系统自动下载postgreSQL安装。
2.首先启动PostgreSQL
以root身份运行命令:
/sbin/service postgresql start
3.如果看到一个错误的话,您必须初始化PostgreSQL,运行以下命令:
/sbin/service postgresql initdb
/sbin/service postgresql start
4.以确保PostgreSQL将在重新启动后开始,使用“chkconfig的”命令在启动时进行启动,运行以下命令:
/sbin/chkconfig postgresql on
1.2.1 配置允许用户对数据库的访问 1.找到/var/lib/pgsql/data/pg_hba.conf内容为:
ident—>trust
修改为
即可。
2.找到/var/lib/pgsql/data/postgresql.conf修改以下内容
listen_addresses = '*'
#port = 5432 去掉”#”号
3.修改完之后,你需要重新启动数据库,以root身份运行:
/sbin/service postgresql restart
1.3 测试 在OpenNMS主机中测试分离主机上的PostgreSql数据库
1. 用putty登录OpenNMS主机
2. 执行psql -h 数据库主机IP -U opennms -d opennms
3.查看数据库
执行命令 \l
查看用户
执行命令 \du
退出
执行命令 \q
以上测试说明可以在OpenNMS主机上成功连接分离出数据库
1.4 在客户端执行sql语句: 1.在/opt/opennms/etc目录下
执行完成后重启OpenNMS
边栏推荐
- Installation and use of labelimg
- Advantages of link local address in IPv6
- What are the specific steps and schedule of IELTS speaking?
- Leetcode: interview question 17.24 Maximum cumulative sum of submatrix (to be studied)
- Data storage (1)
- Senior soft test (Information System Project Manager) high frequency test site: project quality management
- 关于声子和热输运计算中BORN电荷和non-analytic修正的问题
- Sword finger offer question brushing record 1
- 做国外LEAD2022年下半年几点建议
- Should novice programmers memorize code?
猜你喜欢
Sword finger offer question brushing record 1
Learn the principle of database kernel from Oracle log parsing
Web APIs DOM 时间对象
数据处理技巧(7):MATLAB 读取数字字符串混杂的文本文件txt中的数据
Daily question 1: force deduction: 225: realize stack with queue
UE4蓝图学习篇(四)--流程控制ForLoop和WhileLoop
[leetcode daily clock in] 1020 Number of enclaves
第4章:再谈类的加载器
CCNA Cisco network EIGRP protocol
Self made j-flash burning tool -- QT calls jlinkarm DLL mode
随机推荐
ThreadLocal详解
GD32F4XX串口接收中断和闲时中断配置
Sword finger offer question brushing record 1
Seata aggregates at, TCC, Saga and XA transaction modes to create a one-stop distributed transaction solution
Advantages of link local address in IPv6
[线性代数] 1.3 n阶行列式
硬件開發筆記(十): 硬件開發基本流程,制作一個USB轉RS232的模塊(九):創建CH340G/MAX232封裝庫sop-16並關聯原理圖元器件
uniapp设置背景图效果demo(整理)
自定义 swap 函数
[IELTS speaking] Anna's oral learning record part1
第3章:类的加载过程(类的生命周期)详解
return 关键字
labelimg的安装与使用
Attack and defense world miscall
Assembly and interface technology experiment 5-8259 interrupt experiment
const关键字
[leetcode] 19. Delete the penultimate node of the linked list
leetcode:面试题 17.24. 子矩阵最大累加和(待研究)
Management background --1 Create classification
Web APIs DOM time object