Giter Site home page Giter Site logo

Comments (6)

v55448330 avatar v55448330 commented on September 3, 2024

因为启用了 iptables 控制,所以暂时不支持 docker 方式运行,如果需要使用 Docker,可以注释 iptables 相关代码

from lazy-balancer.

mamacmm avatar mamacmm commented on September 3, 2024

直接在一个docker容器里面,按操作步骤执行,报错了:

root@dcaa96044a3f:/app/lazy_balancer# python manage.py makemigrations Traceback (most recent call last): File "manage.py", line 10, in <module> execute_from_command_line(sys.argv) File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 353, in execute_from_command_line utility.execute() File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 345, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 348, in run_from_argv self.execute(*args, **cmd_options) File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 398, in execute self.check() File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 426, in check include_deployment_checks=include_deployment_checks, File "/usr/local/lib/python2.7/dist-packages/django/core/checks/registry.py", line 75, in run_checks new_errors = check(app_configs=app_configs) File "/usr/local/lib/python2.7/dist-packages/django/core/checks/urls.py", line 13, in check_url_config return check_resolver(resolver) File "/usr/local/lib/python2.7/dist-packages/django/core/checks/urls.py", line 23, in check_resolver for pattern in resolver.url_patterns: File "/usr/local/lib/python2.7/dist-packages/django/utils/functional.py", line 33, in __get__ res = instance.__dict__[self.name] = self.func(instance) File "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py", line 417, in url_patterns patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module) File "/usr/local/lib/python2.7/dist-packages/django/utils/functional.py", line 33, in __get__ res = instance.__dict__[self.name] = self.func(instance) File "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py", line 410, in urlconf_module return import_module(self.urlconf_name) File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module __import__(name) File "/app/lazy_balancer/lazy_balancer/urls.py", line 20, in <module> from .views import logout_view,login_view File "/app/lazy_balancer/lazy_balancer/views.py", line 10, in <module> from nginx.ip import * File "/app/lazy_balancer/nginx/ip.py", line 3, in <module> import iptc File "/usr/local/lib/python2.7/dist-packages/iptc/__init__.py", line 10, in <module> from iptc.ip4tc import (is_table_available, Table, Chain, Rule, Match, Target, File "/usr/local/lib/python2.7/dist-packages/iptc/ip4tc.py", line 13, in <module> from .xtables import (XT_INV_PROTO, NFPROTO_IPV4, XTablesError, xtables, File "/usr/local/lib/python2.7/dist-packages/iptc/xtables.py", line 704, in <module> raise XTablesError("can't find directory with extensions; " iptc.xtables.XTablesError: can't find directory with extensions; please set XTABLES_LIBDIR

请问怎么注释掉 iptables 相关代码(想使用,但是不懂)?
或者能否发布一个docker镜像,直接使用就可以了

from lazy-balancer.

v55448330 avatar v55448330 commented on September 3, 2024

注释如下:
nginx/ip.py
line all

lazy_balancer/views.py
line 10: from nginx.ip import *
line 25: set_firewall()

proxy/views.py
line 11: from nginx.ip import *
line 227: set_firewall()

settings/views.py
line 7: from nginx.ip import set_firewall
line 61: set_firewall()

from lazy-balancer.

v55448330 avatar v55448330 commented on September 3, 2024

我正在考虑将 iptables 控制取消掉,这样就可以跑在 docker 容器中了;目前临时解决办法是支持 vagrant 方式部署,你可以直接在目录中用 vagrant up 启动项目(请注意修改 box 为你自己的 ubuntu box)

from lazy-balancer.

wizardbyron avatar wizardbyron commented on September 3, 2024

最主要还是django依赖的问题,解决这个问题django有点重。想想办法能不能换个轻量级的。

from lazy-balancer.

v55448330 avatar v55448330 commented on September 3, 2024

@wizardbyron 其实 Django 已经很轻量了,主要是很方便的封装了很多实现,比如数据库,缓存,异步任务,配置,路由等。更关键的是有强大的扩展支持,依赖这个东西简单也复杂,各取所需;
后面需要想办法把部分依赖做成可插拔的方式实现就可以支持容器了。
另外这个项目诞生的时候定位的就是虚拟机、轻量级物理机平台(ATOM)等,通过这个项目,可以定制一些简单的物理负载均衡器,解决的是商用负载均衡器性价比和操作复杂的问题。

from lazy-balancer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.