Ask Your Question
0

Funapi Dashboard 설치 질문 드립니다.3

asked 2019-06-04 14:40:05 +0900

xodbs gravatar image

Ubuntu 16.04.5 LTS 버전에서 대시보드 메뉴얼을 통해서 (https://ifunfactory.com/engine/docume...) 설치하고 실행하였으나, 아래처럼 오류가 발생하네요. 기존 Funapi Dashboard 질문들 참고해서 셋팅 했는데도 문제는 동일한 상황입니다.

File "/etc/funapi_dashboard/manage.py", line 27, in <module> from funapi_dashboard import app, db, redis_store File "/usr/lib/python2.7/dist-packages/funapi_dashboard/__init__.py", line 21, in <module> app.config.from_envvar('FUNAPI_DASHBOARD_SETTINGS') File "/usr/lib/python2.7/dist-packages/flask/config.py", line 108, in from_envvar return self.from_pyfile(rv, silent=silent) File "/usr/lib/python2.7/dist-packages/flask/config.py", line 128, in from_pyfile with open(filename) as config_file: IOError: [Errno 2] Unable to load configuration file (No such file or directory): '/etc/funapi_dashboard/override/settings.py'

edit retag flag offensive close merge delete

3 answers

Sort by » oldest newest most voted
0

answered 2019-06-04 15:56:14 +0900

xodbs gravatar image

updated 2019-06-04 15:57:27 +0900

mysql 연결 에러가 나오는데요. ...... connection = self.__pool._invoke_creator(self) File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/strategies.py", line 97, in connect return dialect.connect(cargs, *cparams) File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line 385, in connect return self.dbapi.connect(cargs, *cparams) File "/usr/lib/python2.7/dist-packages/MySQLdb/__init__.py", line 81, in Connect return Connection(args, *kwargs) File "/usr/lib/python2.7/dist-packages/MySQLdb/connections.py", line 204, in __init__ super(Connection, self).__init__(args, *kwargs2) sqlalchemy.exc.OperationalError: (_mysql_exceptions.OperationalError) (2003, "Can't connect to MySQL server on '127.0.0.1' (111)")

settings.py 정보는 아래와 같습니다. .............. URI_TEMPLATE = 'mysql+mysqldb://{USER}:{PASSWORD}@{HOST}/{NAME}?charset=utf8'

SQLALCHEMY_DATABASE_URI = URI_TEMPLATE.format(USER='root', PASSWORD='ykim6205#', HOST='127.0.0.1', NAME='dashboard')

........

sql 서버는 LISTEN 상태이고요. server@server:~$ netstat -ntl Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN

아래처럼 mysql 접속하면 잘되는 상황입니다.

server@server:~$ mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 4 Server version: 5.7.26-0ubuntu0.16.04.1 (Ubuntu)

Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | dashboard | | mysql | | performance_schema | | sys | +--------------------+ 5 rows in set (0.00 sec)

mysql>

edit flag offensive delete link more

Comments

HOST를 127.0.0.1이 아니라 서버 머신의 ip를 입력해봐주실 수 있을까요? (도커에서 바라보는 localhost 의 db에 접근하여 찾게됩니다.)

inkeun.kim gravatar imageinkeun.kim ( 2019-06-04 15:57:51 +0900 )edit

ip 변경후, 정상 동작 확인했습니다.

xodbs gravatar imagexodbs ( 2019-06-04 16:37:56 +0900 )edit

Dashboard 기본 포트 8000을 다른걸로 변경하려면 funapi-dashboard.service 파일에서 어떤 부분을 수정하면 되나요?

xodbs gravatar imagexodbs ( 2019-06-05 11:32:09 +0900 )edit

--publish=0.0.0.0:8000:8000 부분을 --publish={IP}:{port}:8000 으로 변경하면 됩니다.

Jinuk gravatar imageJinuk ( 2019-06-05 15:14:00 +0900 )edit
0

answered 2019-06-04 14:57:32 +0900

inkeun.kim gravatar image

updated 2019-06-04 14:57:57 +0900

안녕하세요 아이펀 팩토리입니다. service 파일을 아래와 같이 변경해주시고 서비스 재실행 가능할까요?

[Unit]
Description=iFunEngine Dashboard
After=syslog.target network-online.target
Requires=docker.service

[Service]
Type=simple
Restart=Always
RestartSec=10s
User=root
Group=root

ExecStart=/usr/bin/docker run --rm \
    --name=funapi_dashboard \
    --dns=127.0.0.1 \
    --publish=0.0.0.0:8000:8000 \ 
    --publish=0.0.0.0:2003:2003 \ 
    --publish=0.0.0.0:2004:2004 \ 
    -v /etc/funapi_dashboard/override:/etc/funapi_dashboard/override \
    -v var/lib/graphite/whisper:/var/lib/graphite/whisper \
    ifunfactory/funapi-dashboard:latest

ExecStop=/usr/bin/docker stop funapi_dashboard
ExecReload=/usr/bin/docker restart funapi_dashboard
edit flag offensive delete link more

Comments

-v var/lib/graphite/whisper:/var/lib/graphite/whisper \ 맨 앞에 슬래쉬 추가해서 진행하니 기존 에러는 해결이 되었습니다.

xodbs gravatar imagexodbs ( 2019-06-04 15:51:07 +0900 )edit
0

answered 2019-06-04 14:48:51 +0900

xodbs gravatar image

updated 2019-06-04 14:51:37 +0900

아래처럼 확인시 funapi-dashboard실행이 되어 있는 상태입니다. sudo service funapi-dashboard status ● funapi-dashboard.service - iFunEngine Dashboard Loaded: loaded (/lib/systemd/system/funapi-dashboard.service; static; vendor preset: enabled) Active: active (running) since Tue 2019-06-04 12:56:31 KST; 1h 43min ago Process: 24680 ExecStop=/usr/bin/docker stop funapi_dashboard (code=exited, status=0/SUCCESS) Main PID: 24774 (docker) Tasks: 7 Memory: 19.6M CPU: 236ms CGroup: /system.slice/funapi-dashboard.service └─24774 /usr/bin/docker run --rm --name=funapi_dashboard --dns=127.0.0.1 --publish=0.0.0.0:8000:8000 --publish=0.0.0.0:200

Jun 04 12:56:33 server docker[24774]: 2019-06-04 03:56:33,470 INFO spawned: 'nginx' with pid 12 Jun 04 12:56:33 server docker[24774]: 2019-06-04 03:56:33,508 INFO spawned: 'funapi-dashboard' with pid 13 Jun 04 12:56:33 server docker[24774]: 2019-06-04 03:56:33,512 INFO spawned: 'redis-server' with pid 14 Jun 04 12:56:33 server docker[24774]: 2019-06-04 03:56:33,520 INFO spawned: 'graphite-carbon' with pid 15 Jun 04 12:56:34 server docker[24774]: 2019-06-04 03:56:34,532 INFO success: graphite-api entered RUNNING state, process has stayed up Jun 04 12:56:34 server docker[24774]: 2019-06-04 03:56:34,532 INFO success: cron entered RUNNING state, process has stayed up for > t Jun 04 12:56:34 server docker[24774]: 2019-06-04 03:56:34,532 INFO success: nginx entered RUNNING state, process has stayed up for > Jun 04 12:56:34 server docker[24774]: 2019-06-04 03:56:34,533 INFO success: funapi-dashboard entered RUNNING state, process has staye Jun 04 12:56:34 server docker[24774]: 2019-06-04 03:56:34,533 INFO success: redis-server entered RUNNING state, process has stayed up Jun 04 12:56:34 server docker[24774]: 2019-06-04 03:56:34,533 INFO success: graphite-carbon entered RUNNING state, process has stayed

아래처럼 확인시 정보고 나오고 있습니다. sudo docker ps | grep funapi-dashboard 19bf8e0e6537 ifunfactory/funapi-dashboard:latest "/bin/sh -c 'chown -…" 2 hours ago Up 2 hours 0.0.0.0:2003-2004->2003-2004/tcp, 0.0.0.0:8000->8000/tcp, 8888/tcp funapi_dashboard

아래도 정상적으로 확인이 되고 있습니다. sudo docker images ifunfactory/funapi-dashboard REPOSITORY TAG IMAGE ID CREATED SIZE ifunfactory/funapi-dashboard latest e26821b648a7 11 months ago 509MB

설정 파일도 아래 처럼 있습니다. -rw-r--r-- 1 root root 2622 Jun 4 12:44 settings.py server@server:/etc/funapi_dashboard/override$ vim settings.py server@server:/etc/funapi_dashboard/override$

그리고 /lib/systemd/system/funapi-dashboard.service 파일은 내용은 아래와 같습니다.

[Unit] Description=iFunEngine Dashboard After=syslog.target network-online.target Requires=docker.service

[Service] Type=simple Restart=Always RestartSec=10s User=root Group=root

ExecStart=/usr/bin/docker run --rm \ --name=funapi_dashboard \ --dns=127.0.0.1 \ --publish=0.0.0.0:8000:8000 \ --publish=0.0.0.0:2003:2003 \ --publish=0.0.0.0:2004:2004 \ -v /etc/funapi_dashboard/override \ -v /var/lib/graphite/whisper \ ifunfactory/funapi-dashboard:latest

ExecStop=/usr/bin/docker stop funapi_dashboard ExecReload=/usr/bin/docker restart funapi_dashboard

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2019-06-04 14:40:05 +0900

Seen: 107 times

Last updated: Jun 04