Comments (11)
Can you send me a sample of your config file and command line (they can be fake, just want to see what flags and contents you are using.) I wrote a test and didn't see this problem. I will check in the test regardless, but want to make sure it replicates what you are doing.
from nats-account-server.
Thanks for the fast response. We used the config below, trying to use the account server as a master for another account server. In the first step we tried to reach the account server from a nats on another server.
OperatorJWTPath: "X:/some_path/NATS.jwt" systemaccountjwtpath: "X:/some_path/SYS.jwt" http: { host: "HOSTA", port: 9090, readtimeout: 5000, writetimeout: 5000 } store: { dir: "D:/nats/as_store", readonly: false, shard: false } logging: { debug: true, pid: true, time: true, trace: false, colors: true } nats: { servers: ["nats://HOSTA:4243","nats://HOSTB:4243"], usercredentials: "X:/some_path/admin.creds", ConnectTimeout: 5000, #MaxReconnects: 50 ReconnectWait: 10000 }
We were not able to access the account server on HOSTA from HOSTB. After setting the command line option "-hp" with the same value the account server was reachable.
nats-account-server.exe -c nats-account-server.config -ro -hp "HOSTA:9090"
Just before we realised, that when we set the host and port in the config and the server comes up, the log still shows the deafult resolver url:
[20144] 2019/06/19 09:25:48.398664 [←[32mINF←[0m] resolver: URL(http://localhost:9090/jwt/v1/accounts/)
After switching to commandline the log showed:
[19648] 2019/06/19 10:21:33.063197 [←[32mINF←[0m] resolver: URL(http://HOSTA:9090/jwt/v1/accounts/)
Hope, this will help to find the cause of the problem.
from nats-account-server.
hm, that is almost exactly my test, can you check that you have the latest version from master, we may not have updated the releases or something.
from nats-account-server.
wutkemtt let me know if you get a chance to try the latest code in master, i am curious if my test is somehow doing something different than your run.
from nats-account-server.
Hello,
I tried the latest code this morning with the same result. The http settings in the config file are completely ignored. Neither a different host nor a different port is used when set via config file. When adding the same values on the command line via the -hp option the setting is working.
Could it be that the complete http section is ignored within the config file ?
Other sections like store, logging and nats are working.
from nats-account-server.
from nats-account-server.
Hm, i updated my test with your config file and I still see the host coming through:
func TestStartWithConfigFileFlag(t *testing.T) {
file, err := ioutil.TempFile(os.TempDir(), "config")
require.NoError(t, err)
configString := `
OperatorJWTPath: "X:/some_path/NATS.jwt"
systemaccountjwtpath: "X:/some_path/SYS.jwt"
http: {
host: "HOSTA",
port: 9090,
readtimeout: 5000,
writetimeout: 5000 }
store: {
dir: "D:/nats/as_store",
readonly: false,
shard: false }
logging: {
debug: true,
pid: true,
time: true,
trace: false,
colors: true }
nats: {
servers: ["nats://HOSTA:4243","nats://HOSTB:4243"],
usercredentials: "X:/some_path/admin.creds",
ConnectTimeout: 5000,
ReconnectWait: 10000
}
`
fullPath, err := conf.ValidateFilePath(file.Name())
require.NoError(t, err)
err = ioutil.WriteFile(fullPath, []byte(configString), 0644)
require.NoError(t, err)
flags := Flags{
ConfigFile: fullPath,
}
server := NewAccountServer()
err = server.InitializeFromFlags(flags)
require.NoError(t, err)
require.Equal(t, "D:/nats/as_store", server.config.Store.Dir)
require.Equal(t, 5000, server.config.HTTP.ReadTimeout)
require.Equal(t, "HOSTA", server.config.HTTP.Host)
require.Equal(t, 9090, server.config.HTTP.Port)
}
Does anything jump out to you, maybe i have a typo I am missing?
from nats-account-server.
bah, i see the issue, the flags are defaulting to localhost:9090 and that has precedent. Testing a fix.
from nats-account-server.
Should be fixed, confirmed with test and manually.
from nats-account-server.
If you can't confirm fix, please feel free to reopen.
from nats-account-server.
I can confirm the fix is working. Host and port are taken from config now and the server is reachable as expected. Thanks.
from nats-account-server.
Related Issues (20)
- No Logs for when the account server connects to nats (only on reconnect)
- investigate adding pack support to nsc store
- Run nats-account-server as Windows Service HOT 1
- Are filesystem notifications required? HOT 1
- Exposition of port 9090 should be done before trying to communicate with Nats Cluster. To avoid the "Chicken and egg" issue HOT 3
- Algorithm Problem Activations
- `--primary` flag has no config file equivalent and it should.
- Host bind should default to 0.0.0.0
- Add --version flag
- Add `system_account` as in the NATS Server
- Add `operator` config as in the NATS Server
- Is `nats-io/jwt/v2` not supported with `nats-account-server` ? HOT 1
- panic: runtime error when revocation is done for a user
- nsc push results in 404 HOT 1
- some flags not working or missing
- Primary and replica
- staticcheck error S1017 HOT 1
- v1.0.0 release broken HOT 3
- Support for direct access of the nsc folder has been removed
- feature request - support db store for accounts HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nats-account-server.