打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
Netbox 开源 IPAM 管理工具搭建详细流程
PostgreSQL数据库安装
1.yum 下载安装
1)yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm2)yum install -y postgresql96 postgresql96-server postgresql96-devel3)/usr/pgsql-9.6/bin/postgresql96-setup initdb
2.修改配置
修改文件/var/lib/pgsql/9.6/data/pg_hba.conf中ident为md5
80 local all all peer 81 # IPv4 local connections: 82 host all all 10.44.196.30/32 md5 83 # IPv6 local connections: 84 host all all ::1/128 md5
3.启动服务
systemctl start postgresql-9.6systemctl enable postgresql-9.6
4.创建数据库
1 # sudo -u postgres psql 2 psql (9.4.5) 3 Type "help" for help. 4 5 postgres=# CREATE DATABASE netbox; 6 CREATE DATABASE 7 postgres=# CREATE USER netbox WITH PASSWORD '123456'; 8 CREATE ROLE 9 postgres=# GRANT ALL PRIVILEGES ON DATABASE netbox TO netbox;10 GRANT11 postgres=# \q
5.验证状态
psql -U netbox -W -h 10.44.196.30 netbox
[root@wangjunqiang ~]# psql -U netbox -W -h 10.44.196.30 netboxPassword for user netbox: psql (9.6.18)Type "help" for help.netbox=> \d List of relations Schema | Name | Type | Owner --------+--------------------------------------------+----------+-------- public | auth_group | table | netbox public | auth_group_id_seq | sequence | netbox
Redis安装
1.yum安装
# yum install -y epel-release# yum install -y redis# systemctl start redis# systemctl enable redis
2.验证状态
1 $ redis-cli ping2 PONG
NetBox安装
1.依赖环境安装
# yum install -y gcc python36 python36-devel python36-setuptools libxml2-devel libxslt-devel libffi-devel openssl-devel redhat-rpm-config# easy_install-3.6 pip
2.克隆git仓库
mkdir -p /opt/netbox/ && cd /opt/netbox/yum install -y gitgit clone -b master https://github.com/netbox-community/netbox.git .
3.创建用户(centos需要先建组)
groupadd netboxadduser -r netbox -g netboxchown --recursive netbox /opt/netbox/netbox/media/
4.设置python环境
python3 -m venv /opt/netbox/venvsource venv/bin/activate语言方法
5766239Pc
eGFYz抖音极速版赚钱是真的吗「日赚千元」教程
10462010/07/04 13:05:06
pip3 install -r requirements.txt
5.配置文件设置
cd netbox/netbox/cp configuration.example.py configuration.py
6.编辑configuration.py文件,设置可访问主机
ALLOWED_HOSTS = [‘127.0.0.1’]如果全可以访问就填入* 10 # Example: ALLOWED_HOSTS = ['netbox.example.com', 'netbox.internal.local'] 11 ALLOWED_HOSTS = ['*'] 12 13 # PostgreSQL database configuration. See the Django documentation for a complete list of available parameters: 14 # https://docs.djangoproject.com/en/stable/ref/settings/#databases 15 DATABASE = { 16 'NAME': 'netbox', # Database name 17 'USER': 'netbox', # PostgreSQL username 18 'PASSWORD': '123456', # PostgreSQL password 19 'HOST': '10.44.196.30', # Database server 20 'PORT': '', # Database port (leave blank for default) 21 'CONN_MAX_AGE': 300, # Max database connection age 22 }
至少包含50个字母数字字符的随机密钥
52 # This key is used for secure generation of random numbers and strings. It must never be exposed outside of this file.
53 # For optimal security, SECRET_KEY should be at least 50 characters in length and contain a mix of letters, numbers, and
54 # symbols. NetBox will not run without this defined. For more information, see
55 # https://docs.djangoproject.com/en/stable/ref/settings/#std:setting-SECRET_KEY
56 SECRET_KEY = '1234567890abcdefghigklmnopqrstuvwxyz1234567890abcdefghigklmnopqrstuvwxyz'
7.数据库迁移
cd /opt/netbox/netbox/python3 manage.py migrate
8.管理员用户创建
(venv) # python3 manage.py createsuperuserUsername: adminEmail address: admin@example.comPassword:Password (again):Superuser created successfully.python3 manage.py collectstatic --no-input
9.应用测试
启动程序:
python3 manage.py runserver 0.0.0.0:8000 --insecure
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
IP地址管理工具
Centos7安装和配置Postgresql数据库及Navicat连接
PostgreSQL11.3 创建用户和创建数据库
centos7 安装postgresql
PostgreSQL+pgpool
「OushuDB」命令行安装之 PostGIS
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服