admin-username error of proxy - mysql

I tried to install proxy on development machine and I got the following error.
/etc/init.d/mysql-proxyd start
Starting mysql-proxy: 2011-02-26 15:51:45: (critical) admin-plugin.c:569: --admin-username needs to be set
2011-02-26 15:51:45: (critical) mainloop.c:267: applying config of plugin admin failed
2011-02-26 15:51:45: (critical) mysql-proxy-cli.c:596: Failure from chassis_mainloop. Shutting down.
[ OK ]
Since this is only a test machine, I do not want the security feature of proxy. How do I avoid the above error?

Either upgrade your version of mysql-proxy to 0.8.2 or greater or explicitly specify that you don't need the admin plugin by using mysql-proxy --plugins=proxy

[mysql-proxy]
daemon = true
user = mysql
proxy-skip-profiling = true
keepalive = true
max-open-files = 2048
event-threads = 50
pid-file = /var/run/mysql-proxy.pid
log-file = /var/log/mysql-proxy.log
log-level = debug
admin-address=:4401
admin-username=1
admin-password=1
admin-lua-script=/usr/local/lib/mysql-proxy/lua/admin.lua
proxy-address = 0.0.0.0:3307
proxy-backend-addresses = 192.168.2.1:3306
proxy-read-only-backend-addresses=192.168.6.2:3306, 192.168.6.1:3306
proxy-lua-script=/usr/lib/mysql-proxy/lua/proxy/balance.lua

Related

Packer Autoinstall with Ubuntu 21.04/21.10 Desktop

I was trying to automate a Packer build of Ubuntu Desktop 21.04 in vSphere with the HCL below. I since found that this will only start to work from 21.10 for desktop images.
See:
https://discourse.ubuntu.com/t/refreshing-the-ubuntu-desktop-installer/20659/76?u=nathanto
The original question is below to help others.
The key piece is where the boot command defines the seedfrom. That seems not to work in the sense that the user-data is never loaded. The VM boots, and the net.ifnames=0 argument from the boot command is applied (interfaces are named eth0).
The logic of the boot command is to press c to get to the grub> prompt, and then the commands are entered as shown in the boot_command below.
I see in the /proc/cmdline that the boot command is applied properly.
I can see no indication that the user-data is loaded though. If I look at the web server shown in the boot command, using Firefox from the booted VM, the user-data and meta-data files are there and accessible.
Does anyone have any ideas of how to debug this please?
source "vsphere-iso" "dev_vm" {
username = var.vcenter_username
password = var.vcenter_password
vcenter_server = var.vcenter_server
cluster = var.vcenter_cluster
datacenter = var.vcenter_datacenter
datastore = var.vcenter_vm_datastore
guest_os_type = "ubuntu64Guest"
insecure_connection = "true"
iso_checksum = "sha256:fa95fb748b34d470a7cfa5e3c1c8fa1163e2dc340cd5a60f7ece9dc963ecdf88"
iso_urls = ["https://releases.ubuntu.com/21.04/ubuntu-21.04-desktop-amd64.iso"]
http_directory = "./http"
vm_name = "dev_vm"
CPUs = 2
RAM = 2048
RAM_reserve_all = true
boot_wait = "3s"
convert_to_template = false
boot_command = [
"c",
"linux /casper/vmlinuz --- autoinstall ds='nocloud-net;seedfrom=http://{{.HTTPIP}}:{{.HTTPPort}}/' net.ifnames=0 ",
"<enter><wait>",
"initrd /casper/initrd<enter><wait>",
"boot<enter>"
]
network_adapters {
network = "xxx"
network_card = "e1000"
}
storage {
disk_size = 40960
disk_thin_provisioned = true
}
ssh_username = "xx"
ssh_password = "xx"
ssh_timeout = "60m"
}
build {
sources = [
"source.vsphere-iso.dev_vm"
]
...
}
I was working with packer with virtualbox installing Ubuntu server 20.04 with autoinstall and I watched the installation process happen. What I see is cloud init running and then after it reaches the point where on 20.04 the server reboots itself, the graphical installer launches.
I have tried 8 or 9 versions of the boot_command that people swear works and so far none of them have. I am looking for how people create the boot_command. I am new to Ubuntu autoinstall and packer, so I am learning.
Also they are revamping ubiquity
https://discourse.ubuntu.com/t/refreshing-the-ubuntu-desktop-installer/20659/73
So this may impact you as well.

SphinxQL + sphinxsearch table doesn't exists

Today I was trying to use sphinxsearch with SphinxQL but something going bad =\
First I installed sphinxsearch then I configured it, after that I created index forum_index using indexer --all. All finished without errors.
Then I included SphinxQl to my project, typed host and port which is listening sphinx and tried to make a query like in ReadMe of SphinxQL:
// create a SphinxQL Connection object to use with SphinxQL
$conn = new Connection();
$conn->setParams(array('host' => 'localhost', 'port' => 9306))
;
But it caused a database access error:
access denied www-data#localhost password NO
After that I set parameters of username and password in SphinxQL using
mysqli::real_connect()
Previous errors disappeared
Then I tried to make a test query:
$query = SphinxQL::create($conn)->select('column_one', 'colume_two')
->from('forum_index');
$result = $query->execute();
But I get an error:
table forum_index doesn't exists
I have a feel that my SphinxQL doesn't see sphinx or sphinx config and tries to make a simple query.
Have you any idea what's going wrong?
Please go to command line use the following command
mysql -P9306 --protocol=tcp --prompt='sphinxQL> '
Once get sphinxQL prompt enter the following command
sphinxQL> show tables;
If you set up everything correctly you can see the forum_index table in the list. Else check your searchd configuration section in your sphinx.conf file for proper configuration. My configuration look like this
searchd {
listen = 9315
listen = 9306:mysql41
log = /Users/XXXX/projects/sphinx/data/searchd.log
query_log = /Users/XXXX/projects/sphinx/data/query.log
read_timeout = 5
max_children = 30
pid_file = /Users/XXXX/projects/sphinx/data/searchd.pid
max_matches = 1000
seamless_rotate = 1
preopen_indexes = 0
unlink_old = 1
workers = threads
thread_stack = 1024K
}
I solved my problem by setting host = '127.0.0.1' in SphinxQL params

my gitlab build on digital-ocean cannot send mail to new user

i tried to configure SMTP in my Gitlab-Instance (following this guideline). but dont get it working.
gitlab.rb
gitlab_rails['gitlab_email_from'] = "admin#example.com"
gitlab_rails['gitlab_support_email'] = "admin#example.com"
#nginx['redirect_http_to_https'] = false
#nginx['ssl_certificate'] = "/etc/gitlab/ssl/gitlab.crt"
#nginx['ssl_certificate_key'] = "/etc/gitlab/ssl/gitlab.key"
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = 'smtp.exmail.qq.com'
gitlab_rails['smtp_port'] = 25
gitlab_rails['smtp_user_name'] = 'admin#example.com'
gitlab_rails['smtp_password'] = 'has been removed'
gitlab_rails['smtp_domain'] = 'smtp.qq.com'
gitlab_rails['smtp_authentication'] = :plain
gitlab_rails['smtp_enable_starttls_auto'] = true
production.log
Sent mail to i#example.com (8017.5ms)
mail.log
May 9 09:02:14 nday postfix/smtp[27203]: B16EF12019C: to=<i#example.com>, relay=none, delay=1049, delays=1017/0.04/32/0, dsn=4.4.3, status=deferred (Host or domain name not found. Name service error for name=mxbiz2.qq.com type=AAAA: Host not found, try again)s
May 9 09:02:14 nday postfix/smtp[27202]: 40274120CA7: to=<i#example.com>, relay=none, delay=988, delays=955/0.04/32/0, dsn=4.4.3, status=deferred (Host or domain name not found. Name service error for name=mxbiz2.qq.com type=AAAA: Host not found, try again)
BTW:I have changed the DNS and refresh. mail.log haven't logged my operation. It's old log.
Is your account new on Digital Ocean?
If yes, you need to ask them to unlock sendmail functionality.
This unlock is by account, not by droplet.
You will can use sendmail in all others droplets created by you after this unlock.

JRuby / Warbler / GlassFish - (NameError) uninitialized constant ApplicationController::SessionsHelper

Really Short Story:
I'm incredibly frustrated by this issue
Short Story:
JRuby-1.7.2 building to a .war using Warbler (1.3.8) deploying to a glassfish v3 server. I can build on my machine and everything works fine, however when I try to build with Jenkins, the war gives the following error when trying to load the first page:
org.jruby.exceptions.RaiseException: (NameError) uninitialized constant ApplicationController::SessionsHelper
Long Story:
Build script on our Jenkins server:
#path to rvm
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
# Use the correct ruby
rvm use "jruby-1.7.2#webadmin"
# Set "fail on error" in bash
set -e
# build
bundle update
warble compiled war
Error log from Glassfish....which I hope has enough info.
[#|2013-05-31T17:10:14.634-0400|INFO|glassfish3.1.2|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=19;_ThreadName=Thread-2;|PWC1412: WebModule[null] ServletContext.log():INFO: pool was empty - getting new application instance|#]
[#|2013-05-31T17:10:25.181-0400|INFO|glassfish3.1.2|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=19;_ThreadName=Thread-2;|PWC1412: WebModule[null] ServletContext.log():An exception happened during JRuby-Rack startup
uninitialized constant ApplicationController::SessionsHelper
--- System
jruby 1.7.4 (1.9.3p392) 2013-05-16 2390d3b on OpenJDK 64-Bit Server VM 1.6.0_27-b27 [linux-amd64]
Time: 2013-05-31 17:10:25 -0400
Server: GlassFish Server Open Source Edition 3.1.2.2
jruby.home: classpath:/META-INF/jruby.home
--- Context Init Parameters:
com.sun.faces.forceLoadConfiguration = true
com.sun.faces.validateXml = true
public.root = /
rails.env = production
--- Backtrace
NameError: uninitialized constant ApplicationController::SessionsHelper
--- RubyGems
Gem.dir: /opt/glassfish3/glassfish/domains/myDomain/applications/web-admin/WEB-INF/gems
Gem.path:
/opt/glassfish3/glassfish/domains/myDomain/applications/web-admin/WEB-INF/gems
Activated gems:
bundler-1.3.5
rake-10.0.4
i18n-0.6.1
multi_json-1.7.4
activesupport-3.2.13
builder-3.0.4
activemodel-3.2.13
erubis-2.7.0
journey-1.0.4
rack-1.4.5
rack-cache-1.2
rack-test-0.6.2
hike-1.2.2
tilt-1.4.1
sprockets-2.2.2
actionpack-3.2.13
mime-types-1.23
polyglot-0.3.3
treetop-1.4.12
mail-2.5.4
actionmailer-3.2.13
arel-3.0.2
tzinfo-0.3.37
activerecord-3.2.13
activeresource-3.2.13
gyoku-1.0.0
nokogiri-1.5.9-java
akami-1.2.0
bcrypt-ruby-3.0.1-java
sass-3.2.9
bootstrap-sass-2.3.1.2
will_paginate-3.0.4
bootstrap-will_paginate-0.0.9
bouncy-castle-java-1.5.0147
coffee-script-source-1.6.2
execjs-1.4.0
coffee-script-2.2.0
rack-ssl-1.3.3
json-1.8.0-java
rdoc-3.12.2
thor-0.18.1
railties-3.2.13
coffee-rails-3.2.2
faker-1.1.2
httpi-2.0.2
jquery-rails-2.2.2
jruby-openssl-0.8.8
nori-2.1.0
rails-3.2.13
sass-rails-3.2.6
wasabi-3.1.0
savon-2.2.0
therubyrhino_jar-1.7.4
therubyrhino-2.0.2
uglifier-1.0.4
uuidtools-2.1.4
--- Bundler
Bundler.bundle_path: /opt/glassfish3/glassfish/domains/myDomain/applications/web-admin/WEB-INF/gems
Bundler.root: /opt/glassfish3/glassfish/domains/myDomain/applications/web-admin/WEB-INF
Gemfile: /opt/glassfish3/glassfish/domains/myDomain/applications/web-admin/WEB-INF/Gemfile
Settings:
gemfile = /opt/glassfish3/glassfish/domains/myDomain/applications/web-admin/WEB-INF/Gemfile
without = development:test:assets
bin_path = /opt/glassfish3/glassfish/domains/myDomain/applications/web-admin/WEB-INF/gems/gems/bundler-1.3.5/bin/bundle
--- JRuby-Rack Config
compat_version =
default_logger = org.jruby.rack.logging.StandardOutLogger#62a49a04
equals =
err = com.sun.common.util.logging.LoggingOutputStream$LoggingPrintStream#7a21bdb8
filter_adds_html = true
filter_verifies_resource = false
ignore_environment = false
initial_memory_buffer_size =
initial_runtimes =
jms_connection_factory =
jms_jndi_properties =
logger = org.jruby.rack.logging.ServletContextLogger#19a2312c
logger_class_name = servlet_context
logger_name = jruby.rack
maximum_memory_buffer_size =
maximum_runtimes =
num_initializer_threads =
out = com.sun.common.util.logging.LoggingOutputStream$LoggingPrintStream#52f8d395
rackup =
rackup_path =
rewindable = true
runtime_arguments =
runtime_environment =
runtime_timeout_seconds =
serial_initialization = false
servlet_context = org.apache.catalina.core.ApplicationContextFacade#16c7e149
throw_init_exception = false
|#]
[#|2013-05-31T17:10:25.182-0400|INFO|glassfish3.1.2|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=19;_ThreadName=Thread-2;|PWC1412: WebModule[null] ServletContext.log():DEBUG: resetting rack response due exception|#]
Turns out it was an issue with source code control. My helpers directory was not added and therefore Jenkins was not including in the build. Always check the obvious first, if it says it isn't there it probably isn't.

PHP5-FPM and MYSQL

I'm using lighttpd and pfp-fpm.
All work correctly, but if I call a mysql_connect() on my php scripts I get an empty page.
Like a "denied operation".
This is my php-fpm.conf pool
[example.com]
listen = 127.0.0.1:9001
listen.backlog = -1
user = example.com
group = example.com
pm = dynamic
pm.max_requests = 0
pm.max_children = 2
pm.start_servers = 1
pm.min_spare_servers = 1
pm.max_spare_servers = 1
chroot = /home/vhosts/example.com/
request_terminate_timeout = 2
request_slowlog_timeout = 1
slowlog = /home/vhosts/example.com/log/php-slow.log
catch_workers_output = yes
env[HOSTNAME] = $HOSTNAME
env[PATH] = /usr/local/bin:/usr/bin:/bin
env[TMP] = /tmp
env[TMPDIR] = /tmp
env[TEMP] = /tmp
This is my lighttpd vhost:
$HTTP["host"] =~ "(^|.)example\.com$" {
server.document-root = "/home/vhosts/example.com/web"
server.errorlog = "/home/vhosts/example.com/log/error.log"
accesslog.filename = "/home/vhosts/example.com/log/access.log"
fastcgi.server = (
".php" => (
"localhost" => (
"docroot" => "/web",
"host" => "127.0.0.1",
"port" => "9001"
)
)
)
}
What is wrong? If I don't use mysql I can see the result of the php script correctly.
Turning on error display and posting those errors would be helpful, but since you can use mysql without chrooting php, I guess you are getting some connection error, since php tries to connect to mysql on localhost using socket ( php compiled with --with-mysql-sock=/var/mysql.sock), and most likely this socket is outside your chrooted environment.
You can try:
Recompiling php to not use socket
creating hard link to socket in your chrooted path
using some internal ip (like 10.0.0.1,192.168.0.1) instead of loopback
Seems to me all the problems are because of the user and group being example.com
i guess that user doesnt have rights to perform the requested tasks