• New Relic – instalacja agenta PHP w CentOS 7

    dodany przez Przemysław Sikora

    Google Analytics jest wspaniałym narzędziem i to nie ulega dyskusji. Czasem potrzeba jednak innych narzędzi, o bardziej rozbudowanych możliwościach. Jedną z najbardziej popularnych alternatyw jest New Relic. Poniżej prezentuję instrukcję instalacji i wstępnej konfiguracji agenta PHP tegoż serwisu.

    rpm -Uvh http://yum.newrelic.com/pub/newrelic/el5/x86_64/newrelic-repo-5-3.noarch.rpm
    yum install newrelic-php5
    newrelic-install install

    Czego efektem powinno być:
    New Relic PHP Agent Installation (interactive mode)
    ===================================================

    Enter New Relic license key (or leave blank):

    New Relic PHP Agent Installation (interactive mode)
    ===================================================

    Enter New Relic license key (or leave blank): 30a8d35503a3ab93c8ceefcdbc20039d71906276

    Below is a list of the directories in which we found a copy of PHP.
    Please select the directory or directories for which you wish to install
    New Relic. You can select either a single directory or
    multiple directories by separating each choice with either a space or a
    comma. To select all of the directories shown, please enter the special
    keyword 'all' (without the quotes).

    1) /bin
    2) /usr/bin

    0) Exit

    Selection (1-2, 0 to exit or all): 1

    Found a valid PHP in : /usr/bin
    PHP Version : 5.6.30
    Module API version : 20131226
    Module directory : /usr/lib64/php/modules
    Zend Thread Safety : no
    CLI ini directory : /etc/php.d
    Install Status : OK

    New Relic is now installed on your system. Congratulations!

    Następnie przystępujemy do edycji pliku konfiguracyjnego „newrelic.ini”:

    vim /etc/php.d/newrelic.ini

    Proszę dodać lub odkomentować poniższe opcje, wpisując spersonalizowane wartości.
    newrelic.appname = "super-strona.org"
    newrelic.daemon.port = "/var/run/.newrelic.sock"
    newrelic.daemon.ssl = true

    systemctl restart php-fpm

    Efekty naszych działań możemy obserwować w poniższych logach:

    tail -f /var/log/newrelic/newrelic-daemon.log

    2017/10/10 17:17:15.078947 (30550) Info: watcher received signal 15 - exiting
    2017/10/10 17:17:15.079055 (30556) Info: worker received signal 15 - exiting
    2017/10/10 17:18:30.146919 (31643) Info: New Relic daemon version 7.5.0.199-00258123e757 [listen="/var/run/.newrelic.sock" ssl=enabled startup=agent pid=31643 ppid=31642 uid=0 euid=0 gid=0 egid=0 runtime="go1.8.3" GOMAXPROCS=6 GOOS=linux GOARCH=amd64]
    2017/10/10 17:18:30.153544 (31649) Info: New Relic daemon version 7.5.0.199-00258123e757 [listen="/var/run/.newrelic.sock" ssl=enabled startup=agent pid=31649 ppid=1 uid=0 euid=0 gid=0 egid=0 runtime="go1.8.3" GOMAXPROCS=6 GOOS=linux GOARCH=amd64]
    2017/10/10 17:18:30.160183 (31655) Info: New Relic daemon version 7.5.0.199-00258123e757 [listen="/var/run/.newrelic.sock" ssl=enabled startup=agent pid=31655 ppid=31649 uid=0 euid=0 gid=0 egid=0 runtime="go1.8.3" GOMAXPROCS=6 GOOS=linux GOARCH=amd64]
    2017/10/10 17:18:30.160242 (31655) Info: increased file limit to 2048
    2017/10/10 17:18:30.160283 (31655) Info: collector configuration is &{CAFile: CAPath: Proxy:}
    2017/10/10 17:18:30.160523 (31655) Info: daemon listening on /var/run/.newrelic.sock
    2017/10/10 17:18:33.364736 (31655) Info: Reporting to: https://rpm.newrelic.com/accounts/1752307/applications/7103788
    2017/10/10 17:18:33.364873 (31655) Info: app 'super-strona.org' connected with run id '3215042346828135'

    Po kilku minutach, w panelu New Relic powinny pojawić się dane o monitorowanej stronie/serwisie.

Dodaj komentarz

Warto odwiedzić
Valid XHTML 1.0 Transitional centos.com.pl- mapa strony