Hi Joe, if you want to automate the installation of Graylog and its dependencies, you should use one of our existing recipes/modules/playbooks for Chef, Puppet, or Ansible instead of writing your own bash script; see http://docs.graylog.org/en/1.1/pages/installation/config_management_tools.html for details.
Cheers, Jochen On Tuesday, 28 July 2015 10:07:30 UTC+2, Joe wrote: > > I am trying to install mongodb, elasticsearch, graylog2 and > graylog2-web-interface on one server using Ubuntu 14.04, but I am getting > errors such as java does not have enough memory. Ill post my script and > hopefully someone can tell me what I am doing wrong and will help someone > else down the line. > > #!/bin/bash > > # > # Should use NTP on all machines for time sync > # > > #Install Java 7 > cd > sudo apt-add-repository ppa:webupd8team/java > sudo apt-get update > sudo apt-get install oracle-java7-installer > read -rep $'\n+++Java Done.+++\n\nPress [Enter] key to continue...' > > #Install MongoDB - > http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/ > cd > sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10 > printf "deb http://repo.mongodb.org/apt/ubuntu "$(lsb_release > -sc)"/mongodb-org/3.0 multiverse" | sudo tee > /etc/apt/sources.list.d/mongodb-org-3.0.list > sudo apt-get update > sudo apt-get install -y mongodb-org > sudo service mongod start > printf "\nVerify that the mongod process has started successfully by > checking the ..." > printf "contents of the log file at /var/log/mongodb/mongod.log for a line > reading ..." > printf "[initandlisten] waiting for connections on port <port>" > gnome-terminal -e 'nano /var/log/mongodb/mongod.log' > read -rep $'\n\n+++MongoDB Done.+++\n\nPress [Enter] key to continue...' > > #Install elasticsearch - https://www.elastic.co/downloads/elasticsearch > cd > wget > https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-1.7.0.deb > sudo dpkg -i elasticsearch-1.7.0.deb > gnome-terminal -e 'sudo nano /etc/elasticsearch/elasticsearch.yml' > read -rep $'\nEdit Lines:\n\tcluster.name: graylog2\n\tnetwork.bind_host: > 127.0.0.1\n\tAdd: script.disable_dynamic: true\n\nPress enter when done > editing and saved.' > sudo service elasticsearch restart > sudo apt-get install curl > curl -XGET 'http://localhost:9200/_cluster/health?pretty=true' #might > fail if not enough time, but good > read -rep $'\n+++ElasticSearch Done.+++\n\nPress [Enter] key to > continue...' > > > #Install graylog-server > cd > wget > https://packages.graylog2.org/releases/graylog2-server/graylog-1.1.4.tgz > tar xvfz graylog-1.1.4.tgz > cd graylog-1.1.4 > sudo mkdir /etc/graylog #### The website directions assume this is a > dir? > sudo mkdir /etc/graylog/server #### > sudo cp graylog.conf.example /etc/graylog/server/server.conf > sudo apt-get install pwgen #Check if not already installed > SECRET=$(pwgen -s 96 1) > sudo -E sed -i -e 's/password_secret =.*/password_secret = '$SECRET'/' > /etc/graylog/server/server.conf > PASSWORD=$(echo -n password | shasum -a 256 | awk '{print $1}') > sudo -E sed -i -e 's/root_password_sha2 =.*/root_password_sha2 = > '$PASSWORD'/' /etc/graylog/server/server.conf > gnome-terminal -e 'sudo nano /etc/graylog/server/server.conf' > read -rep $'\n Just change elasticsearch_shards to 0.... or \n\nEdit file > with directions here: > http://docs.graylog.org/en/1.1/pages/installation/manual_setup.html#downloading-and-extracting-the-server\n\nPress > > enter when done editing and saved.' > #sudo nano /etc/graylog/server/server.conf > sudo apt-get install openjdk-7-jre > cd bin/ > ./graylogctl start > read -rep $'\n+++GrayLog-Server Done.+++\n\nPress [Enter] key to > continue...' > > #Install graylog-web interface > cd > wget > https://packages.graylog2.org/releases/graylog2-web-interface/graylog-web-interface-1.1.4.tgz > tar xvfz graylog-web-interface-1.1.4.tgz > cd graylog-web-interface-1.1.4 > SECRET=$(pwgen -s 96 1) > sudo -E sed -i -e > 's/application\.secret=""/application\.secret="'$SECRET'"/' > conf/graylog-web-interface.conf > gnome-terminal -e 'sudo nano conf/graylog-web-interface.conf' > read -rep $'\n Just change > graylog2-server.uris=\"http://127.0.0.1:12900/\".... > or \n\nEdit file with directions here: > http://docs.graylog.org/en/1.1/pages/installation/manual_setup.html#downloading-and-extracting-the-server > ' > #sudo nano conf/graylog-web-interface.conf > bin/graylog-web-interface > read -rep $'\n+++GrayLog-Web-Interface Done.+++\n\nPress [Enter] key to > continue...' > > > -- You received this message because you are subscribed to the Google Groups "graylog2" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
