statusengine / worker

PHP worker process that writes all event data to a storage backend
https://statusengine.org/worker/#overview
GNU General Public License v3.0
9 stars 8 forks source link

failed to open stream: Connection refused #30

Closed ester936 closed 3 years ago

ester936 commented 3 years ago

Hello, I currently have a problem with statusengine-ui users. The problem is that I can't create users and look at the user list. I can't connect to the statusengine web interface. I followed your tutorial to install statusengine. I join you below the captures showing the different problems.

Thank you for your help

image

image

{ "error": "No more servers available, exception from last server: Error creating resource: [message] fopen(http://172.0.0.1:4200/_sql): failed to open stream: Connection refused\n[file] /usr/share/statusengine-ui/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php\n[line] 324" }

nook24 commented 3 years ago

What database backend did you use? Because it looks like your system is configured to use CrateDB (http://172.0.0.1:4200).

Both screenshots are showing the same issue - Statusengine can not connect to the database backend. Probably it is not running or not installed. If you are new to Linux i would recommend to go with MySQL, it's much easier to setup in my optionion.

ester936 commented 3 years ago

As you said in your message I had not installed a database. So I installed Mysql 8. The problem is that I still have errors. Sorry if I still make mistakes that seem obvious because I am still a beginner on debian. I join you below the captures showing the different problems. Thanks for your help.

image

image

image

image

ester936 commented 3 years ago

Sorry for spamming but I've been looking all day and I think I've solved the problem above. But I'm getting another error message. I think I need to create a table in the statusengine database but I don't know how to create it properly.

Thanks for you help

image

nook24 commented 3 years ago

So far so good :)

The installation process is actually pretty straightforward.

From the docs: https://statusengine.org/worker/#installation

  1. First you need to create a new MySQL user and database:

    CREATE USER 'statusengine'@'localhost' IDENTIFIED BY 'password';
    CREATE DATABASE IF NOT EXISTS `statusengine` DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
    GRANT ALL PRIVILEGES ON `statusengine`.* TO 'statusengine'@'localhost';

    Please make sure to use a secure password at IDENTIFIED BY 'password';

  2. Set MySQL as datasource in /opt/statusengine/worker/etc/config.yml:

    
    # Important ! Enable MySQL
    use_mysql: 1

Configuration of your MySQL server

mysql: host: 127.0.0.1 port: 3306 username: statusengine password: password database: statusengine encoding: utf8

Important ! Disable CreateDB

use_crate: 0

process_perfdata: 1

perfdata_backend:

This should be everything you need to change in the configuration file.

  1. Create the database tables
    /opt/statusengine/worker/bin/Console.php database --update

That's it.


I also created a script a few days ago which can install Statusengine + Statusengine Interface. It is not mode for production usage !!! How ever you can use it as a step by step guide:

https://gist.github.com/nook24/0e5f870f6492d6a8cbb69982654aa934

nook24 commented 3 years ago

I'm closing this due to inactivity. Feel free to reopen if you still have any issues.