This repository is the actual use of the engineering version of Haina storage, only for learning and research use. The related technology has been authorized with Chinese copyright and patent protection.
本仓库为海纳存储可实际使用的工程版本,仅供学习与研究使用。相关技术已授中国版权和专利保护。
You can access the operation video on Youtube: https://youtu.be/2b8JMqvZV60
This engineering prototype is developed from Django
, consequently, you do need to start the program as Django
requires.
该工程原型根据Django
框架开发,因此您需要安装Django
的启动流程进行项目的启动操作。
You need install mysql
and pymysql
lib. After that, edit the 110th to 119th lines in the configuration file settings.py.
您需要提前安装mysql
数据库并安装pymysql
库。其次, 修改配置文件settings.py的第110至119行。
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'hns',
'HOST': '127.0.0.1',
'PORT': 3306,
'USER': 'root',
'PASSWORD': 'root',
}
}
First, you need to run the database generation operation.
首先,您需要进行数据库表生成操作。
python manage.py makemigrations
python manage.py migrate
Open the strosys_nodes
table in your database and insert the node records as follows. You can change the port if you want.
打开数据库中的strosys_nodes
表,按照如下示例完成所有节点记录插入。
| id | name | is_alive |
| 1 | 192.168.1.2:8000 | 1 | # if ip based
| 2 | n1.example.com:8000 | 1 | # if domain name based
Start the project.
启动服务。
python manage.py runserver <ip>:<port>